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

Respawn trigg problem

Status
Not open for further replies.
Level 18
Joined
May 11, 2012
Messages
2,103
I hear some people telling me that this triggrr doesn't works for player 2, but i cant find the problem.. Check it and plz tell me whats wrong?

  • Start Timer
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 8, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to (Player((Integer A)))
            • Then - Actions
              • Set Hero[(Integer A)] = (Triggering unit)
              • Player - Add -20000 to (Player((Integer A))) Current gold
              • Set PlayerGroup = (Player group((Player((Integer A)))))
              • Game - Display to PlayerGroup the text: ((Name of (Player((Integer A)))) + |c00FFD700You lost 20 000 Gold and will respawn after 5 minutes.)
              • Custom script: call DestroyForce(udg_PlayerGroup)
              • Countdown Timer - Start TimerRespawn[(Integer A)] as a One-shot timer that will expire in 300.00 seconds
              • Countdown Timer - Create a timer window for (Last started timer) with title Respawn in:
              • Set TimerWindowRespawn = (Last created timer window)
              • Countdown Timer - Show TimerWindowRespawn for (Player((Integer A)))
            • Else - Actions
  • End Timer Player 1
    • Events
      • Time - TimerRespawn[1] expires
    • Conditions
    • Actions
      • Set Player_RespawnPoint[1] = (Center of Player 1 Respawn Point <gen>)
      • Countdown Timer - Hide TimerWindowRespawn
      • Countdown Timer - Destroy TimerWindowRespawn
      • Wait 1.00 seconds
      • Hero - Instantly revive Hero[1] at Player_RespawnPoint[1], Show revival graphics
      • Camera - Pan camera for (Owner of Hero[1]) to Player_RespawnPoint[1] over 0.00 seconds
      • Selection - Select Hero[1] for Player 1 (Red)
      • Custom script: call RemoveLocation(udg_Player_RespawnPoint[1])
  • End Timer Player 2
    • Events
      • Time - TimerRespawn[2] expires
    • Conditions
    • Actions
      • Set Player_RespawnPoint[2] = (Center of Player 2 Respawn Point <gen>)
      • Countdown Timer - Hide TimerWindowRespawn
      • Countdown Timer - Destroy TimerWindowRespawn
      • Wait 1.00 seconds
      • Hero - Instantly revive Hero[2] at Player_RespawnPoint[2], Show revival graphics
      • Camera - Pan camera for (Owner of Hero[2]) to Player_RespawnPoint[2] over 0.00 seconds
      • Selection - Select Hero[2] for Player 2 (Blue)
      • Custom script: call RemoveLocation(udg_Player_RespawnPoint[2])
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
timer arrays dont work. you have to do seperate variables for each timer
They do work, you just need to increase the array size in the variable editor.
This is because there is no "Create Timer"-action in GUI. The only way to do that is by the default variable intialization. When arrays are concerned, they only initialize up to the max array size (default 1, so only Timer[1] will work).

Timers and Dialogs are the only GUI-variables where you actually need to increase the array size if you want them to do something.
Don't do it for any other variables though! Initializing huge arrays causes problems.
 
Level 18
Joined
May 11, 2012
Messages
2,103
They do work, you just need to increase the array size in the variable editor.
This is because there is no "Create Timer"-action in GUI. The only way to do that is by the default variable intialization. When arrays are concerned, they only initialize up to the max array size (default 1, so only Timer[1] will work).

Timers and Dialogs are the only GUI-variables where you actually need to increase the array size if you want them to do something.
Don't do it for any other variables though! Initializing huge arrays causes problems.

yeah, I remembered that I should increase the size ;), and it works okay now
But there's one more thing: Why does the timer windows shows for all players and not only the triggering player???
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
You have to hide the timer window first.
  • Countdown Timer - Hide (Last created timer window)
  • Countdown Timer - Show (Last created timer window) for (Player((Integer A)))
I also think you need to make the timer window an array as well.
It might be possible right now to overwrite the Timer Window-variable (if multiple people die while a timer is still active) and then it can never be removed again.
 
Status
Not open for further replies.
Top