Robustcolor 30 Posted December 30, 2019 Thanks @GEORGE FLOROS GR 1 Share this post Link to post Share on other sites
Robustcolor 30 Posted December 30, 2019 If i want a script to wait until a group is spawned in and alive then run rest of the code, is this command correct? waitUntil {!isNull _grp01}; Or is it better to check if leader have spawned in then run code? waitUntil {!isNull leader _grp01}; private _grp01 = [_pos, east,[0,1,2,3,4,5] apply{selectRandom Rivergroup},[],[],[1,1],[1,1],[]] call BIS_fnc_spawnGroup; //waitUntil {!isNull _grp01}; or //waitUntil {!isNull leader _grp01}; { _x setSkill ["AimingAccuracy",0.01]; } forEach (units _grp01); Also, if i want a script to check if a marker still exist should i use isNil or equalTo? params ["_markerpos"]; <--- being sent each time a new mission starts. while {true} do { if !(_markerpos isEqualTo []) then { something happens }; or if (!isNil ("_markerpos")) then { Something happens }; sleep 5; }; Share this post Link to post Share on other sites
pierremgi 4739 Posted December 30, 2019 1. Yes, no need to waitUntil 2. a marker is not an object. It's very specific. A marker is named by a string "yourMarkerName" not a param like "_marker" . So, you have to check : "yourMarkerName" in allMapMarkers For markers placed during mission, see this command for more details. Share this post Link to post Share on other sites
Robustcolor 30 Posted December 31, 2019 Thanks @pierremgi Share this post Link to post Share on other sites
Robustcolor 30 Posted January 6, 2020 On 11/28/2019 at 7:26 PM, pierremgi said: Should work. verify _markerPos is defined and allPlayers returns at least one player You can try: waitUntil {sleep 5; count allPlayers >0 && { allPlayers findIf {(_x distance2d _markerpos) < (250 + round (random 50)) && (ASLToAGL getPosASL _x)#2 < 2} > -1 } }; waitUntil {sleep 5; allPlayers findIf {(_x distance2d _markerpos) < (250 + round (random 50)) && (ASLToAGL getPosASL _x)#2 < 2} > -1}; It did work, just some wierd error when testing it in debug. I did a test with the code below and it worked, not sure if it's better or worse compared to the above code, what you think? @pierremgi The debug test thing don't work when using these codes so not sure about the result. waitUntil {sleep 5; allPlayers unitsBelowHeight 20 findIf {(_x distance2d _markerpos) < (250 + (random 50))} >-1}; Share this post Link to post Share on other sites
pierremgi 4739 Posted January 7, 2020 waitUntil {sleep 5; (allPlayers unitsBelowHeight 20) findIf {(_x distance2d _markerpos) < (250 + (random 50))} >-1}; should work Share this post Link to post Share on other sites