Timer Window and Timer won't delete

Level 12
Joined
Aug 3, 2021
Messages
437
Hello. I've created some timers for extra units, corrupting the ground using plague spreaders and for runners. But when the timer hits zero the timer or the timer window won't dissapear. I have used triggers and custom scritps for the timers to dissapear but it won't work. Anybody now how to fix this. Also I am using patch 1.31.1.
  • Destroy Drakuru Timer
    • Events
      • Time - DrakuruTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Pause DrakuruTimer
      • Countdown Timer - Hide DrakuruTimerWindow
      • Countdown Timer - Destroy DrakuruTimerWindow
      • Custom script: call DestroyTimerBJ(udg_DrakuruTimer)
  • Destroy Circle And Timer
    • Events
      • Time - PlagueTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy PlagueTimerWindow
      • Unit - Remove Circle of Teleportation (medium) 3674 <gen> from the game
      • Custom script: call DestroyTimer(udg_PlagueTimer)
  • Stop Timers
    • Events
      • Unit - Farm 2661 <gen> Dies
    • Conditions
      • (Dying unit) Equal to Farm 2661 <gen>
      • (Owner of (Dying unit)) Equal to Player 15 (Turquoise)
    • Actions
      • Trigger - Turn off Start Timer <gen>
      • Countdown Timer - Pause TimerFirstMessenger
      • Countdown Timer - Destroy CountdownTimerWindow
      • Custom script: call DestroyTimer (udg_TimerFirstMessenger)
      • Wait 2.00 seconds
      • Trigger - Turn off Start Timer 02 <gen>
      • Countdown Timer - Pause TimerRunner
      • Countdown Timer - Destroy CountdownTimerWindow
      • Custom script: call DestroyTimer (udg_TimerRunner)
      • Wait 2.00 seconds
      • Trigger - Turn off Start Timer 03 <gen>
      • Countdown Timer - Pause RunnerTimer03
      • Countdown Timer - Destroy CountdownTimerWindow
      • Custom script: call DestroyTimer (udg_RunnerTimer03)
      • Wait 2.00 seconds
      • Trigger - Turn off Start Timer 04 <gen>
      • Countdown Timer - Pause RunnerTimer04
      • Countdown Timer - Destroy CountdownTimerWindow
      • Custom script: call DestroyTimer (udg_RunnerTimer04)
      • Wait 2.00 seconds
      • Trigger - Turn off Start Timer 05 <gen>
      • Countdown Timer - Pause RunnerTimer05
      • Countdown Timer - Destroy CountdownTimerWindow
      • Custom script: call DestroyTimer (udg_RunnerTimer05)
      • Wait 2.00 seconds
      • Trigger - Turn off Start Timer 06 <gen>
      • Countdown Timer - Pause RunnerTimer06
      • Countdown Timer - Destroy CountdownTimerWindow
      • Custom script: call DestroyTimer (udg_RunnerTimer06)
      • Wait 2.00 seconds
      • Trigger - Turn off Start Timer 07 <gen>
      • Countdown Timer - Pause RunnerTimer07
      • Countdown Timer - Destroy CountdownTimerWindow
      • Custom script: call DestroyTimer (udg_RunnerTimer07)
      • Wait 2.00 seconds
      • Trigger - Turn off Start Timer 08 <gen>
      • Countdown Timer - Pause RunnerTimer08
      • Countdown Timer - Destroy CountdownTimerWindow
      • Custom script: call DestroyTimer (udg_RunnerTimer08)
      • Wait 2.00 seconds
      • Trigger - Turn off Start Timer 09 <gen>
      • Countdown Timer - Pause RunnerTimer09
      • Countdown Timer - Destroy CountdownTimerWindow
      • Custom script: call DestroyTimer (udg_RunnerTimer09)
      • Wait 2.00 seconds
      • Trigger - Turn off Start Timer 010 <gen>
      • Countdown Timer - Pause RunnerTimer010
      • Countdown Timer - Destroy CountdownTimerWindow
      • Custom script: call DestroyTimer (udg_RunnerTimer010)
      • Trigger - Turn off Stop Timers <gen>
      • Wait 2.00 seconds
      • Trigger - Turn off Start Timer 011 <gen>
      • Countdown Timer - Pause RunnerTimer011
      • Countdown Timer - Destroy CountdownTimerWindow
      • Custom script: call DestroyTimer (udg_RunnerTimer011)
      • Wait 2.00 seconds
      • Trigger - Turn off Start Timer 012 <gen>
      • Countdown Timer - Pause RunnerTimer012
      • Countdown Timer - Destroy CountdownTimerWindow
      • Custom script: call DestroyTimer (udg_RunnerTimer012)
      • Wait 2.00 seconds
      • Trigger - Turn off Start Timer 013 <gen>
      • Countdown Timer - Pause RunnerTimer013
      • Countdown Timer - Destroy CountdownTimerWindow
      • Custom script: call DestroyTimer (udg_RunnerTimer013)
      • Wait 2.00 seconds
      • Trigger - Turn off Start Timer 014 <gen>
      • Countdown Timer - Pause RunnerTimer014
      • Countdown Timer - Destroy CountdownTimerWindow
      • Custom script: call DestroyTimer (udg_RunnerTimer014)
      • Wait 2.00 seconds
      • Trigger - Turn off Start Timer 015 <gen>
      • Countdown Timer - Pause RunnerTimer015
      • Countdown Timer - Destroy CountdownTimerWindow
      • Custom script: call DestroyTimer (udg_RunnerTimer015)
      • Wait 2.00 seconds
      • Trigger - Turn off Stop Timers <gen>
 
You haven’t put a single timer window into a variable, and don’t use those waits 🙏😭 also u dont have to destroy everything in a single trigger, have each trigger for each timer,
exp timer runs out for event
actually edit: u stored wrong
n your big Stop Timers trigger, you're using Countdown Timer - Destroy CountdownTimerWindow repeatedly – but CountdownTimerWindow is probably not a variable (or it's the same variable for all timers). Only the last timer window you created would be stored there, so the others can't be destroyed.

The fix:
For each timer, create a unique variable for its window. For example:

Code:
TimerFirstMessengerWindow (timer window)
TimerRunnerWindow (timer window)
RunnerTimer03Window (timer window)
... etc.

Then when you create the timer:

Code:
Countdown Timer - Start TimerFirstMessenger as a One-shot timer that will expire in 30.00 seconds
Set TimerFirstMessengerWindow = (Last started timer window)

And when you destroy it:

Code:
Countdown Timer - Destroy TimerFirstMessengerWindow
Custom script: call DestroyTimer(udg_TimerFirstMessenger)
try this out

  • Countdown Timer - Start MyTimer1 as a One-shot timer that will expire in 30.00 seconds
  • Set MyTimerWindow1 = (Last started timer window)
  • Events
    • Time - MyTimer1 expires
  • Conditions
  • Actions
    • Countdown Timer - Destroy MyTimerWindow1
    • Custom script: call DestroyTimer(udg_MyTimer1)
  • Countdown Timer - Pause MyTimer1
  • Countdown Timer - Destroy MyTimerWindow1
  • Custom script: call DestroyTimer(udg_MyTimer1)
  • [\TRIGGER]
 
Last edited:
Yeah they just run out right?
One-shot timers stop after they expire. From there you can just Hide/Destroy their associated Timer Window and be done with it.

Repeating timers will continue until you Pause/Destroy them.

OP is using One-shot timers as far as I can tell. If not, he probably should be.

It's a bit confusing since he's destroying a Circle of Teleportation in his one example but says "timers for extra units" as if they're meant to periodically spawn stuff. I suppose killing that prevents the AI from teleporting new units into the battle or something.

Anyway, his trigger(s) should probably look something like this:
  • Events
    • Time - Elapsed game time is 0.00 seconds
    • // OR whenever you're ready to start this timer
  • Conditions
  • Actions
    • Countdown Timer - Start PlagueTimer as a One-shot timer that will expire in 30.00 seconds
    • Countdown Timer - Create a timer window for (Last started timer) with title Plague!
    • Set Variable PlagueTimerWindow = (Last created timer window)
  • Events
    • Time - PlagueTimer expires
  • Conditions
  • Actions
    • Countdown Timer - Destroy PlagueTimerWindow
    • // OR hide it if you want use it again later
    • Countdown Timer - Hide PlagueTimerWindow
In GUI, it's fine to keep it this simple, especially if you want to reuse the Timers later.
 
Last edited:
Back
Top