Hello guys. I've been using this website a lot as I create more and more complex missions. This website is a life-saver. Normally, I've been able to find what I was looking for, or something close enough to figure it out myself - but I've run into a rather simple problem that others aren't experiencing.
_spawnPos = markerPos "helo1_spawn_marker";
_creation = [_spawnPos, -90, "B_HELI_LIGHT_01_F", WEST] call bis_fnc_spawnvehicle;
? OK = false;
heloGroup = _creation select 2;
helo = _creation select 0;
_waypoint1 = heloGroup addWaypoint [ (markerPos "helo1_wp_1"), 12];
_waypoint1 setWayPointBehaviour "CARELESS";
_waypoint1 setWayPointSpeed "NORMAL";
_waypoint1 setWayPointType "LOAD";
_waypoint1 setWayPointCombatMode "WHITE";
_waypoint1 setWaypointStatements ["true","helo land 'LAND';"];
hint "before";
while{OK == false} do {
sleep 2;
if((testee in helo)==true) then {OK = true;hint "testee in helo = true";}; //this part isn't being executed, nor is anything after this
};
_waypoint3 = heloGroup addWaypoint [markerPos "helo1_wp_2"), 12];
_waypoint3 setWayPointBehavior "CARELESS";
_waypoint3 setWayPointSpeed "NORMAL";
_waypoint3 setWayPointType "MOVE";
_waypoint3 setWayPointCombatMode "WHITE";
//((!alive B_1) OR (B_1 in helo)) AND ((!alive B_2) OR (B_2 in helo)) AND ((!alive B_3) OR (B_3 in helo)) AND ((!alive B_4) OR B_4 in helo))
I have been working with this code a lot, and simplified it down to just give me hints to see when certain parts of the code is executed. testee is a player controlled character I use for testing. He spawns on foot (i've also tried "player", but the same effect is had). testee will eventually be replaced with the commented line at the bottom. The helicopter successfully spawns and flies to the LZ and lands. the "before" hint also occurs.
However, when the player (AKA testee) enters the helicopter "helo", nothing happens. I have tried the same code with waitUntil, but it's the same.
What did I do wrong?
edit:
As a matter of fact, when I remove the boolean OK and the whole while loop and replace with a waitUntil {testee in helo}, the code after the waitUntil statement is executed even if the 'in' expression isn't satisfied.