patpowercat 7 Posted December 23, 2016 I know this has been discussed before. But most of what I could find involves extracting using just the editor, and I am trying to use only a script. I want to spawn a helicopter, move to WP and land, wait until player group is in helicopter, then take off and move to next waypoint. I have got everything to work, but the helicopter will not take off once people are in. I have tried waitUntil { { ( alive _x ) || { ( _x in ( _airframe1 select 0 ) ) } } count (units ALPHA) == count (units ALPHA)}; waitUntil {player1 in _airframe1}; waitUntil {{_x in _airframe1} count (units ALPHA) == {alive _x} count (units ALPHA)}; waitUntil {alive _X && !(_X in crew heli)} count (units ALPHA) <= 0; waituntil {{_x in _airframe1} count (units group player) == {alive _x} count (units group player)}; With ALPHA being the player's group or the unit being named player1, with the helo being named _airframe1. Any help appreciated. Share this post Link to post Share on other sites
davidoss 552 Posted December 23, 2016 waitUntil {sleep 3; (count (allplayers select {alive _x})) isEqualTo (count (allplayers select {_x in _airframe1}))}; Share this post Link to post Share on other sites
patpowercat 7 Posted December 23, 2016 Didn't work. Helicopter still just sits and never takes off. Any other ideas? Here is the whole script in case it helps. _crew1 = []; _airframe1 = []; if (isServer) then { _crew1 = creategroup WEST; _airframe1 = [getMarkerPos "pickup_spawn", markerDir "pickup_spawn", "B_Heli_Transport_01_F", _crew1] call BIS_fnc_spawnVehicle; _wp1 = _crew1 addWaypoint [(getmarkerpos "pickup"), 0]; _wp1 setWaypointType "LOAD"; _wp1 setWaypointSpeed "FAST"; _wp1 setwaypointstatements ["true", "(vehicle this) LAND 'GET IN';"]; //waitUntil { { ( alive _x ) || { ( _x in ( _airframe1 select 0 ) ) } } count (units ALPHA) == count (units ALPHA)}; //waitUntil {player1 in _airframe1}; //waitUntil {{_x in _airframe1} count (units ALPHA) == {alive _x} count (units ALPHA)}; //waitUntil {alive _X && !(_X in crew heli)} count (units ALPHA) <= 0; //waituntil {{_x in _airframe1} count (units group player) == {alive _x} count (units group player)}; //waitUntil {sleep 3; (count (allplayers select {alive _x})) isEqualTo (count (allplayers select {_x in _airframe1}))}; _wp2 = _crew1 addWaypoint [(getmarkerpos "pickup_spawn"), 100]; _wp2 setWaypointType "MOVE"; _wp2 setWaypointSpeed "FAST"; }; All the different waitUntils I have tried are commented. Share this post Link to post Share on other sites
patpowercat 7 Posted December 23, 2016 I can successfully get this to work with a number of different code in the condition field of a waypoint if the unit it already placed in editor. For example this works perfectly in the condition field: {_x in transport} count (units ALPHA) == {alive _x} count (units ALPHA); However in the script nothing with waitUntil works. Share this post Link to post Share on other sites
Devastator_cm 434 Posted December 23, 2016 here you go _crew1 = []; _airframe1 = []; _heli = objNull; if (isServer) then { _crew1 = creategroup WEST; _airframe1 = [getMarkerPos "pickup_spawn", markerDir "pickup_spawn", "B_Heli_Transport_01_F", _crew1] call BIS_fnc_spawnVehicle; _heli = _airframe1 select 0; _wp1 = _crew1 addWaypoint [(getmarkerpos "pickup"), 0]; _wp1 setWaypointType "LOAD"; _wp1 setWaypointSpeed "FAST"; _wp1 setwaypointstatements ["true", "(vehicle this) LAND 'GET IN';"]; waitUntil {sleep 3;(count (allplayers select {alive _x})) isEqualTo (count (allplayers select {_x in _heli}))}; _wp2 = _crew1 addWaypoint [(getmarkerpos "pickup_spawn"), 100]; _wp2 setWaypointType "MOVE"; _wp2 setWaypointSpeed "FAST"; }; Issue was you didn't check the vehicle but the whole array. https://community.bistudio.com/wiki/BIS_fnc_spawnVehicle Return Value: Array - 0: created vehicle (Object), 1: all crew (Array of Objects), 2: vehicle's group (Group) 2 Share this post Link to post Share on other sites
nomadd 66 Posted December 23, 2016 just glancing at this , this line appears wrong Quote waitUntil {alive _X && !(_X in crew heli)} count (units ALPHA) <= 0; the waituntil condition will never be true, need to move the bracket Quote waitUntil {alive _X && !(_X in crew heli) count (units ALPHA) <= 0;} Share this post Link to post Share on other sites
theend3r 83 Posted December 23, 2016 2 hours ago, nomadd said: just glancing at this , this line appears wrong the waituntil condition will never be true, need to move the bracket Actually it needs to be like this: waitUntil {{alive _x && !(_x in crew heli)} count (units ALPHA) <= 0} Share this post Link to post Share on other sites
Devastator_cm 434 Posted December 23, 2016 Guys, I already posted the working one ;) Share this post Link to post Share on other sites
patpowercat 7 Posted December 23, 2016 Devastator_cm's script worked exactly how I wanted it to. Thanks a ton! Share this post Link to post Share on other sites