Jump to content

Recommended Posts

Posted

Is there some timer mechanism that I can use in the missions?

For example I'm making an escort mission where you have to stay close to the unit you need to target.

That part is setup using moving zones. When you leave the zone, I want to start a timer and when it reaches 30 seconds, I want to mark the mission as failed.

 

So how can I create a timer that keeps track of this?

Posted (edited)

Think I figured it out...

 

I'm using a Repetitive action to check for my condition and when it's true it increases a flag by 1. Because this is run every second, I keep track of the time.

I have another repetitive action that checks if that flag is > 30 and if it's true, it fails the mission...

 

Another trigger is used to reset the flag if I get back into the required zone.

 

I'm wondering... Would that be easier using Lua?

 

In the end, it's and If/Else statement so in pseudo code it looks like this:

 

if UnitInMovingZone(......) then
  setFlag(1,0)
else
  increaseFlag(1,1)
end

if flag(1) >= 30 then
 FailMission()
end

Edited by Passero
  • Recently Browsing   0 members

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