Jump to content
Sign in to follow this  
clydefrog

Please help me understand this trigger condition

Recommended Posts

Hi, this has just been confusing me for the last hour, I don't really even need to know it but I went through the script understanding and commenting everything else except for this part, it is from the escape stratis mission that came with Arma 3 alpha.

This bit isn't actually in the script, it is in the BIS_island trigger in the editor, but the init.sqf waits until this trigger is activated to succeed the mission. The triggers condition is:

{vehicle _x in thislist || (!(vehicle _x isKindOf "Ship") && !(vehicle _x isKindOf "Air"))} count units BIS_grpMain == 0

Now to me this is saying - check that no group members of the group "BIS_grpMain" are in a land vehicle in the trigger list (and if none of them are then they have escaped). So how is this detecting they have escaped, how does no group members being in a land vehicle in the trigger list mean they have escaped the island? I am completely sure I am misunderstanding this condition and not reading it correctly, so could somebody please explain what it is actually checking for?

Thanks

Edited by clydefrog

Share this post


Link to post
Share on other sites

That condition triggers when no units of that group are left in the area.

OR if the remaining units are either using a boat or a helicopter.

In other words: It doesn't trigger, as long as there are any units in the area that are either on foot or in a landvehicle.

Share this post


Link to post
Share on other sites

In short: All units have to be in an air or ship vehicle to make the statement "BIS_grpMain==0" true

{Any vehicle in thislist OR (NOT a "ship" vehicle AND NOT an "air" vehicle)} count units BIS_grpMain==0

That's how I read it, might be wrong too...

Edited by SwiftN7

Share this post


Link to post
Share on other sites
That condition triggers when no units of that group are left in the area.

OR if the remaining units are either using a boat or a helicopter.

In other words: It doesn't trigger, as long as there are any units in the area that are either on foot or in a landvehicle.

Thanks, which part of it is checking that none of them are on the ground on foot though? I thought the vehicle _x in thislist part would mean it is checking for any units that are in a vehicle?

Share this post


Link to post
Share on other sites

As long as any unit is not sitting in a boat or heli, the statement is "false" and that's why the trigger is not activated. There is no specific need to check whether units are on foot...

Share this post


Link to post
Share on other sites

Using the command "vehicle _x" on a unit that is not inside a vehicle, returns _x (the unit itself).

Drive a vehicle inside a trigger and "thisList" of that trigger will only contain the vehicle, not its passengers.

Therefor, the "vehicle" command is used to make sure that the unit is found in the list of that trigger even if it is inside a vehicle.

Share this post


Link to post
Share on other sites

Ok, I think I understand now. I thought the trigger was only checking that none of the group members were in a vehicle in the trigger area, not outside of a vehicle too. Thank you both for explaining it.

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  

×