Jump to content
Sign in to follow this  
kocrachon

Grouping?

Recommended Posts

So how do I make it to where instead of doing a command for an individual unit,I can do it for the squad/

Such as, instead of

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Soldier1 dofollow Soldier1

I want it to be something like

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Group 1 dofollow Soldier1

Share this post


Link to post
Share on other sites

Namely right now I am trying to do this

Group1 action ["eject", Plane1]

I am trying to make a DC-3 fly by and have a paratrooper team eject out and I am having issues making it work.

I had one way of making a waypoint after waypoint each making a guy eject but the plane started acting weird and for some reason empty parachutes were flying out of the plane too. Had 10 guys and 20 parachutes in the air...

Share this post


Link to post
Share on other sites

For sqf, try:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{

_x action["eject", Plane1];

} forEach (units Group1);

Share this post


Link to post
Share on other sites

why for sqf? and how you activate the parajump? trigger wich calls the sqf script? write the command in the trigger directly, and everything is fine. maybe do a {unassignVehicle _x} forEach units groupname aswell, otherwise the leader maybe command a getin as soon the group left the vehicle.

{_x action ["eject",planename]} forEach units groupname; {unassignVehicle _x} forEach units groupname;

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x action ["eject",planename]} forEach units groupname; {unassignVehicle _x} forEach units groupname;

Now another question, how do I know what the name of the group is? and where you write groupname, how exactly would I write it?

Share this post


Link to post
Share on other sites

No that take way too long, asking in the forum and waiting for the answer is much, much faster. wink_o.gif

The groupname is what you have assigned it to using

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">groupname=group this

in the initialization line of the groupleader.

A quick example, you name the group "group1" using above line, then the line would look like this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{_x action ["eject",planename]} forEach units group1; {unassignVehicle _x} forEach units group1;

Of course, the plane used needs to have a unique name too.

Share this post


Link to post
Share on other sites

For more effecient code, put the action and unassignVehicle commands inside the same forEach block. You might also want a sleep in there for a delay between each jump. You don't need an external script for this either, do it in the editor like this, define some code somewhere (init field is good):

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">GroupEject = {{_X action ["EJECT",vehicle _X]; unassignVehicle _X; sleep 1} forEach (units _this)}

Then call it later via spawn, ex:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Group1Parachute = group1 spawn GroupEject

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  

×