Timer Expires for unit

THE_X

New Member
Reaction score
49
is there a way to detect the same array number of a countdown timer if i have the same array number set for a unit like

Event: unit starts ability

Code:
Unit create 1 unit blablab
set custom value of last created unit to 5
start Countdown timer[custom value of last created unit]
Add last started timer expires to new trigger


New Trigger

Event:
Conditon
Action: Unit kill unit[number of triggering timer]


something like that perhaps? if you see what i mean
 

Flare

Stops copies me!
Reaction score
662
(requires a boolean variable and some JASS, I'll just call it Exit)
Code:
Set Exit = False
For every Integer A from 1 to (total number of timers)
  Custom script: exitwhen udg_Exit
  Custom script: if udg_MyTimer[bj_forLoopAIndex] == GetExpiredTimer () then
  //Do your actions relating to the timer
  Set Exit = True
  Custom script: endif

EDIT:
Code:
Add last started timer expires to new trigger

For your own sake, don't do that - add all those events at (Map Initialization) or (Elapsed game-time is 0.00 seconds) using a loop. Adding the events like that can cause repeated events which is bad. Alternatively, don't use timers at all - counter variables can be much more versatile (since you can check multiple elapsed times throughout the spell/trigger, rather than using a bunch of timers)
 

THE_X

New Member
Reaction score
49
yea i think il just use a every 1 second of the game thing, bassicly the same, and more easy, decreasing a integer by 1, will work for what im trying to do
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top