Jump to content

Get trigger to occur once instead of every time arguments are met?


Recommended Posts

Posted

I'm having trouble with a trigger zone activating the trigger every time the player enters the zone, when I want the trigger to be activated only once.

 

Goal: Time penalty for not exiting trigger zone within specific time.

 

Trigger ONCE --> Unit inside zone --> Time since flag = 180seconds

 

So, if the unit is inside the zone for 180 seconds, they get a score penalty. If the unit gets out of the zone, there is no time penalty.

 

The problem: This trigger zone is the home base, so the unit will be returning for landing. Once the unit reenters the zone, the 180-second timer trigger continues where it left off. I want the trigger to more or less disappear if the unit leaves the zone within the time limit. How would I do this?

Posted (edited)

Simple, add AND condition to your second trigger, something like this:

 

ONCE > UNIT INSIDE ZONE > FLAG ON (flag 1 true)

ONCE > TIME SINCE FLAG (180 sec) AND UNIT INSIDE ZONE > MESSAGE TO GROUP (some penalty warning message)

 

By adding AND condition i mean just add a second one, after time since flag:

 

TIME SINCE FLAG (180 sec)

UNIT INSIDE ZONE

 

Now, the warning message will be triggered only if both conditions are true.

Edited by dark_wood
Posted (edited)

That's how I already have it set up. The message and score penalty will be triggered if the unit exceeds 180 seconds inside the zone.

 

The goal is for the player to scramble and takeoff within 180 seconds. Let's say the player leaves the zone within 160 seconds. Now when the player RTBs and lands at the base, 20 seconds after entering the airbase zone the message and score penalty is triggered, despite the fact the player has achieved the goal of scrambling within 180 seconds.

 

I want to disable the trigger if the player leaves the zone before 180 seconds has passed.

 

Hopefully these screenshots will help:

z3StV6Tt.png

 

g7We4QUt.png

 

JOIO7Eht.png

 

Flag 3 is for the scoring: Flag 3 true (player too slow to scramble) = 0 points awarded; Flag 3 false (player on time) = 25 points awarded

Edited by Nealius
Posted

First, set a new flag:

MISSION START > no condition > flag 2 is true

 

then set a third condition (check if flag 2 is true):

ONCE > TIME SINCE FLAG (180 sec) and UNIT INSIDE ZONE and FLAG 2 is true > MESSAGE TO GROUP (some penalty warning message)

 

then, if the plane leave the zone, set flag 2 false:

ONCE > UNIT OUTSIDE THE ZONE > FLAG 2 false

Posted

Continuous action -> unit inside zone -> flag increase (1,+1)

 

Switched condition -> unit outside zone and flag 1 less than 180 -> flag off (1)

 

1 once -> flag 1 equals 180 -> message to all ('penalty')

 

 

 

This uses a flag to store how long someone has been in an area. If they leave before the counter reaches 180, it is reset.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...