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

Time - Timer Expires not reponding

Status
Not open for further replies.
Level 15
Joined
Oct 29, 2012
Messages
1,474
Hello,
this might be the oddest thing I see, but it seems that the event (Time - Timer expires) never works, whether the timer is arrayed or not, it never works, I have a reviving timer and it reaches 0.00, the hero doesn't revive and the window doesn't get destroyed. I have a tournament timer, one-shot, seems like the window doesn't get destroyed , nor the tournament launches. I just have one timer working which is Game-Start timer, it starts after 0.00 seconds elapsed from game time. Any other timer doesn't work...

Where would the bug lie on?
Just in case , I attached the simple triggers, for the tournament expiring trigger don't care about waits, since all units are paused that won't affect ;)
EDIT : NOTE : The trigger that works properly is the one that's first created, the one that don't work are after creating the normal one, it seems it's hitting the op-limit or something

  • Setup
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start _Game_Start_Timer as a One-shot timer that will expire in 60.00 seconds
      • Set _Game_Start_Timer = (Last started timer)
      • Countdown Timer - Create a timer window for (Last started timer) with title Game auto-start:
      • Set _Game_Start_Timer_Window = (Last created timer window)
      • Countdown Timer - Show _Game_Start_Timer_Window

  • Revive Hero Timer 1
    • Events
      • Time - ReviveTimers[2] expires
      • Time - ReviveTimers[3] expires
      • Time - ReviveTimers[4] expires
      • Time - ReviveTimers[5] expires
      • Time - ReviveTimers[6] expires
      • Time - ReviveTimers[8] expires
      • Time - ReviveTimers[9] expires
      • Time - ReviveTimers[10] expires
      • Time - ReviveTimers[11] expires
      • Time - ReviveTimers[12] expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in RevivableHeroes and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Remaining time for ReviveTimers[(Player number of (Owner of (Picked unit)))]) Less than 1.00
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Owner of (Picked unit)) is in KonohaForce) Equal to True
                • Then - Actions
                  • Hero - Instantly revive (Picked unit) at (Center of Konoha Spawn <gen>), Show revival graphics
                • Else - Actions
                  • Hero - Instantly revive (Picked unit) at (Center of Akatsuki Spawn <gen>), Show revival graphics
            • Else - Actions


  • Tournament Start
    • Events
    • Conditions
    • Actions
      • Custom script: set udg_Tournament_Timer = CreateTimer()
      • Countdown Timer - Start Tournament_Timer as a One-shot timer that will expire in 60.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Tournament:
      • Countdown Timer - Show (Last created timer window)
      • Set Tournament_TimerWindow = (Last created timer window)
  • Tournament Prepare
    • Events
      • Time - Tournament_Timer expires
    • Conditions
    • Actions
      • Game - Display to (All players) the text: LOOFOARZOGRAZOGOAZG...
      • Sound - Stop music Immediately
      • Sound - Play Credits
      • Unit - Pause all units
      • Trigger - Turn off Make Switch Heroes <gen>
      • Wait 4.00 seconds
      • Set Tournament_TempP = (Center of Tournament <gen>)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Picked player) to Tournament_TempP over 2.00 seconds
      • Custom script: call RemoveLocation(udg_Tournament_TempP)
      • Wait 0.10 seconds
      • For each (Integer TournamentInteger) from 2 to 6, do (Actions)
        • Loop - Actions
          • Set Tournament_TempP = (Center of Tournament_RegionK[TournamentInteger])
          • Unit - Move Character_Hero[TournamentInteger] instantly to Tournament_TempP, facing 0.00 degrees
          • Unit - Reset ability cooldowns for Character_Hero[TournamentInteger]
          • Custom script: call RemoveLocation(udg_Tournament_TempP)
      • For each (Integer TournamentInteger) from 8 to 12, do (Actions)
        • Loop - Actions
          • Set Tournament_TempP = (Center of Tournament_RegionK[TournamentInteger])
          • Unit - Move Character_Hero[TournamentInteger] instantly to Tournament_TempP, facing 180.00 degrees
          • Unit - Reset ability cooldowns for Character_Hero[TournamentInteger]
          • Custom script: call RemoveLocation(udg_Tournament_TempP)
      • Wait 1.00 seconds
      • Set Tournament_TempP = (Center of Tournament <gen>)
      • Floating Text - Create floating text that reads 3 at Tournament_TempP with Z offset 50.00, using font size 10.00, color (100.00%, 10.00%, 10.00%), and 0.00% transparency
      • Floating Text - Show (Last created floating text) for (All players)
      • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
      • Floating Text - Change the age of (Last created floating text) to 1.00 seconds
      • Wait 1.00 seconds
      • Floating Text - Hide (Last created floating text) for (All players)
      • Floating Text - Destroy (Last created floating text)
      • Floating Text - Create floating text that reads 2 at Tournament_TempP with Z offset 50.00, using font size 10.00, color (100.00%, 10.00%, 10.00%), and 0.00% transparency
      • Floating Text - Show (Last created floating text) for (All players)
      • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
      • Floating Text - Change the age of (Last created floating text) to 1.00 seconds
      • Wait 1.00 seconds
      • Floating Text - Hide (Last created floating text) for (All players)
      • Floating Text - Destroy (Last created floating text)
      • Floating Text - Create floating text that reads 2 at Tournament_TempP with Z offset 50.00, using font size 10.00, color (100.00%, 10.00%, 10.00%), and 0.00% transparency
      • Floating Text - Show (Last created floating text) for (All players)
      • Floating Text - Set the velocity of (Last created floating text) to 100.00 towards 90.00 degrees
      • Floating Text - Change the age of (Last created floating text) to 1.00 seconds
      • Wait 1.00 seconds
      • Floating Text - Hide (Last created floating text) for (All players)
      • Floating Text - Destroy (Last created floating text)
      • For each (Integer TournamentInteger) from 2 to 6, do (Actions)
        • Loop - Actions
          • Unit - Unpause Character_Hero[TournamentInteger]
          • Selection - Select Character_Hero[TournamentInteger] for (Owner of Character_Hero[TournamentInteger])
      • For each (Integer TournamentInteger) from 8 to 12, do (Actions)
        • Loop - Actions
          • Unit - Unpause Character_Hero[TournamentInteger]
          • Selection - Select Character_Hero[TournamentInteger] for (Owner of Character_Hero[TournamentInteger])
 
Last edited:
Level 15
Joined
Oct 29, 2012
Messages
1,474
How do you know that the timer does not work ? Did you put messages in the expire triggers to see if they are displayed ?
I posted the a trigger which includes a test that the expiring trigger that responses to the timer doesn't work, look at the arrayless trigger, I've included this action and it never runs
  • Game - Display to (All players) the text: LOOFOARZOGRAZOGOAZG...
Also make sure for the timers that they are set to 12 in the variable editor. You also leak locations.

It's arrayless, how can I set the size to 12 since it has no array index ? :/
You also leak locations
I know that actually :p but it has no relationship with the problem :(


Did you properly initialize those timers?

Anyway, could you post the map? May be faster to determine the error if timers are initialized.

If you mean by 'initialize' that I create a custom script and these things, I've already done that and the triggers are shown in front you, actually I did the same way with the working timer, I still don't know the difference between the two timers.

The map is big ( 9 MB ) , can you tell me what initialization of timers is ?

Also I will copy-paste the timers into a blank map and see if the issue is from the map itself or not
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
There are two things that can be wrong. The timer is never getting initialized or the timer is never getting started.
If the timer is not getting initialized that means your variables are hitting the op-limit.
If the timer is not getting started then that means it isn't getting started.

Show us the trigger that starts the timers. If there is nothing wrong with that one then it is most likely your variables.
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
I meant the trigger with timer array and by initialized I meant that either the "size" is set to proper value or that you use custom script to create the timer before using it.
Then I did initialize it
There are two things that can be wrong. The timer is never getting initialized or the timer is never getting started.
If the timer is not getting initialized that means your variables are hitting the op-limit.
If the timer is not getting started then that means it isn't getting started.

Show us the trigger that starts the timers. If there is nothing wrong with that one then it is most likely your variables.

I think it's the op-limit, I have used many, many variables , how can I remove this crappy op-limit ?
PS: I already imported the trigger that start the timers in the first post
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Then I did initialize it


I think it's the op-limit, I have used many, many variables , how can I remove this crappy op-limit ?
PS: I already imported the trigger that start the timers in the first post

You can not remove the op-limit. Although I have a hard time believing you hit that limit for global variables unless you set everything to more than 1 in the variable editor. If everything is 1 you need over 50k variables to hit the limit.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
I do not see where you start the tournament timer. Please post all relevant triggers. In fact I also do not see where you start the revive timer either.

I am guessing you are creating new timers and assigning them to those timer variables? If so then it will not work as the event is not linked to them (the event is created at map initialization with what ever time those variables contain then). This is why you never create or destroy timers in GUI.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Does the revive timer array have a value?
Yes one he assigns to it after the event is made...

  • Set TempInteger = (Player number of (Owner of (Dying unit)))
  • Custom script: set udg_ReviveTimers[udg_TempInteger] = CreateTimer()
So the time the event was created for (if any) is never started so the event will never fire and the trigger will never run.
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
You can not remove the op-limit. Although I have a hard time believing you hit that limit for global variables unless you set everything to more than 1 in the variable editor. If everything is 1 you need over 50k variables to hit the limit.

Tell me how to remove the op-limit because I have around 5k variables :(

@Dr.SuperGood @CakeMaster : I've included and attached the triggers that run the timers above ( First Post )
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
@Dr.SuperGood @CakeMaster : I've included and attached the triggers that run the timers above ( First Post )
And here is your problem...
Custom script: set udg_Tournament_Timer = CreateTimer()
The event is for another timer. The timer you start causes no events to run as no events were made for it.

Variables are pointers ("handles") to resources. The event takes this pointer and uses the actual object. As such changing a variable to a different pointer cannot possibly change the event since the event does not have a reference to the variable.

As I said earlier, this is why you should never create and destroy timers in GUI. Correctly written JASS does not use triggers and instead uses the in-built callback that the timer start native lets you reference (this functionality is not accessible in GUI, if you want to use it you have to use pure jass).
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
And here is your problem...

The event is for another timer. The timer you start causes no events to run as no events were made for it.

Variables are pointers ("handles") to resources. The event takes this pointer and uses the actual object. As such changing a variable to a different pointer cannot possibly change the event since the event does not have a reference to the variable.

As I said earlier, this is why you should never create and destroy timers in GUI. Correctly written JASS does not use triggers and instead uses the in-built callback that the timer start native lets you reference (this functionality is not accessible in GUI, if you want to use it you have to use pure jass).

That's too complicated, give me an example sample
 
Level 25
Joined
Sep 26, 2009
Messages
2,379
All handles have their own unique identification number (= ID).
Let's say you do this:
  • Custom script: set udg_MyTimer = CreateTimer()
  • Trigger - Add to *some trigger* the event (Timer - MyTimer expires)
Now when you create the timer, it has its unique ID. For this example, let's say the ID is number '1101'.
The event you add to the other trigger - (Timer - MyTimer expires) tells the game to register an event (Timer - Timer 1101 expires).
Then you destroy the timer.
Then you only create new timer via
  • Custom script: set udg_MyTimer = CreateTimer()
Notice the variable is the same, however this is completely different time. This timer won't have 1101 id, but for example, this timer can have the ID 2032.

After some time, you use the action
  • Countdown Timer - Start MyTimer as....
But you order the game to start timer 2032, but expect it fires the event registered for timer with id 1101.

This is why Dr.SuperGood wrote about not destroying timers in GUI, because you can't remove events once they are registered and so he wants to prevent you from registering 5000000000 timers each with different ID for event of same trigger - this causes triggers to crash.

Variables are just mediums to which you refer to an object, they're not the object itself. What is meant by that is that the variable holds the id, so the game can quickly refer to the timer (or any other object - or in other words: any other handle).
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
All handles have their own unique identification number (= ID).
Let's say you do this:
  • Custom script: set udg_MyTimer = CreateTimer()
  • Trigger - Add to *some trigger* the event (Timer - MyTimer expires)
Now when you create the timer, it has its unique ID. For this example, let's say the ID is number '1101'.
The event you add to the other trigger - (Timer - MyTimer expires) tells the game to register an event (Timer - Timer 1101 expires).
Then you destroy the timer.
Then you only create new timer via
  • Custom script: set udg_MyTimer = CreateTimer()
Notice the variable is the same, however this is completely different time. This timer won't have 1101 id, but for example, this timer can have the ID 2032.

After some time, you use the action
  • Countdown Timer - Start MyTimer as....
But you order the game to start timer 2032, but expect it fires the event registered for timer with id 1101.

This is why Dr.SuperGood wrote about not destroying timers in GUI, because you can't remove events once they are registered and so he wants to prevent you from registering 5000000000 timers each with different ID for event of same trigger - this causes triggers to crash.

Variables are just mediums to which you refer to an object, they're not the object itself. What is meant by that is that the variable holds the id, so the game can quickly refer to the timer (or any other object - or in other words: any other handle).

Seems quite complicated but I am gonna understand them ^^

You do not even need to create timers if you set up the variables correctly, GUI will make them for you.

Do you mean that even without this 'Countdown - Start Timer' a timer's window can be shown and the timer can expire ? The variables window isn't much, there is only size which is I always set to 12 as you said.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Do you mean that even without this 'Countdown - Start Timer' a timer's window can be shown and the timer can expire ? The variables window isn't much, there is only size which is I always set to 12 as you said.
Indices 0 to 12 will contain valid timer objects. These can later be used to make timer windows (unrelated objects) and the timer can be started, stopped and trigger events correctly.
 
Status
Not open for further replies.
Top