• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

What condition do I use to check what timer has expired?

Status
Not open for further replies.
Level 5
Joined
May 20, 2008
Messages
138
If I have a trigger like this, is there a way to check what timer has expired? It would help my map a lot if it is possible.

  • Akilzon boss ability
    • Events
      • Time - AkilzonBoss_ability_timer[1] expires
      • Time - AkilzonBoss_ability_timer[2] expires
      • Time - AkilzonBoss_ability_timer[3] expires
      • Time - AkilzonBoss_ability_timer[4] expires
      • Time - AkilzonBoss_ability_timer[5] expires
    • Conditions
      • AkilzonBoss_incombat Equal to True
      • AkilzonBoss_storm_inprogress Equal to False
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WHAT CONDITION COULD I USE HERE?
        • Then - Actions
        • Else - Actions
 
Well, like this:
  • Melee Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_Hash = InitHashtable()
      • For each (Integer A) from 1 to 5, do (Actions)
        • Loop - Actions
          • Custom script: set udg_Timers[GetForLoopIndexA()] = CreateTimer()
          • Trigger - Add to Two <gen> the event (Time - Timers[(Integer A)] expires)
          • Custom script: call SaveInteger (udg_Hash, GetHandleId (udg_Timers[GetForLoopIndexA()]), StringHash("count"), GetForLoopIndexA())
  • Two
    • Events
    • Conditions
    • Actions
      • Custom script: local integer i = LoadInteger (udg_Hash, GetHandleId (GetExpiredTimer()), StringHash("count"))
      • Custom script: call BJDebugMsg ("The expired timer was "+ I2S(i))
 

Attachments

  • TimersTest.w3x
    16.9 KB · Views: 42
Status
Not open for further replies.
Top