Jump to content
Sign in to follow this  
kiwi1234

Spawn multiple paratroops

Recommended Posts

Hi there,

Im making a mission where waves of paratroopers are dropped onto a base, which they then attack.

I have worked out how to spawn soldiers as part of a group on the ground to then attack the base using a trigger with this in the init line:

deletevehicle JIM; "SOLDIERWB" createunit [getpos ENFORCE, ASSAULT, "BOB=this"]

, but im not sure how to get it to spawn them all in parachutes in the air.

I guess i need to make a script? Im just learning all this, any help would be much appreciated.

Many thanks

Kiwi.

Share this post


Link to post
Share on other sites

Assuming ASSAULT is the group unit spawned are attached...

{ _x setpos [getpos ( ( units assault ) _select 0) ) + ( Random 10 - random (10) ), getpos ( ( units assault ) _select 1) ) + ( Random 10 - random (10) ), 1000] } foreach units Assault.

Where 1000 (the third element of the getpos array (id est the Z coords)) is the height of the trooper.

Be careful however.

The line will set pos every element of the array at 1000 mts but won't give them any chutes...

You've to call a script to monitor their height.

Then, you've to create a Parachute for every one of them

in a loop:

_i = ( count ( units ASSAULT ) )- 1

#lp

_Sold = ( _Units Assault ) select _i

~.1

_chute = "Parachute west" (not sure now I'm at work) Createvehicle getpos _Sold

_sold moveindriver _chute

? _i > 0 : _i = _i - 1; goto "lp"

smile_o.gif

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  

×