• 🏆 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!

Countdown timer issue

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Seeing the trigger or the map might help.

Timer windows are nothing more than a view of a timer. So it might technically be possible to make one with an invalid timer (which would probably match what you describe as the time comes from a timer which if invalid would also be invalid).
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
Here it is, it's a very simple trigger , I don't know why this timer window doesn't show the counting down.
  • Revive Hero
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Unit Group - Add (Dying unit) to RevivableHeroes
      • Set TempReal = (((Real((Level of (Dying unit)))) x 1.50) + 5.00)
      • Countdown Timer - Start ReviveTimers[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in TempReal seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title (Name of (Owner of (Dying unit)))
      • Countdown Timer - Show (Last created timer window) for (Owner of (Dying unit))
      • Set RevivableTimersWindows[(Player number of (Owner of (Dying unit)))] = (Last created timer window)
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Here it is, it's a very simple trigger , I don't know why this timer window doesn't show the counting down.
Setting it to 12 in the variable editor will work.
Alternatively do this. But you would need to destroy the old timer when it is done when using the below method.
  • Revive Hero
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Unit Group - Add (Dying unit) to RevivableHeroes
      • Set TempReal = (((Real((Level of (Dying unit)))) x 1.50) + 5.00)
      • Countdown Timer - Start ReviveTimers[(Player number of (Owner of (Dying unit)))] as a One-shot timer that will expire in TempReal seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title (Name of (Owner of (Dying unit)))
      • Countdown Timer - Show (Last created timer window) for (Owner of (Dying unit))
      • Set RevivableTimersWindows[(Player number of (Owner of (Dying unit)))] = (Last created timer window)

Countdown Timers must be made at map init or with custom script. Try this.
  • Revive Hero
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Unit Group - Add (Dying unit) to RevivableHeroes
      • Set TempReal = (((Real((Level of (Dying unit)))) x 1.50) + 5.00)
      • Set TempInteger = (Player number of (Owner of (Dying unit)))
      • Custom script: set udg_ReviveTimers[udg_TempInteger] = CreateTimer()
      • Countdown Timer - Start ReviveTimers[udg_TempInteger] as a One-shot timer that will expire in TempReal seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title (Name of (Owner of (Dying unit)))
      • Countdown Timer - Show (Last created timer window) for (Owner of (Dying unit))
      • Set RevivableTimersWindows[udg_TempInteger] = (Last created timer window)
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
Or you can increase the "size" value in variable editor - the "size" affects how many timers are initialized as well (tho it's better to use custom script and create timer when you need it, instead of limiting yourself to pre-set value in variable editor)
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
Or you can increase the "size" value in variable editor - the "size" affects how many timers are initialized as well (tho it's better to use custom script and create timer when you need it, instead of limiting yourself to pre-set value in variable editor)

How is that ?

EDIT : I increased its size and the time isn't showing yet

EDIT 2 : After I changed the arrayed timer with another one which is not arrayed, it seems to show fine, what would be the problem because I need an arrayed timer :/
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Or you can increase the "size" value in variable editor - the "size" affects how many timers are initialized as well (tho it's better to use custom script and create timer when you need it, instead of limiting yourself to pre-set value in variable editor)

I already said this in my above post.

How is that ?

EDIT : I increased its size and the time isn't showing yet

EDIT 2 : After I changed the arrayed timer with another one which is not arrayed, it seems to show fine, what would be the problem because I need an arrayed timer :/

What did you increase the arrayed variable to ? It needs to be increased to as many as you are using. For this 12 will be fine.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
How much would its leak affect on the gameplay ?
And yes I destroy them since I use them once

Same as every other leak.

Also you do not need to destroy them if you reuse them. That means that you can't use the custom script I showed you. Do not destroy them and do not use the custom script to create them and set the array to 12 in the variable editor if you are reusing them.
 
Status
Not open for further replies.
Top