Amar Amrullah 0 Posted April 16, 2019 Hi i would like to make a situation where once an HVT is killed, it will spawn a marker at its' position, but my problem is there is multiple HVT. so im trying to simplify the code so i dont have to do it for each HVTs Note: HVT is the variable name for the unit that i need the script to check. (HVT1,HVT2...HVT10) In every HVT's Init: //null = [ this ] execVM "HVTChecker.sqf"; In HVTChecker.sqf: _HVTs = _this select 0; if (!alive _HVTs) then { _marker = createMarker [format["%1_area",vehicleVarName _this], position _HVTs]; _marker setMarkerShape "ELLIPSE"; _marker setMarkerSize [10,10]; _marker setMarkerColor "ColorOrange"; sleep 300; deleteMarker _marker; }; So it doesnt spawn any marker, but it is not showing any error either. I have been searching around but found no solution. Can anyone help me please. Share this post Link to post Share on other sites
sarogahtyp 1104 Posted April 16, 2019 what is a HVT? Seems to be a unit and seems that u r executing the script in units init line. this would mean that ur code is executed once in mission start when the unit is probable alive... maybe you need to use a killed event handler or something similar. Share this post Link to post Share on other sites
Crazy_Man 36 Posted April 16, 2019 Try waitUntil command. _HVTs = _this select 0; waitUntil {!alive _HVTs}; _marker = createMarker [format["%1_area",vehicleVarName _HVTs], position _HVTs]; // Don't forget to name all your HVTs _marker setMarkerShape "ELLIPSE"; _marker setMarkerSize [10,10]; _marker setMarkerColor "ColorOrange"; sleep 300; deleteMarker _marker; 1 Share this post Link to post Share on other sites
Amar Amrullah 0 Posted April 16, 2019 2 hours ago, Crazy_Man said: Try waitUntil command. _HVTs = _this select 0; waitUntil {!alive _HVTs}; _marker = createMarker [format["%1_area",vehicleVarName _HVTs], position _HVTs]; // Don't forget to name all your HVTs _marker setMarkerShape "ELLIPSE"; _marker setMarkerSize [10,10]; _marker setMarkerColor "ColorOrange"; sleep 300; deleteMarker _marker; Nice! It work like a charm. Thank you so much @Crazy_Man ! Share this post Link to post Share on other sites
lexx 1312 Posted April 16, 2019 3 hours ago, Amar Amrullah said: but my problem is there is multiple HVT. so im trying to simplify the code so i dont have to do it for each HVTs Use killed event handler? 2 Share this post Link to post Share on other sites
Dedmen 2581 Posted April 17, 2019 20 hours ago, sarogahtyp said: what is a HVT? High Value Target. A important person that needs to be killed/captured/saved. Though when one means to save the person, the designation VIP is usually used. 1 Share this post Link to post Share on other sites