I have a boat map with enemy ships. These ships fire ballistas. I want them to only be able to fire once every 8 seconds.
What I tried: I made an array of timers called OrdersTimer. I start the timers when the unit casts an ability, and then detect if the remaining time on the timer is less than 1, enabling it to fire again. A section of the trigger is given below:
THE PROBLEM: the timer doesn't appear to work. The trigger fires every time, even right after the timer is started.
Is there some problem with arrays of Timers? Does the condition "Remaining time for OrdersTimer" not refer to how much time is left on a timer?
What I tried: I made an array of timers called OrdersTimer. I start the timers when the unit casts an ability, and then detect if the remaining time on the timer is less than 1, enabling it to fire again. A section of the trigger is given below:
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Abs(math_1)) Less than 20.00
-
(Distance between tempPoint and tempPoint2) Less than 4000.00
-
(Remaining time for OrdersTimer[tempInteger]) Less than 1.00
-
-
Then - Actions
-
-------- fire ballista --------
-
Countdown Timer - Start OrdersTimer[tempInteger] as a One-shot timer that will expire in 8.00 seconds
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between tempPoint and tempPoint2) Greater than or equal to 3150.00
-
-
Then - Actions
-
Set BallistaFallSpeedTemp = -15.00
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between tempPoint and tempPoint2) Greater than or equal to 2550.00
-
-
Then - Actions
-
Set BallistaFallSpeedTemp = -12.00
-
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Distance between tempPoint and tempPoint2) Greater than or equal to 1975.00
-
-
Then - Actions
-
Set BallistaFallSpeedTemp = -9.00
-
-
Else - Actions
-
Set BallistaFallSpeedTemp = -6.00
-
-
-
-
-
-
-
Sound - Play BallistaAttackEffort1 <gen> at 100.00% volume, attached to (Triggering unit)
-
Trigger - Run AI Ballista <gen> (ignoring conditions)
-
-
Else - Actions
-
THE PROBLEM: the timer doesn't appear to work. The trigger fires every time, even right after the timer is started.
Is there some problem with arrays of Timers? Does the condition "Remaining time for OrdersTimer" not refer to how much time is left on a timer?