Crash Site: Map Marker/Mission Notification

well some sort of progress i guess, i can see in the RPT that the markers are being called and place in the right pos but they just dont show up ingame??? its driving me crazy!!

heres what ive got so far
in crash_spawner.sqf above this line
Code:
     _endTime = time - _startTime;
paste this
Code:
//Heli crash Markers and alert player         

     crashPostion = getPos _crash; //find crash positon
     PublicVariable "crashPostion";// make crash postion available to the spawn marker script
     [] execVM "\z\addons\dayz_code\modules\crashmarker.sqf"; //call the spawn marker spawn script
now create a new sqf and call it crashmarker.sqf
Code:
  //CRASH SITE MAP MARKERS AND MESSAGE
     //Options
     HeliCrashMSG = true; //show message to players when wreck crashes
     HeliCrashMarker = true; //show crash locations with markers
     
     if ( HeliCrashMarker ) then{   
     //create marker at crash site
     _crashmarker = createMarker ["HeliCrashsiteMarker", crashPostion]; // create marker
     _crashmarker setMarkerShape "ELLIPSE"; //set marker shape
     _crashmarker setMarkerBrush "GRID"; // set marker brush
     _crashmarker setMarkerType "Vehicle"; //set marker type
     _crashmarker setMarkerText "CRASHED HELICOPTER"; //set marker text
     _crashmarker setMarkerColor "ColorBlue"; // set marker color
     //Debug
     diag_log(format["CRASH MARKER: marker created at %1", crashPostion]);//writes to RPT
     };
     //message players
     
     //if message are on
     if ( HeliCrashMSG ) then{
       //message if markers are on
       if ( HeliCrashMarker ) then{
         systemChat("A Helicopter has crashed! check your map for location!");
       };
     }else{
       //message if markers are off
       if ( HeliCrashMSG ) then{   
         systemChat("A Helicopter has crashed! Go search for it!");
       };
     };
     sleep 60; //how long to wait before removing marker 60 is 1 min, 120 is 2 min, etc
     deleteMarker _crashmarker
     deleteMarker "HeliCrashsiteMarker"//just in case
     diag_log(format["CRASH MARKER: marker deleted at %1", crashPostion]); //writes to RPT
now save it in the same folder as crash_spawner.sqf

thats it
im not sure how long wrecks stay for but i just made it delete the marker after 1 min for testing
 
well some sort of progress i guess, i can see in the RPT that the markers are being called and place in the right pos but they just dont show up ingame??? its driving me crazy!!

heres what ive got so far
in crash_spawner.sqf above this line
Code:
     _endTime = time - _startTime;
paste this
Code:
//Heli crash Markers and alert player       

     crashPostion = getPos _crash; //find crash positon
     PublicVariable "crashPostion";// make crash postion available to the spawn marker script
     [] execVM "\z\addons\dayz_code\modules\crashmarker.sqf"; //call the spawn marker spawn script
now create a new sqf and call it crashmarker.sqf
Code:
  //CRASH SITE MAP MARKERS AND MESSAGE
     //Options
     HeliCrashMSG = true; //show message to players when wreck crashes
     HeliCrashMarker = true; //show crash locations with markers
   
     if ( HeliCrashMarker ) then{ 
     //create marker at crash site
     _crashmarker = createMarker ["HeliCrashsiteMarker", crashPostion]; // create marker
     _crashmarker setMarkerShape "ELLIPSE"; //set marker shape
     _crashmarker setMarkerBrush "GRID"; // set marker brush
     _crashmarker setMarkerType "Vehicle"; //set marker type
     _crashmarker setMarkerText "CRASHED HELICOPTER"; //set marker text
     _crashmarker setMarkerColor "ColorBlue"; // set marker color
     //Debug
     diag_log(format["CRASH MARKER: marker created at %1", crashPostion]);//writes to RPT
     };
     //message players
   
     //if message are on
     if ( HeliCrashMSG ) then{
       //message if markers are on
       if ( HeliCrashMarker ) then{
         systemChat("A Helicopter has crashed! check your map for location!");
       };
     }else{
       //message if markers are off
       if ( HeliCrashMSG ) then{ 
         systemChat("A Helicopter has crashed! Go search for it!");
       };
     };
     sleep 60; //how long to wait before removing marker 60 is 1 min, 120 is 2 min, etc
     deleteMarker _crashmarker
     deleteMarker "HeliCrashsiteMarker"//just in case
     diag_log(format["CRASH MARKER: marker deleted at %1", crashPostion]); //writes to RPT
now save it in the same folder as crash_spawner.sqf

thats it
im not sure how long wrecks stay for but i just made it delete the marker after 1 min for testing
instead of using a publicvariable you could execute it like
Code:
_crashposition = getPos _crash;
[_crashposition] execVM "\z\addons\dayz_code\modules\crashmarker.sqf"; //call the spawn marker spawn script
then in crashmarker.sqf at the top do
Code:
_coords = _this select 0;
then
Code:
_crashmarker = createMarker ["HeliCrashsiteMarker", _coords];
 
Last edited:
instead of using a publicvariable you could execute it like
Code:
_crashposition = getPos _crash;
[_crash] execVM "\z\addons\dayz_code\modules\crashmarker.sqf"; //call the spawn marker spawn script
then in crashmarker.sqf at the top do
Code:
_coords = _this select 0;
then
Code:
_crashmarker = createMarker ["HeliCrashsiteMarker", _coords];
Making changes now :p
 
IT WORKS!!!
just need to delete markers when wreck dissapears

No how to do it!

first create a new file called crashmarker.sqf and copy the below code into it.


Code:
//Sheeps Crash Markers
// File Name: crashmarker.sqf
//Version : 0.2
     private["_nul"];
     _CrashCoords = _this select 0;
     //Options
     HeliCrashMSG = true; //show message to players when wreck crashes

     //create marker at crash site
     _nul = createMarker ["HeliCrashsiteMarker", _CrashCoords];
     "HeliCrashsiteMarker" setMarkerColor "ColorBlue";
     "HeliCrashsiteMarker" setMarkerShape "ELLIPSE";
     "HeliCrashsiteMarker" setMarkerBrush "Grid";
     "HeliCrashsiteMarker" setMarkerSize [175,175];
     diag_log(format["CRASH MARKER: marker created at %1", _CrashCoords]);

     //message players
  
     //if message are on
     if ( HeliCrashMSG ) then{
         systemChat("A Helicopter has crashed! check your map for location!");
     };
     //call marker loop for JIPs ( Joined in Progress)
     [_CrashCoords] execVM "\z\addons\dayz_server\modules\crashmarkerloop.sqf";
now save it in the same folder as crash_spawner.sqf
(SERVER PBO - addons/dayz_server/modules/ )

create another file called crashmarkerloop.sqf and copy the below code into it.
Code:
//Sheeps Crash Markers JIPS
// File Name: crashmarkerloop.sqf
//Version : 0.2
private["_run","_nul"];

diag_log text format ["[CRASH MARKERS]: Marker Loop for JIPs Starting!"];
_CrashCoords = _this select 0;

if (isNil "HeliCrashsiteMarker")then{_CrashCoords = [0,0,0];};
//Lets start the timer
_run = true;
while {_run} do
{
  sleep 25; // sleep 25 seconds
   //If the marker exists (meaning the mission is active) lets delete it and re-add it
   if (!(getMarkerColor "HeliCrashsiteMarker" == "")) then {
     deleteMarker "HeliCrashsiteMarker";
     //Re-Add the markers
     _nul = createMarker ["HeliCrashsiteMarker", _CrashCoords];
     "HeliCrashsiteMarker" setMarkerColor "ColorBlue";
     "HeliCrashsiteMarker" setMarkerShape "ELLIPSE";
     "HeliCrashsiteMarker" setMarkerBrush "Grid";
     "HeliCrashsiteMarker" setMarkerSize [175,175];
     diag_log(format["CRASH MARKER: marker reset at %1", _CrashCoords]);
   };
};
now save it in the same folder as crash_spawner.sqf
(SERVER PBO - addons/dayz_server/modules/ )

now open crash_spawner.sqf and just under this line
Code:
_crash setVariable ["ObjectID","1",true];
put this
Code:
//Heli crash Markers and alert player      
     heliCrash = _pos;
     [heliCrash] execVM "\z\addons\dayz_server\modules\crashmarker.sqf"; //call the spawn marker spawn script

and at the very end of the file add this (after the last } )

Code:
    publicVariable "heliCrash";
save everything, re PBO server files and thats all there is just need to make marker delete when wreck dissappears!!
 
Last edited:
IT WORKS!!!
just need to delete markers when wreck dissapears

No how to do it!

first create a new file called crashmarker.sqf and copy the below code into it.


Code:
//Sheeps Crash Markers
// File Name: crashmarker.sqf
//Version : 0.2
     private["_nul"];
     _CrashCoords = _this select 0;
     //Options
     HeliCrashMSG = true; //show message to players when wreck crashes

     //create marker at crash site
     _nul = createMarker ["HeliCrashsiteMarker", _CrashCoords];
     "HeliCrashsiteMarker" setMarkerColor "ColorBlue";
     "HeliCrashsiteMarker" setMarkerShape "ELLIPSE";
     "HeliCrashsiteMarker" setMarkerBrush "Grid";
     "HeliCrashsiteMarker" setMarkerSize [175,175];
     diag_log(format["CRASH MARKER: marker created at %1", _CrashCoords]);

     //message players
 
     //if message are on
     if ( HeliCrashMSG ) then{
         systemChat("A Helicopter has crashed! check your map for location!");
     };
     //call marker loop for JIPs ( Joined in Progress)
     [_CrashCoords] execVM "\z\addons\dayz_server\modules\crashmarkerloop.sqf";
now save it in the same folder as crash_spawner.sqf
(SERVER PBO - addons/dayz_server/modules/ )

create another file called crashmarkerloop.sqf and copy the below code into it.
Code:
//Sheeps Crash Markers JIPS
// File Name: crashmarkerloop.sqf
//Version : 0.2
private["_run","_nul"];

diag_log text format ["[CRASH MARKERS]: Marker Loop for JIPs Starting!"];
_CrashCoords = _this select 0;

if (isNil "HeliCrashsiteMarker")then{_CrashCoords = [0,0,0];};
//Lets start the timer
_run = true;
while {_run} do
{
  sleep 25; // sleep 25 seconds
   //If the marker exists (meaning the mission is active) lets delete it and re-add it
   if (!(getMarkerColor "HeliCrashsiteMarker" == "")) then {
     deleteMarker "HeliCrashsiteMarker";
     //Re-Add the markers
     _nul = createMarker ["HeliCrashsiteMarker", _CrashCoords];
     "HeliCrashsiteMarker" setMarkerColor "ColorBlue";
     "HeliCrashsiteMarker" setMarkerShape "ELLIPSE";
     "HeliCrashsiteMarker" setMarkerBrush "Grid";
     "HeliCrashsiteMarker" setMarkerSize [175,175];
     diag_log(format["CRASH MARKER: marker reset at %1", _CrashCoords]);
   };
};
now save it in the same folder as crash_spawner.sqf
(SERVER PBO - addons/dayz_server/modules/ )

now open crash_spawner.sqf and just under this line
Code:
_crash setVariable ["ObjectID","1",true];
put this
Code:
//Heli crash Markers and alert player     
     heliCrash = _pos;
     [heliCrash] execVM "\z\addons\dayz_server\modules\crashmarker.sqf"; //call the spawn marker spawn script

and at the very end of the file add this (after the last } )

Code:
    publicVariable "heliCrash";
save everything, re PBO server files and thats all there is just need to make marker delete when wreck dissappears!!
great job man :D
 
It looks great! I'm looking through the sqf's now to see where the crash gets deleted. One would think there would be a reference to it in the crashspawner but I dont see it.
 
It looks great! I'm looking through the sqf's now to see where the crash gets deleted. One would think there would be a reference to it in the crashspawner but I dont see it.
honestly I don't think they do despawn, but it would be a simple matter to wait a few minutes to delete it :)
 
You're probably right. So I just need to associate a timer to the marker before it executes the delete marker, right?

Maybe after public variable heli crash?
 
add
Code:
_deletetime = 3000; //time in seconds
to the top of crash spawner.sqf somewhere then at the bottom somewhere do
Code:
while{true}do{

    _timeStart=time;
    if (_timeStart = _deletetime + time) then {
        deleteVehicle _crash;
    };
};


EDIT: I hope it works for you guys, I can't really mess with it. Time for me to get ready to go to my prom :D
 
IT WORKS!!!
just need to delete markers when wreck dissapears

No how to do it!

first create a new file called crashmarker.sqf and copy the below code into it.


Code:
//Sheeps Crash Markers
// File Name: crashmarker.sqf
//Version : 0.2
     private["_nul"];
     _CrashCoords = _this select 0;
     //Options
     HeliCrashMSG = true; //show message to players when wreck crashes
 
     //create marker at crash site
     _nul = createMarker ["HeliCrashsiteMarker", _CrashCoords];
     "HeliCrashsiteMarker" setMarkerColor "ColorBlue";
     "HeliCrashsiteMarker" setMarkerShape "ELLIPSE";
     "HeliCrashsiteMarker" setMarkerBrush "Grid";
     "HeliCrashsiteMarker" setMarkerSize [175,175];
     diag_log(format["CRASH MARKER: marker created at %1", _CrashCoords]);

     //message players
   
     //if message are on
     if ( HeliCrashMSG ) then{
         systemChat("A Helicopter has crashed! check your map for location!");
     };
     //call marker loop for JIPs ( Joined in Progress)
     [_CrashCoords] execVM "\z\addons\dayz_server\modules\crashmarkerloop.sqf";
now save it in the same folder as crash_spawner.sqf
(SERVER PBO - addons/dayz_server/modules/ )

create another file called crashmarkerloop.sqf and copy the below code into it.
Code:
//Sheeps Crash Markers JIPS
// File Name: crashmarkerloop.sqf
//Version : 0.2
private["_run","_nul"];

diag_log text format ["[CRASH MARKERS]: Marker Loop for JIPs Starting!"];
_CrashCoords = _this select 0;

if (isNil "HeliCrashsiteMarker")then{_CrashCoords = [0,0,0];};
//Lets start the timer
_run = true;
while {_run} do
{
  sleep 25; // sleep 25 seconds
   //If the marker exists (meaning the mission is active) lets delete it and re-add it
   if (!(getMarkerColor "HeliCrashsiteMarker" == "")) then {
     deleteMarker "HeliCrashsiteMarker";
     //Re-Add the markers
     _nul = createMarker ["HeliCrashsiteMarker", _CrashCoords];
     "HeliCrashsiteMarker" setMarkerColor "ColorBlue";
     "HeliCrashsiteMarker" setMarkerShape "ELLIPSE";
     "HeliCrashsiteMarker" setMarkerBrush "Grid";
     "HeliCrashsiteMarker" setMarkerSize [175,175];
     diag_log(format["CRASH MARKER: marker reset at %1", _CrashCoords]);
   };
};
now save it in the same folder as crash_spawner.sqf
(SERVER PBO - addons/dayz_server/modules/ )

now open crash_spawner.sqf and just under this line
Code:
_crash setVariable ["ObjectID","1",true];
put this
Code:
//Heli crash Markers and alert player       
     heliCrash = _pos;
     [heliCrash] execVM "\z\addons\dayz_server\modules\crashmarker.sqf"; //call the spawn marker spawn script

thats all there is just need to make marker delete when wreck dissappears!!
add
Code:
_deletetime = 3000; //time in seconds
to the top of crash spawner.sqf somewhere then at the bottom somewhere do
Code:
while{true}do{

    _timeStart=time;
    if (_timeStart = _deletetime + time) then {
        deleteVehicle _crash;
    };
};


EDIT: I hope it works for you guys, I can't really mess with it. Time for me to get ready to go to my prom :D
the issue i had when deleting markers was the JIPS loop reset then to 0,0,0 coords, messing with various cleanups now :p
 
Updated Script (no JIPS Support was causining issues)

find this line in crash_spawner.sqf
Code:
diag_log(format["CRASHSPAWNER: Crash completed! Wreck at: %2 - Runtime: %1 Seconds || Distance from calculated POC: %3 meters", round(_endTime), str(getPos _crash), round(_position distance _crash)]);
add this under it
Code:
    //Heli crash Markers and alert player         
     heliCrash = _pos;
     [heliCrash] execVM "\z\addons\dayz_server\modules\crashmarker.sqf"; //call the spawn marker spawn script
     publicVariable "heliCrash";//not sure if needed but its there :P

replace your old crashmarker.sqf code with this

Code:
//CRASH SITE MAP MARKERS AND MESSAGE
     private["_nul"];
     _CrashCoords = _this select 0;
     //create marker at crash site
     _event_marker = createMarker ["HeliCrashsiteMarker", _CrashCoords];
     _event_marker  setMarkerColor "ColorBlue";
     _event_marker  setMarkerShape "ELLIPSE";
     _event_marker  setMarkerBrush "Grid";
     _event_marker  setMarkerSize [175,175];
    _event_marker  setMarkerText "Heli Crash Site";
     //DEBUG
     diag_log(format["CRASH MARKER: marker created at %1", _CrashCoords]);

     systemChat("A Helicopter has crashed! check your map for location!");
     
_wait_time = 600; //wait 10 min   
// Wait
sleep _wait_time;
// Clean up marker
deleteMarker _event_marker;
save and your done!

this deletes the marker after 10 minutes
 
Updated Script (no JIPS Support was causining issues)

find this line in crash_spawner.sqf
Code:
diag_log(format["CRASHSPAWNER: Crash completed! Wreck at: %2 - Runtime: %1 Seconds || Distance from calculated POC: %3 meters", round(_endTime), str(getPos _crash), round(_position distance _crash)]);
add this under it
Code:
    //Heli crash Markers and alert player       
     heliCrash = _pos;
     [heliCrash] execVM "\z\addons\dayz_server\modules\crashmarker.sqf"; //call the spawn marker spawn script
     publicVariable "heliCrash";//not sure if needed but its there :P

replace your old crashmarker.sqf code with this

Code:
//CRASH SITE MAP MARKERS AND MESSAGE
     private["_nul"];
     _CrashCoords = _this select 0;
     //create marker at crash site
     _event_marker = createMarker ["HeliCrashsiteMarker", _CrashCoords];
     _event_marker  setMarkerColor "ColorBlue";
     _event_marker  setMarkerShape "ELLIPSE";
     _event_marker  setMarkerBrush "Grid";
     _event_marker  setMarkerSize [175,175];
    _event_marker  setMarkerText "Heli Crash Site";
     //DEBUG
     diag_log(format["CRASH MARKER: marker created at %1", _CrashCoords]);

     systemChat("A Helicopter has crashed! check your map for location!");
   
_wait_time = 600; //wait 10 min 
// Wait
sleep _wait_time;
// Clean up marker
deleteMarker _event_marker;
save and your done!

this deletes the marker after 10 minutes
You don't have to make it a public variable, I don't think. but if that does end up causing issues just add an underscore :p _heliCrash

EDIT: also that timer I posted above was to delete the actual wreck, not the marker :p
 
Last edited:
Thanks a bunch guys! I'm going to implement this code into the server this evening and will post the results. Sheep - you're amazing!

Matt, thank you for your assistance as well. I hope Prom went well for you.
 
Thanks a bunch guys! I'm going to implement this code into the server this evening and will post the results. Sheep - you're amazing!

Matt, thank you for your assistance as well. I hope Prom went well for you.
indeed it did! Thanks
 
Thanks a bunch guys! I'm going to implement this code into the server this evening and will post the results. Sheep - you're amazing!

Matt, thank you for your assistance as well. I hope Prom went well for you.
More than welcome!

I'll public release it soon crediting both of you (original idea, co developer)!
 
Back
Top