Jump to content
Sign in to follow this  
grimmmammoth

if death in squad moving to next waypoint after pi

Recommended Posts

Ok I have a Rhib come pick us up after a mission. I know how to have it wait until we all get in using  "in boat' in the condition and it works if all of us get in but if one or more die then it doesn't work because i it set to have all of us get in. So how can i set it so say the current team leader gets in and then it goes to the next way point. Or how do you set it so that if the remaining squad (no matter how many get killed)all get in it activate the next waypoint?

Share this post


Link to post
Share on other sites

Try using count to check that the number of the group's units that are in the boat equals the number of units in the group.

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">

{

waituntil{_x in boat};

}foreach units(group(yourteamleader));

Then you set a variable to true and put that in the Wp condition.

Share this post


Link to post
Share on other sites

I tried the code but it didnt work is the boat name simple "boat" or does it matter? And soes it need to be three lines or can it be one long line? Im new at this can you tell

Share this post


Link to post
Share on other sites

The syntax of Schwab's code's is not correct, it should be {command} forEach array.

In ArmA SQF syntax, a semi-colon (;) can be used to seperate statements.

eg :

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

myUnit setDir 2;

myUnit setDamage 0.1;

is the same as :

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">myUnit = player; myUnit setDir 2; myUnit setDamage 0.1;

Share this post


Link to post
Share on other sites

ups...sry smile_o.gif

fasad is of course right -.-

too early in the morning

boat should be the vehicle, whatever name u gave it.

yourteamleader is the name of the leader you spoke of, if its always you, you can use player instead.

i edited the foreach above btw ^^

Share this post


Link to post
Share on other sites

try this : <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">({_x in myVehicle} count units myGroup) == count units myGroup

returns true when all members of myGroup are in myVehicle.

Share this post


Link to post
Share on other sites

Ok I tried that and it said ==: Type array excpected number ,string,object,group .....

Also do i need to name the group "myGroup" and does the boat have to be named "myvehicle'

Thanks for the help I appreciate it.

Share this post


Link to post
Share on other sites
Also do i need to name the group "myGroup"

Yes

In the initfield of any of the group members, makes most sense if its in the leaders initfield put

myGroup = group this;

does the boat have to be named "myvehicle'

Yepp, without the quotation marks of course smile_o.gif

Either in the name-field of the unit put

myvehicle

Or in the init

myvehicle = this;

Share this post


Link to post
Share on other sites

ok where do i go to edit the init. im only saving this so far in user missions.

Share this post


Link to post
Share on other sites

srry reading it agian you told me how to do it thanks. I will try that. will it get rid of the error message from fasad's script?

Thanks again guys This is my second day at this and I'm learning alot

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  

×