Forum Jump :

Author Message


Posts: 2
Rank:


Level: Member

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

 
#1 Posted at 2013-02-11 00:13        
     
Hi, I'm trying to create a mission where four squads of 5 are starting in a C-130J, and I want all of them to eject at a specified location. I've set the trigger, and use the 'action["eject"];'-command, and we are all ejecting, but 70% of us die in the attempt.. Is it because all 25 are ejecting at the same time, or is it the velocity of the plane that does this? I've set a MOVE-waypoint before this and I sat SPEED to LIMITED. That didn't help.. Should I set the speed of the plane programmatically just before ejection to a low speed or something? I'd think that would make it look weird.. I also tried putting in a sleep 0.2 between calling "eject", but if anything I think it only put 0.2s between each squad mashup..


Author Message


Posts: 1484
Rank:


Level: Member

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

 
#2 Posted at 2013-02-11 00:48        
     
It does sound like a delay is needed.

You say you tried this and it didn't help, are you running the ejection script from a trigger/waypoint or script.

Sleep will only work when used in script or is spawned.

how to use it in a waypoint by using it through a spawn
null=[] spawn {{_x action ["eject",air]; sleep 0.2} foreach crew air -[driver vehicle air]}


Advertisement


Author Message


Posts: 2
Rank:


Level: Member

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

 
#3 Posted at 2013-02-11 01:32        
     
# F2kSel : It does sound like a delay is needed.

You say you tried this and it didn't help, are you running the ejection script from a trigger/waypoint or script.

Sleep will only work when used in script or is spawned.

how to use it in a waypoint by using it through a spawn
null=[] spawn {{_x action ["eject",air]; sleep 0.2} foreach crew air -[driver vehicle air]}

Sorry, I just started editing missions today, so I don't really know if I'm doing it right..
I created a file "getOut.sqf", in this file I wrote
null=[] spawn {{_x action["eject",a1]; sleep 0.2} foreach crew a1 -[driver vehicle a1]};
I have just switched out your 'air' with my variable name for the aircraft they are in. I don't know if I should have changed anything else? Maybe crew, driver or vehicle should've been changed aswell?
In the game, I edited my "CARGO UNLOAD"-waypoint's "Activation" to say
script = [] execVM "getOut.sqf";
When I arrive at the waypoint, nothing happens at all..
Anything I did wrong? I am completely new to this spesific syntax structure, but I have general knowledge of Java and the C-languages, so if someone could just bump me in the right direction that would be appreciated.

Also, I'm in Operation Arrowhead now, is there a way to run the mission I am editing from the editor? In many videos I have seen "Test" or "Preview" or something like that, but I have to save, close, single/multiplayer, create 'server'.. Hazzle to do everytime when I change a couple of letters..


Author Message


Posts: 1484
Rank:


Level: Member

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

 
#4 Posted at 2013-02-11 01:58        
     
this line can just be placed in the waypoints on act, don't change anything else, just have the plane named correctly.

null=[] spawn {{_x action ["eject",air]; sleep 0.2} foreach crew air -[driver vehicle air]}

if you script it it should be
waypoint on act
script = [] execVM "getOut.sqf";

save as getout.sqf
{_x action ["eject",air]; 
sleep 0.2;
} foreach crew air -[driver vehicle air]};

I don't really understand the last part, I always have preview.
I just use the editor at the bottom of single player menu.
As soon as you place a player on the map, preview should become available.