Jump to content
Sign in to follow this  
VonNexus

A little problem with the sleep function.

Recommended Posts

Hi again,

what I want to do is a simple paradrop with some units. No HALO or things like that. So I created a .sqf file named "eject.sqf". In there I have this

A action ["Eject", C130]; 
sleep 10;
B action ["Eject", C130];
sleep 10;
C action ["Eject", C130];  

A,B and C are the soldiers, C130 is the plane. The plane has some waypoints. In the last waypoint, I have this

A exec "eject.sqf";

When the Hercules reaches the point for the paradrop, the soldiers are ejected at the same time. This shouldn't happen with the sleep setted to 10. Any help?

Thanks.

Share this post


Link to post
Share on other sites

use

nul = execvm "eject.sqf"

in the way point instead.

---------- Post added at 03:37 PM ---------- Previous post was at 03:36 PM ----------

Heh, beeten to it...

What does the _ mean anyway Kylania ?

You used

_nul = [] execVM "eject.sqf"; and I used

nul = [] execVM "eject.sqf";

So what us the _ for ?

Share this post


Link to post
Share on other sites

_ just makes it a local variable for giggles. Really no difference other than _nul wouldn't overwrite a variable called "nul" somewhere else.

The [] could be left off as well as you had it since the script doesn't really need any input. I just put it there for completeness. :)

Share this post


Link to post
Share on other sites

Ah, as it's bit I never use I have no idea what they do, or mean.

Share this post


Link to post
Share on other sites

Can you eject as a group?

I used the para.sqf but the units drop in a large spread.

Share this post


Link to post
Share on other sites

You could use a smaller sleep. Wouldn't look very realistic but would reduce the spread.

Edited by galzohar

Share this post


Link to post
Share on other sites
You could use a smaller script. Wouldn't look very realistic but would reduce the spread.

I have 11 team members named para1, para2...

I don't know how to set a variable for them as a group.

Can you please make an example?

Something like {_para1 doeject vehicle} forEach units group this;

Share this post


Link to post
Share on other sites
I have 11 team members named para1, para2...

I don't know how to set a variable for them as a group.

Can you please make an example?

Something like {_para1 doeject vehicle} forEach units group this;

To get the variable for the group, in the leader init field put:

Groupname = group this;

You use _x to refer to the unit in a ForEach loop. Try this. (Remember to fill in the name of the plane and the group).

{_x action ["Eject", planeName];} forEach units groupName;

EDIT: If you do not want them to spill out all at once, you can put a sleep in the forEach loop.. Like so:

{_x action ["Eject", planeName]; sleep 5;} forEach units groupName;

Edited by Nielsen

Share this post


Link to post
Share on other sites
To get the variable for the group, in the leader init field put:

Groupname = group this;

You use _x to refer to the unit in a ForEach loop. Try this. (Remember to fill in the name of the plane and the group).

{_x action ["Eject", planeName];} forEach units groupName;

EDIT: If you do not want them to spill out all at once, you can put a sleep in the forEach loop.. Like so:

{_x action ["Eject", planeName]; sleep 5;} forEach units groupName;

Excellent, thank you.

Mass AI Paradrop based on group name.

Thank you too, nice link.

Share this post


Link to post
Share on other sites

OK it works like a charm. But, dunno why, when the paras are on the ground, the Squad Leader orders to move as cargo in the C130J that dropped them. Why?

Share this post


Link to post
Share on other sites

Most likely yes. Use that command when you eject them and it'll probably solve your issue.

Share this post


Link to post
Share on other sites

Maybe a trigger in the landing zone with this in the "on act" field:

{unassignVehicle _x} forEach unit _vehiclename

How to relate it to the paradropped unit? Grouping the trigger?

Edited by puzzola

Share this post


Link to post
Share on other sites

Replace

_x action ["Eject", planeName];

With

_x action ["Eject", planeName];
unassignVehicle  _x;

Easy! :)

Share this post


Link to post
Share on other sites
Replace

_x action ["Eject", planeName];

With

_x action ["Eject", planeName];
unassignVehicle  _x;

Easy! :)

Good, and where to place forEach units groupName;?

Another thing OT: any chance we have IDF units for Arma2 non OA?

I like them so much, but don't want to mess my setting of Arma2 with adding OA.

If you have some, can you link me some screenshots of IDF units?

Did they make old units models? '48-'82?

Share this post


Link to post
Share on other sites

Depends when you want them to eject. Place it in a script and execute that script as soon as you want them to start jumpting out. Again, if you want a delay add a sleep too, aka:

_x action ["Eject", planeName];
unassignVehicle  _x;
sleep 2;

Currently there are only IDF reskins for Arma 2 OA: http://forums.bistudio.com/showthread.php?t=116433

Has a few small bugs but nothing really show-stopping. Has some dependancies too, some of which (the F15 and F4E) are bugged on their own, but it's OK if you don't use them (you still need to have them reagardless though).

There are LB and another guy both working on a mod with actual models, but still no sign of an actual release from either.

Share this post


Link to post
Share on other sites

So the exact text (without sleep) would be:

_x action ["Eject", planeName]; unassignVehicle _x; forEach units groupName;

?

Edited by puzzola

Share this post


Link to post
Share on other sites
You forgot the {...} see page for forEach command.

Oh, right!

{_x action ["Eject", planeName]; unassignVehicle _x;} forEach units groupName;

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×