Jump to content
Sign in to follow this  
SD_BOB

Group In Vehicle - Check

Recommended Posts

Hi guys, i'm currently using the following as a condition for a vehicle to move.

({_x in vehicle} count units mygroup == {alive _x} count units mygroup);

I've run into a bit of a problem with capacity of the vehicle. So my question is...

Is it possible to create a condition such as above, but checking two vehicles rather than just the one?

I would like to be able to meet the condition if all of my group are in either of the two vehicles...

Thankyou in advance for any help.

Share this post


Link to post
Share on other sites

({[b]_x [url="http://community.bistudio.com/wiki/in"]in[/url] vehiclename1 [url="http://community.bistudio.com/wiki/or"]OR[/url] _x in vehiclename2[/b]} count units mygroup == {alive _x} count units mygroup);

edit:

and for more vehicles instead of long condition line you can use array of vehicles:

({[url="http://community.bistudio.com/wiki/vehicle"]vehicle[/url] _x [url="http://community.bistudio.com/wiki/in"]in[/url] [b][vehiclename1,vehiclename2,vehiclename3][/b]} count units mygroup == {alive _x} count units mygroup)

Edited by Demonized

Share this post


Link to post
Share on other sites

try this instead:

{waitUntil {vehicle _x != _x && alive _x}} foreach units mygroup

that will check if a unit is any vehicle, if you want to refine it to only two specific vehicles, test those conditions with

 vehicle _x == veh1 || vehicle _x == veh2

Edited by Igneous01
replaced and with or

Share this post


Link to post
Share on other sites
try this instead:

{waitUntil {vehicle _x != _x && alive _x}} foreach units mygroup

that will check if a unit is any vehicle

this will cause a delay until AI team leader or yourself notices that unit is dead if so. better use OR !alive _x instead of && alive _x in above condition.

, if you want to refine it to only two specific vehicles, test those conditions with

 vehicle _x == veh1 && vehicle _x == veh2

above condition will fail every time since && means and, wich is translated to:

vehicle unit is veh1 and vehicle unit is veh2, wich never happens ofc, only one vehicle at a time, unless you are a wizard ofc ;)

it should be OR or the sqs equivalent ||

&& wiki

Share this post


Link to post
Share on other sites
this will cause a delay until AI team leader or yourself notices that unit is dead if so. better use OR !alive _x instead of && alive _x in above condition.

above condition will fail every time since && means and, wich is translated to:

vehicle unit is veh1 and vehicle unit is veh2, wich never happens ofc, only one vehicle at a time, unless you are a wizard ofc ;)

it should be OR or the sqs equivalent ||

&& wiki

my mistake, meant || ;)

as from my experience, alive fires off the moment the ai unit dies, it has never delayed for me. However, depending on the realism of the situation, you would usually wait until all members are in vehicle, since you dont know who is down, once someone is confirmed to be down, then the leader should order to take off.

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  

×