Jump to content
The Don Vito Corleone

Trigger activates when in vehicle

Recommended Posts

Firstly, I'd just apologize for breaking down and posting this here. I've searched far and wide for many hours and continue to get errors. Quite simply, I can't get the condition field in my trigger to not give me an error. I need a team of 4 (AI/Playable) to enter a specific vehicle and then activate the trigger.

 

team is don1

vehicle is v1

 

I've been coming back to this as the closest I've gotten

!if don1 in v1;

 

Just gives me an error saying it got a group but wants a bool.

 

TIA

Share this post


Link to post
Share on other sites
call {
    _return = true;
    {
        if !(_x in v1) exitWith{_return = false};
    } forEach  (units don1);
    _return
};

in your condition

  • Like 1

Share this post


Link to post
Share on other sites
{alive _x && {_x in v1}}count units don1 isEqualTo ({alive _x}count units don1)

All alive units of the group don1 are in the vehicle v1

units don1 findIf{ alive _x && {!(_x in v1)}} isEqualTo -1

If no unit from don1 is alive and not in vehicle v1

  • Like 2

Share this post


Link to post
Share on other sites
19 minutes ago, The Don Vito Corleone said:

ust used "don1 in v1" in the condition with no issues

If don1 is a group as per your op, then that should throw an error as in cannot check for a group in a vehicle, it only excepts a unit to check.

  • Like 1

Share this post


Link to post
Share on other sites
6 hours ago, Larrow said:

If don1 is a group as per your op, then that should throw an error as in cannot check for a group in a vehicle, it only excepts a unit to check.

You're right. Which is the issue I'm experiencing with another vehicle right now. I for that first vehicle use (p1 in v1 and p2 in v1). The problem now is its the end of the mission and the team needs to get in a helicopter. I want the trigger to activate but only when all alive players are in it. Been trying to play around with allplayers and allunits but they're lists. 

Share this post


Link to post
Share on other sites

{_x in V1} count allPlayers isEqualTo count allPlayers

or even

allPlayers findIf {!(_x inV1)} == -1

Share this post


Link to post
Share on other sites
On ‎2‎/‎28‎/‎2019 at 9:01 PM, The Don Vito Corleone said:

!if don1 in v1;

 

You should just have to condition the "not" apart from the "In".

 

if !(don1 In v1) then {<code>};
if (alive don1 && {!(don1 In v1)}) then {<code>};

 

// Edit - sorry, jumped the gun without reading entirely.  If a team do the units as pointed out above, but still condition the two apart like Pierremgi has.

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

×