Jump to content
Sign in to follow this  
mihikle

End Mission with Triggers

Recommended Posts

I would like to know how to end a mission when OPFOR are not present in 4 triggers at the same time. However I want each trigger to activate at separate times, as a 'hint' appears after each one is completed. When all 4 triggers are completed, I would like the mission to end.

If anyone could tell me how to do this it would be much appreciated :)

Share this post


Link to post
Share on other sites

place the 4 triggers with w/e conditions you want (ie; opfor not Present). On each triggers activation, define a variable and then publicvariable it.

onact of trigger1:

zone1Clear=true;publicVariable "zone1Clear";hint "Zone1 is secure"

onact of trigger2:

zone2Clear=true;publicVariable "zone2Clear";hint "Zone2 is secure"

onact of trigger3:

zone3Clear=true;publicVariable "zone3Clear";hint "Zone3 is secure"

onact of trigger4:

zone4Clear=true;publicVariable "zone4Clear";hint "Zone4 is secure"

Now with a 5th trigger, set the Type to one of the endings (ie; end#1)

Condition:

zone1Clear && zone2Clear && zone3Clear && zone4Clear

onact:

ForceEnd

Edited by Iceman77

Share this post


Link to post
Share on other sites

if (isServer) then
{
Triggered = 0;
publicVariable "Triggered";
};

FNC_Trigger =
{
       if (!isServer) exitWith {};
Triggered = Triggered + 1;
publicVariable "Triggered";
};

waitUntil {Triggered >= 4};

endMission "LOSER"; //Can use other types

Then in your triggers' OnActs.

[] call FNC_Trigger;

Not sure if trigger code is run on the server, don't deal with triggers much.

Share this post


Link to post
Share on other sites

The triggers run locally where they are triggered. But since almost always the conditions for each player are true at the same time it's like a global effect. If that's what you mean anyhow.

Share this post


Link to post
Share on other sites

Then my FNC_Trigger function wouldn't work, it would boost the Triggered PV a single value on each client. Disregard my post. Thanks Iceman

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  

×