#Delete marker when unit is looted or a certain amount of time has passed?

1 messages · Page 1 of 1 (latest)

jaunty dome
#

Good Evening,
I have this script Im running using execvm that marks a unit's dead body when it dies so it can be easily looted (see below)

`while {true} do {
{if (side _x == east) then {

     _x addEventHandler ["Killed",{ 

     _mrkName = format ["%1", name(_this select 0)]; 
     _m = createMarker[format ["%1",random 1000],getPosATL (_this select 0)];     
     _m setMarkerShape "ICON";     
     _m setMarkerType "mil_dot";    
     _m setMarkerColor "Coloreast";  
     _m setmarkerSize [.5,.5];   
   
    } 
   ] 
  } 
 } foreach allUnits;
 sleep 30;
 }`

Others have brought up that having this many markers stay on the map indefinitely might cause issues with performance and map clutter.

What would be the best way to have each marker delete after the items have been taken from the body?

if that isn't possible what would be the best way to have the marker delete itself after it is, say, an hour old?

jaunty dome
#

Delete marker when unit is looted or a certain amount of time has passed?

sacred moth
#

You're adding Killed EH over and over

stable osprey
#

You can have hundreds of markers with very little impact. If you get into the thousands, maybe

#

Store markers into an array like [time, Markername]
Every 10 minutes process that array, if time is old enough, delete. Stop at first time there not old enough