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

Revive and Timer Window problem

Status
Not open for further replies.
Level 10
Joined
Mar 17, 2012
Messages
579
Hi there! I have a problem...
Well I have a trigger that revives a duying hero after some duration...
But I also have a Resurrector unit that can revive hero instantly.
I also have a trigger that have to remove a timer window, but it doesn't!
Take a look:
  • Remove Timer Windows
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ((Entering unit) is A Hero) Equal to True
              • (Owner of (Entering unit)) Equal to Player 2 (Blue)
        • Then - Actions
          • Countdown Timer - Destroy Timer_window_blue
          • Trigger - Turn on Die Blue resp <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ((Entering unit) is A Hero) Equal to True
              • (Owner of (Entering unit)) Equal to Player 6 (Orange)
        • Then - Actions
          • Countdown Timer - Destroy Timer_window_orange
          • Trigger - Turn on Die Orange resp <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ((Entering unit) is A Hero) Equal to True
              • (Owner of (Entering unit)) Equal to Player 5 (Yellow)
        • Then - Actions
          • Countdown Timer - Destroy Timer_window_yellow
          • Trigger - Turn on Die Yellow resp <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ((Entering unit) is A Hero) Equal to True
              • (Owner of (Entering unit)) Equal to Player 4 (Purple)
        • Then - Actions
          • Countdown Timer - Destroy Timer_window_purple
          • Trigger - Turn on Die Purple resp <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ((Entering unit) is A Hero) Equal to True
              • (Owner of (Entering unit)) Equal to Player 8 (Pink)
        • Then - Actions
          • Countdown Timer - Destroy Timer_window_pink
          • Trigger - Turn on Die Pink resp <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ((Entering unit) is A Hero) Equal to True
              • (Owner of (Entering unit)) Equal to Player 9 (Gray)
        • Then - Actions
          • Countdown Timer - Destroy Timer_window_gray
          • Trigger - Turn on Die Gray resp <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ((Entering unit) is A Hero) Equal to True
              • (Owner of (Entering unit)) Equal to Player 11 (Dark Green)
        • Then - Actions
          • Countdown Timer - Destroy Timer_window_DG
          • Trigger - Turn on Die DG resp <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ((Entering unit) is A Hero) Equal to True
              • (Owner of (Entering unit)) Equal to Player 12 (Brown)
        • Then - Actions
          • Countdown Timer - Destroy Timer_window_brown
          • Trigger - Turn on Die Brown resp <gen>
        • Else - Actions
Why doesn't it check an entering unit event? How to check "Revive hero instantly" spell work? :ogre_rage:
 
Level 10
Joined
Mar 17, 2012
Messages
579
Dead heroes never leave the map. They are hidden at the top left corner (correct corner?) until revived. Instead of the entire map, use a region consisting of only the area around the reviver unit.

:ogre_icwydt: hmmmmm never knew that thanks)

You can also get rid of all of those and all condition blocks.
Use triggering unit instead of entering unit.
Using a timer array and trigger array would shorten this to one ITE.

Could you please show me how to do it right?
 
Last edited:
Level 29
Joined
Oct 24, 2012
Messages
6,543
:ogre_icwydt: hmmmmm never knew that thanks)



Could you please show me how to do it right?

You should really try to learn how to code more efficiently.

Here is how your trigger should be.
Also note that this may be able to be shortened if you combine the other triggers that get turned on because of this one.

First make a timer window array. TimerWindowArray
Second make a trigger array. TriggerArray
Third you need a player group. PlayerGroup
  • Setup Trigger
    • Events
      • Time elapsed = 0.00 seconds
    • Conditions
    • Actions
      • Set TimerWindowArray[2] = Timer_window_blue
      • Set TimerWindowArray[6] = Timer_window_orange
      • Set TimerWindowArray[5] = Timer_window_yellow
      • Set TimerWindowArray[4] = Timer_window_purple
      • Set TimerWindowArray[8] = Timer_window_pink
      • Set TimerWindowArray[9] = Timer_window_gray
      • Set TimerWindowArray[11] = Timer_window_DG
      • Set TimerWindowArray[12] = Timer_window_brown
      • Set TriggerArray[2] = Die Blue resp <gen>
      • Set TriggerArray[6] = Die Orange resp <gen>
      • Set TriggerArray[5] = Die Yellow resp <gen>
      • Set TriggerArray[4] = Die Purple resp <gen>
      • Set TriggerArray[8] = Die Pink resp <gen>
      • Set TriggerArray[9] = Die Gray resp <gen>
      • Set TriggerArray[11] = Die DG resp <gen>
      • Set TriggerArray[12] = Die Brown resp <gen>
      • Player group add
        • Player 2 (Blue)
        • Player 6 (Orange)
        • Player 5 (Yellow)
        • Player 4 (Purple)
        • Player 8 (Pink)
        • Player 9 (Gray)
        • Player 11 (Dark Green)
        • Player 12 (Brown)
  • Remove Timer Windows
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to True
          • (Triggering player) is in PlayerGroup equal to true
        • Then - Actions
          • Set tempInteger = Player number of Triggering Player
          • Countdown Timer - Destroy TimerWindowArray[tempInteger]
          • Trigger - Turn on TriggerArray[tempInteger]
        • Else - Actions
 
Level 10
Joined
Mar 17, 2012
Messages
579
You should really try to learn how to code more efficiently.

Here is how your trigger should be.
Also note that this may be able to be shortened if you combine the other triggers that get turned on because of this one.

First make a timer window array. TimerWindowArray
Second make a trigger array. TriggerArray
Third you need a player group. PlayerGroup
  • Setup Trigger
    • Events
      • Time elapsed = 0.00 seconds
    • Conditions
    • Actions
      • Set TimerWindowArray[2] = Timer_window_blue
      • Set TimerWindowArray[6] = Timer_window_orange
      • Set TimerWindowArray[5] = Timer_window_yellow
      • Set TimerWindowArray[4] = Timer_window_purple
      • Set TimerWindowArray[8] = Timer_window_pink
      • Set TimerWindowArray[9] = Timer_window_gray
      • Set TimerWindowArray[11] = Timer_window_DG
      • Set TimerWindowArray[12] = Timer_window_brown
      • Set TriggerArray[2] = Die Blue resp <gen>
      • Set TriggerArray[6] = Die Orange resp <gen>
      • Set TriggerArray[5] = Die Yellow resp <gen>
      • Set TriggerArray[4] = Die Purple resp <gen>
      • Set TriggerArray[8] = Die Pink resp <gen>
      • Set TriggerArray[9] = Die Gray resp <gen>
      • Set TriggerArray[11] = Die DG resp <gen>
      • Set TriggerArray[12] = Die Brown resp <gen>
      • Player group add
        • Player 2 (Blue)
        • Player 6 (Orange)
        • Player 5 (Yellow)
        • Player 4 (Purple)
        • Player 8 (Pink)
        • Player 9 (Gray)
        • Player 11 (Dark Green)
        • Player 12 (Brown)
  • Remove Timer Windows
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to True
          • (Triggering player) is in PlayerGroup equal to true
        • Then - Actions
          • Set tempInteger = Player number of Triggering Player
          • Countdown Timer - Destroy TimerWindowArray[tempInteger]
          • Trigger - Turn on TriggerArray[tempInteger]
        • Else - Actions

Yeah, but all heroes are ressuracted in different places... Would you like to look at all of my duying, respawning and resurrecting triggers???
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
You can create arrays for points (location type) which you can use to feed the system the respawn points. The idea is to create a system such that the same set of code handles all players by changing values. This may or may not be more efficient but it is more maintainable as by simply changing some array or variable values you can make the system behave differently.
 
Level 10
Joined
Mar 17, 2012
Messages
579
You can create arrays for points (location type) which you can use to feed the system the respawn points. The idea is to create a system such that the same set of code handles all players by changing values. This may or may not be more efficient but it is more maintainable as by simply changing some array or variable values you can make the system behave differently.

:ogre_icwydt: Okay I'll try to bring it to life. Thanks a lot!)
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Yeah, but all heroes are ressuracted in different places... Would you like to look at all of my duying, respawning and resurrecting triggers???

That is just the same as I did above.
You put the locations into the array. Then spawn just like how I did with the timer windows.

If you can't get it to work after you have tried. Post it here and I will try to help.
 
Level 10
Joined
Mar 17, 2012
Messages
579
That is just the same as I did above.
You put the locations into the array. Then spawn just like how I did with the timer windows.

If you can't get it to work after you have tried. Post it here and I will try to help.

Okay but please don't laugh too loudly :ogre_hurrhurr:


  • HeroBlue
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • ((Entering unit) is A Hero) Equal to True
          • (Owner of (Entering unit)) Equal to Player 2 (Blue)
    • Actions
      • Set Hero_Blue = (Triggering unit)
----//----- same for 7 other players


  • Die Blue
    • Events
      • Unit - A unit owned by Player 2 (Blue) Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Player - Add -100 to Player 2 (Blue) Current gold
      • Game - Display to (All players) the text: (((|cff0066ff + (Name of (Triggering unit))) + |r) + dies and loses |cffffcc00100|r gold!)
      • Countdown Timer - Start Death_timer_blue as a One-shot timer that will expire in (5.00 + (3.00 x (Real((Level of (Dying unit)))))) seconds
      • Countdown Timer - Create a timer window for Death_timer_blue with title Respawn:
      • Set Timer_window_blue = (Last created timer window)
      • Countdown Timer - Change the color of the time for Timer_window_blue to (10.00%, 30.00%, 100.00%) with 0.00% transparency
      • Countdown Timer - Hide Timer_window_blue
      • Countdown Timer - Show Timer_window_blue for Player 2 (Blue)
      • Countdown Timer - Show Timer_window_blue for Player 6 (Orange)
      • Countdown Timer - Show Timer_window_blue for Player 5 (Yellow)
      • Countdown Timer - Show Timer_window_blue for Player 4 (Purple)
      • Trigger - Turn on Die Blue resp <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Resurrector_Bool[1] Equal to False
        • Then - Actions
          • Set Hero_Blue_Point = (Center of Resurector Blue <gen>)
          • Unit - Create 1 Resurrector (Ghost) for Player 2 (Blue) at Hero_Blue_Point facing Default building facing degrees
          • Set Resurrector[1] = (Last created unit)
          • Animation - Play Resurrector[1]'s channel animation
          • Custom script: call RemoveLocation (udg_Hero_Blue_Point)
          • Set Resurrector_Bool[1] = True
        • Else - Actions
  • Die Blue resp
    • Events
      • Time - Death_timer_blue expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy Timer_window_blue
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
          • Hero - Instantly revive Hero_Blue at (Center of Blue Orange <gen>), Show revival graphics
          • Set Hero_Blue_Point = (Position of Hero_Blue)
          • Camera - Pan camera for Player 2 (Blue) to Hero_Blue_Point over 0.00 seconds
          • Custom script: call RemoveLocation (udg_Hero_Blue_Point)
        • Else - Actions
      • Trigger - Turn off (This trigger)
-----//----- the same for another 7 players


  • Remove Timer Window Blue
    • Events
      • Unit - A unit enters Resurector Blue <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • ((Entering unit) is A Hero) Equal to True
              • (Owner of (Entering unit)) Equal to Player 2 (Blue)
        • Then - Actions
          • Countdown Timer - Destroy Timer_window_blue
          • Trigger - Turn off Die Blue resp <gen>
        • Else - Actions
-----//----- Same for 7 other players

:ogre_kawaii:
 
Last edited:
Status
Not open for further replies.
Top