Forum Jump :

Author Message


Posts: 9
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#1 Posted at 2014-01-07 14:15        
     
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.

This post was edited by Verify110 (2014-01-07 14:34, ago)


Author Message


Posts: 635
Rank:


Level: Member

Country: uk
Location: N.W.
Occupation:
Age: 31
In-game name: big_wilk

 
#2 Posted at 2014-01-07 14:47        
     
I don't have access to my pc right now to check right now to test some corrections to your script but I gather from that rather long question you want it to move when a unit gets into a helicopters?

This works:

http://www.armaholic.com/forums.php?m=posts&q=20953&n=last#bottom (scroll to the bottom)

Player is not a good command in an MP game as it will activate as soon as any player gets in the chopper. Id suggest and addiction instead.


Advertisement


Author Message


Posts: 9
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#3 Posted at 2014-01-07 14:52        
     
# big_wilk : I don't have access to my pc right now to check right now to test some corrections to your script but I gather from that rather long question you want it to move when a unit gets into a helicopters?

This works:

http://www.armaholic.com/forums.php?m=posts&q=20953&n=last#bottom (scroll to the bottom)

Player is not a good command in an MP game as it will activate as soon as any player gets in the chopper. Id suggest and addiction instead.

Thank you for a fast reply!
I have tried this code before and I'm back with the same problem as long ago - now as soon as the helo lands, it stops it's engine for a millisecond and then turns em back on and flies away - without giving player a chance to board.


Author Message


Posts: 635
Rank:


Level: Member

Country: uk
Location: N.W.
Occupation:
Age: 31
In-game name: big_wilk

 
#4 Posted at 2014-01-07 17:39        
     
It works fine lol! Example here:

https://www.dropbox.com/s/orxcf06fwtkryc4/Intel%40spawnedExtract.Stratis.rar

However like I explained badly I'd do it this way if your using this in an mp game:

1. Waituntil {variable == true};
2. spawnedthing addaction ["fafwagwgea",{variable = true};

I would suggest this as if the player respawns it will break the previous script resulting in the error you described, here is an example of a script that will work for you:

https://www.dropbox.com/s/hj7qgxg4zr34b2s/Intel%40spawnedExtract2.Stratis.rar


Author Message


Posts: 9
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#5 Posted at 2014-01-07 21:22        
     
# big_wilk : It works fine lol! Example here:

https://www.dropbox.com/s/orxcf06fwtkryc4/Intel%40spawnedExtract.Stratis.rar

However like I explained badly I'd do it this way if your using this in an mp game:

1. Waituntil {variable == true};
2. spawnedthing addaction ["fafwagwgea",{variable = true};

I would suggest this as if the player respawns it will break the previous script resulting in the error you described, here is an example of a script that will work for you:

https://www.dropbox.com/s/hj7qgxg4zr34b2s/Intel%40spawnedExtract2.Stratis.rar

Ok. I edited my script to pretty much be the same as the extract from link no.2, and upon pressing the command, nothing happens. I then just copy+pasted the entire code and ran it in my mission, and the helicopter landed and took off without waiting again. This is frustrating. The simple code that spawned the helo / set waypoint 1 / used waitUntil / set waypoint 2 should have worked. Now this is getting into adding actions, and the problem still persists.

I playtested your stratis missions and they worked as they should have.

my code:
exfiltrate = false;
publicVariable "exfiltrate";
_spawnPos = markerPos "helo1_spawn_marker";
_creation = [_spawnPos, -90, "B_HELI_TRANSPORT_01_CAMO_F", WEST] call bis_fnc_spawnvehicle;
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';"];

myaction = helo addAction ["Exfiltrate",{hint "Exfiltrating..."; exfiltrate = true; publicVariable "exfiltrate";}];
waitUntil {sleep 2; false; exfiltrate};

    _waypoint2 = heloGroup addWaypoint [ (markerPos "helo1_wp_2"), 12];
    _waypoint2 setWayPointBehaviour "CARELESS";
    _waypoint2 setWayPointSpeed "NORMAL";
    _waypoint2 setWayPointType "MOVE";
    _waypoint2 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))

None of my waitUntil's are working, nor any other form of loops or if statements...

This post was edited by Verify110 (2014-01-07 21:37, ago)


Author Message


Posts: 635
Rank:


Level: Member

Country: uk
Location: N.W.
Occupation:
Age: 31
In-game name: big_wilk

 
#6 Posted at 2014-01-07 21:43        
     
I don't see how copying and pasting that script can break it lol... probs something really simple your not doing.

Get a dropbox account and send me the mission (if its not modded) I'll look at it if you cant figure out whats wrong.


Author Message


Posts: 9
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#7 Posted at 2014-01-07 21:59        
     
# big_wilk : I don't see how copying and pasting that script can break it lol... probs something really simple your not doing.

Get a dropbox account and send me the mission (if its not modded) I'll look at it if you cant figure out whats wrong.

my current mission (altis)


Author Message


Posts: 635
Rank:


Level: Member

Country: uk
Location: N.W.
Occupation:
Age: 31
In-game name: big_wilk

 
#8 Posted at 2014-01-07 23:15        
     
lol! That had me scratching my head for 10 minutes. There is one thing you did wrong its how you exec the .sqf

You need to use execVM not exec

so change your triggers on act to nul = [] execVM "filename.sqf"; and your problem is solved.

I have a corrected version that works saved if yours still wont.

Absolutely nothing wrong with the script, but your script is not going to work in an mp game its gonna spawn two choppers if you have two players. Watch this to make it mp safe:

http://www.youtube.com/watch?v=6gdM4SDbu6U&feature=c4-overview-vl&list=PLDuFcVmU4yHbUp64E7xYzp7ezbGem_Ebn


Author Message


Posts: 9
Rank:


Level: Member

Country: us
Location:
Occupation:
Age:
In-game name:

 
#9 Posted at 2014-01-08 14:46        
     
# big_wilk : lol! That had me scratching my head for 10 minutes. There is one thing you did wrong its how you exec the .sqf

You need to use execVM not exec

so change your triggers on act to nul = [] execVM "filename.sqf"; and your problem is solved.

I have a corrected version that works saved if yours still wont.

Absolutely nothing wrong with the script, but your script is not going to work in an mp game its gonna spawn two choppers if you have two players. Watch this to make it mp safe:

http://www.youtube.com/watch?v=6gdM4SDbu6U&feature=c4-overview-vl&list=PLDuFcVmU4yHbUp64E7xYzp7ezbGem_Ebn

:) wow man, this works.
Thank you so much. You gave time and effort without any reward. I can finally move on with my mission!






Tags: Exfil, Helo, Player, Test