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

Trigger isn't working

Status
Not open for further replies.
Level 5
Joined
Jun 24, 2009
Messages
118
  • PlayerRedD
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Owner of (Dying unit)) is in Player Group - Player 1 (Red)) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to True
          • ((Owner of (Dying unit)) is in Player Group - Player 1 (Red)) Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: (|cffff8800 + ((Name of (Owner of (Killing unit))) + (|r + (|cff77bbff killed |r + (|cffffff00 + ((Name of (Triggering player)) + |r|cff77bbff and gets 300 gold.|r))))))
          • Countdown Timer - Start ReviewTimer as a One-shot timer that will expire in 30.00 seconds
          • Countdown Timer - Show (Last created timer window) for Player 1 (Red)
          • Countdown Timer - Create a timer window for (Last started timer) with title Respawn
          • Player - Add 300 to (Owner of (Killing unit)) Current gold
          • Player - Add -300 to (Owner of (Triggering unit)) Current gold
          • Set Timer_Window = (Last created timer window)
          • Wait 30.00 seconds
          • Set tempPoint[1] = (Center of BaseRed <gen>)
          • Hero - Instantly revive (Triggering unit) at tempPoint[2], Hide revival graphics
          • Hero - Set (Triggering unit) Hero-level to (Level of (Dying unit)), Hide level-up graphics
          • Countdown Timer - Destroy (Last created timer window)
          • Countdown Timer - Hide (Last created timer window) for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Not equal to True
        • Then - Actions
          • Player - Add -150 to (Owner of (Killing unit)) Current gold
          • Player - Add 150 to (Owner of (Triggering unit)) Current gold
        • Else - Actions
Why this trigger isn't working. It's working for other players perfect (player 2 ; etc.) :razz:
 
Level 5
Joined
Jun 24, 2009
Messages
118
Well, sorry - my mistake. This trigger (actually four triggers - for each player) start working after the second time but that timer window still stays (at 00:00:00).Inreal, it's weird.
 
Level 7
Joined
Nov 6, 2009
Messages
279
Well, sorry - my mistake. This trigger (actually four triggers - for each player) start working after the second time but that timer window still stays (at 00:00:00).Inreal, it's weird.

Dont use 4 triggers just for the revival locs! Use owner of triggering unit and if/then/else for that!
 
Level 12
Joined
Apr 18, 2007
Messages
1,130
He doesn't just mean hard disk space, he also means system memory when running it. Having a bunch of these kinds of things piled up makes the game go slower.
 
Level 16
Joined
May 1, 2008
Messages
1,605
1) You should add each playerteam into a playergroup. If it's only one team at this in a playergroup to.

2) Delete your normal condition. Add in the If - Then - Else in which team the dying unit is.

3) Wondering if this work anyway - you set the respawn = temppoint[1] but want revive the unit at temppoint[2]

4) Also clear the leak with: call RemoveLocation(udg_TempPoint[1]) or call RemoveLocation(udg_TempPoint[2]) ( what ever you take there =O )
 
Level 5
Joined
Jun 24, 2009
Messages
118
Now my trigger looks like that:
  • PlayerRedD
    • Events
      • Unit - A unit owned by Player 1 (Red) Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Killing unit) Equal to (Random unit from (Units owned by Player 3 (Teal)))
        • Then - Actions
          • Set Kills[3] = (Kills[3] + 1)
          • Set Deaths[1] = (Deaths[1] + 1)
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row 4 to (String(Kills[3]))
          • Multiboard - Set the text for (Last created multiboard) item in column 3, row 2 to (String(Deaths[1]))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Killing unit) Equal to (Random unit from (Units owned by Player 2 (Blue)))
        • Then - Actions
          • Set Kills[2] = (Kills[2] + 1)
          • Set Deaths[1] = (Deaths[1] + 1)
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row 3 to (String(Kills[3]))
          • Multiboard - Set the text for (Last created multiboard) item in column 3, row 2 to (String(Deaths[1]))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Killing unit) Equal to (Random unit from (Units owned by Player 7 (Green)))
        • Then - Actions
          • Set Kills[4] = (Kills[4] + 1)
          • Set Deaths[1] = (Deaths[1] + 1)
          • Multiboard - Set the text for (Last created multiboard) item in column 2, row 5 to (String(Kills[4]))
          • Multiboard - Set the text for (Last created multiboard) item in column 3, row 2 to (String(Deaths[1]))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Equal to True
          • ((Owner of (Dying unit)) is in Player Group - Player 1 (Red)) Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: (|cffff8800 + ((Name of (Owner of (Killing unit))) + (|r + (|cff77bbff killed |r + (|cffffff00 + ((Name of (Triggering player)) + |r|cff77bbff and gets 300 gold.|r))))))
          • Countdown Timer - Start ReviewTimer as a One-shot timer that will expire in 30.00 seconds
          • Countdown Timer - Create a timer window for (Last started timer) with title Respawn
          • Countdown Timer - Show (Last created timer window) for Player 1 (Red)
          • Countdown Timer - Hide (Last created timer window) for Player 2 (Blue)
          • Countdown Timer - Hide (Last created timer window) for Player 3 (Teal)
          • Countdown Timer - Hide (Last created timer window) for Player 7 (Green)
          • Player - Add 300 to (Owner of (Killing unit)) Current gold
          • Player - Add -300 to (Owner of (Triggering unit)) Current gold
          • Set Timer_Window = (Last created timer window)
          • Wait 30.00 seconds
          • Set tempPoint[1] = (Center of BaseRed <gen>)
          • Hero - Instantly revive (Triggering unit) at tempPoint[1], Hide revival graphics
          • Hero - Set (Triggering unit) Hero-level to (Level of (Dying unit)), Hide level-up graphics
          • Countdown Timer - Destroy (Last created timer window)
          • Countdown Timer - Hide (Last created timer window) for Player 1 (Red)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A Hero) Not equal to True
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + died from creeps.)
          • Player - Add -150 to (Owner of (Dying unit)) Current gold
          • Player - Add 150 to (Owner of (Killing unit)) Current gold
        • Else - Actions
but hero isn't reviving anyway. (dont look at the leaderboard shit,coz it works fine and i'm testing it only @ priest.)
 
Last edited:
Level 16
Joined
May 1, 2008
Messages
1,605
Seas =)

You don't should ask me I create a respawn stuff like this - but this work =O I don't know why but it does ( actually for me ^^ )

1) Add each player to a variable in your initialization trigger:

  • Melee Initialization
    • Events
      • Time - Elapsed game time is 0.01 seconds
    • Conditions
    • Actions
      • Set Player[1] = Player 1 (Red)
      • Set Player[2] = Player 2 (Blue)
      • Set Player[3] = Player 3 (Teal)
      • Set Player[4] = Player 4 (Purple)
      • Set Player[5] = Player 5 (Yellow)
      • Set Player[6] = Player 6 (Orange)
      • Set Player[7] = Player 7 (Green)
      • Set Player[8] = Player 8 (Pink)
      • Set Player[9] = Player 9 (Gray)
      • Set Player[10] = Player 10 (Light Blue)
Now you create the following 2 triggers:
  • HeroRespawnRun
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Dying unit)) Equal to Player[(Integer A)]
            • Then - Actions
              • Countdown Timer - Start RespawnTimer as a One-shot timer that will expire in 3.00 seconds
              • Set RespawnTimer = (Last started timer)
              • Countdown Timer - Create a timer window for RespawnTimer with title Respawn
              • Countdown Timer - Show (Last created timer window) for Player[(Integer A)]
              • Set RespawnUnit[(Integer A)] = (Dying unit)
            • Else - Actions
  • HeroRespawn
    • Events
      • Time - RespawnTimer expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy (Last created timer window)
      • Set RespawnPoint = ((Position of Fountain of light 0015 <gen>) offset by 150.00 towards 45.00 degrees)
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • Hero - Instantly revive RespawnUnit[(Integer A)] at RespawnPoint, Hide revival graphics
      • Custom script: call RemoveLocation(udg_RespawnPoint)
I think you need to set the RespawnPoint at a different place.

[ As I said I don't know how this works - I just create this for fun in the last 5 mins ^^ ]
 
Level 5
Joined
Jun 24, 2009
Messages
118
Solved! I just had to change ''Triggering Unit'' to ''Dying Unit'' and put them in right place. :)
 
Last edited:
Status
Not open for further replies.
Top