Combining Trigger Conditions...
Posted: Mon Mar 01, 2021 10:45 am
OK,
I'd like to create a single event that will check that a unit enters an area, but only check for unit entry during a certain time-frame... in other words: At some time Y in the future, the event starts checking and continues to check for the unit entering the area until either the unit enters the area, or the unit is destroyed before entering the area, or it times out after some time with the unit not entering in the area.
So far, I have managed to get the behavior that I want by setting up 2 events to accomplish this:
1 a time event that generates a recurring event at time Y, and kills itself..
2. the recurring event checks for the end time, and kills itself
the recurring event checks for the unit's entry into the area...
does something and kills itself.
the recurring event check to see if the unit has been killed. If so, it kills itself.
In looking at the help/documentation, I do not see a simpler way to do this.
I see trigger an event to fire at a time.
I see trigger an event to fire every interval.
But no way to combine them except through a lua script on the condition, but this means that the trigger fires every interval (polling) from inception until the event is removed.
Is there a way to get the behavior with a single event and or trigger and condition that minimizes the number of fires, meaning to do this where the trigger ONLY fires every interval during the desired time window?
I'd like to create a single event that will check that a unit enters an area, but only check for unit entry during a certain time-frame... in other words: At some time Y in the future, the event starts checking and continues to check for the unit entering the area until either the unit enters the area, or the unit is destroyed before entering the area, or it times out after some time with the unit not entering in the area.
So far, I have managed to get the behavior that I want by setting up 2 events to accomplish this:
1 a time event that generates a recurring event at time Y, and kills itself..
2. the recurring event checks for the end time, and kills itself
the recurring event checks for the unit's entry into the area...
does something and kills itself.
the recurring event check to see if the unit has been killed. If so, it kills itself.
In looking at the help/documentation, I do not see a simpler way to do this.
I see trigger an event to fire at a time.
I see trigger an event to fire every interval.
But no way to combine them except through a lua script on the condition, but this means that the trigger fires every interval (polling) from inception until the event is removed.
Is there a way to get the behavior with a single event and or trigger and condition that minimizes the number of fires, meaning to do this where the trigger ONLY fires every interval during the desired time window?
