• 🏆 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 – works only for 1 player, why?

Status
Not open for further replies.
Level 7
Joined
Sep 19, 2020
Messages
190
this trigger work for player 1 only, way? and how to fixed?
  • Revive Start
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Unit-type of (Dying unit)) is A Hero) Equal to True
    • Actions
      • Player Group - Pick every player in (All players) and 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 (Picked player)
            • Then - Actions
              • Set PlayerRivive[((Player number of (Owner of (Triggering unit))) - 1)] = (30 + ((((Hero level of (Killing unit)) / 2) + ((Hero level of (Dying unit)) / 2)) + ((Die[1] + Die[2]) + (Die[3] + Die[4]))))
              • Set ReviveHero[((Player number of (Owner of (Triggering unit))) - 1)] = (Triggering unit)
              • Floating Text - Create floating text that reads (String(PlayerRivive[((Player number of (Owner of (Triggering unit))) - 1)])) at ((Position of CircelofPower[((Player number of (Owner of (Triggering unit))) - 1)]) offset by (-25.00, -25.00)) with Z offset 0.00, using font size 25.00, color (100.00%, 0.00%, 0.00%), and 25.00% transparency
              • Set ReviveText[((Player number of (Owner of (Triggering unit))) - 1)] = (Last created floating text)
              • Floating Text - Change ReviveText[((Player number of (Owner of (Triggering unit))) - 1)]: Disable permanence
              • Floating Text - Change the lifespan of ReviveText[((Player number of (Owner of (Triggering unit))) - 1)] to ((Real(PlayerRivive[((Player number of (Owner of (Triggering unit))) - 1)])) + 1.00) seconds
              • Countdown Timer - Start ReviveTimer[((Player number of (Owner of (Triggering unit))) - 1)] as a One-shot timer that will expire in (Real(PlayerRivive[((Player number of (Owner of (Triggering unit))) - 1)])) seconds
            • Else - Actions
              • Do nothing
 
Level 5
Joined
Jul 31, 2020
Messages
103
Not sure what you're doing there, but as wasteful as it would look to create more global variables, since you're using GUI and have no access to locals, you should definitely make more. First of all, make a playerNumber integer, and set the player number of triggering unit right at the start of your trigger. Then remove the "Pick every player in all players" part along with the conditional statement, "Owner of triggering unit equal to picked player", because they're completely pointless. I don't even know why they're there in the first place. The next thing to do is removing "Do nothing" because there's no reason to ever use it.

Instead of the whole PlayerRevive[((Player number of (Owner of (Triggering unit))) - 1)] going on in every single line, you can turn that into PlayerRevive[playerNumber - 1)]. But yeah, a local variable would be miles better there.
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
@DexterFstone you have a lot of unnecessary stuff in your trigger that @J2Krauser already explained, the trigger would be better like this:
  • Revive Start
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Unit-type of (Dying unit)) is A Hero) Equal to True
    • Actions
      • Set Temp_int = (Player number of (Owner of (Triggering unit))) - 1
      • Set PlayerRivive[Temp_int] = (30 + ((((Hero level of (Killing unit)) / 2) + ((Hero level of (Dying unit)) / 2)) + ((Die[1] + Die[2]) + (Die[3] + Die[4]))))
      • Set ReviveHero[Temp_int] = (Triggering unit)
      • Set Temp_loc = (Position of CircelofPower[Temp_int])
      • Set Temp_loc2 = (Temp_loc offset by (-25.00, -25.00))
      • Floating Text - Create floating text that reads (String(PlayerRivive[Temp_int])) at Temp_loc2 with Z offset 0.00, using font size 25.00, color (100.00%, 0.00%, 0.00%), and 25.00% transparency
      • Custom script: call RemoveLocation(udg_Temp_loc)
      • Custom script: call RemoveLocation(udg_Temp_loc2)
      • Set ReviveText[Temp_int] = (Last created floating text)
      • Floating Text - Change ReviveText[Temp_int]: Disable permanence
      • Floating Text - Change the lifespan of ReviveText[Temp_int] to ((Real(PlayerRivive[Temp_int])) + 1.00) seconds
      • Countdown Timer - Start ReviveTimer[Temp_int] as a One-shot timer that will expire in (Real(PlayerRivive[Temp_int])) seconds
But, why "(Player number of (Owner of (Triggering unit))) - 1"? Why -1? Do you have a reason for that?
PD: The variable "PlayerRivive" is spelled wrong, and the Temp_loc is to prevent memory leak but if the circle is always in the same place you can create a variable of its location in Map Initialization and use it instead of creating and destroying everytime.
 
Last edited:
Level 7
Joined
Sep 19, 2020
Messages
190
  • Time - Every 1.00 seconds of game time
when I use this trigger
or
  • Time - ReviveTimer[0] expires
  • Player Group - Pick every player in (All players) and do (Actions)
Player Group not work, how to make trigger for very 1 sec working and work for every player?

for example I make a trigger for all player how to convert to Player Group
  • Revive Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • -------- 1 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[0] Not equal to 0
        • Then - Actions
          • Set PlayerRivive[0] = (PlayerRivive[0] - 1)
          • Floating Text - Change text of ReviveText[0] to (String(PlayerRivive[0])) using font size 25.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[0] Equal to 10
        • Then - Actions
          • Floating Text - Change the color of ReviveText[0] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[0] Equal to 9
        • Then - Actions
          • Floating Text - Change the position of ReviveText[0] to ((Position of CircelofPower[0]) offset by (-15.00, -25.00)) with Z offset 0.00
        • Else - Actions
      • -------- 2 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[1] Not equal to 0
        • Then - Actions
          • Set PlayerRivive[1] = (PlayerRivive[1] - 1)
          • Floating Text - Change text of ReviveText[1] to (String(PlayerRivive[1])) using font size 25.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[1] Equal to 10
        • Then - Actions
          • Floating Text - Change the color of ReviveText[1] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[1] Equal to 9
        • Then - Actions
          • Floating Text - Change the position of ReviveText[1] to ((Position of CircelofPower[1]) offset by (-15.00, -25.00)) with Z offset 0.00
        • Else - Actions
      • -------- 3 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[2] Not equal to 0
        • Then - Actions
          • Set PlayerRivive[2] = (PlayerRivive[2] - 1)
          • Floating Text - Change text of ReviveText[2] to (String(PlayerRivive[2])) using font size 25.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[2] Equal to 10
        • Then - Actions
          • Floating Text - Change the color of ReviveText[2] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[2] Equal to 9
        • Then - Actions
          • Floating Text - Change the position of ReviveText[2] to ((Position of CircelofPower[2]) offset by (-15.00, -25.00)) with Z offset 0.00
        • Else - Actions
      • -------- 4 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[3] Not equal to 0
        • Then - Actions
          • Set PlayerRivive[3] = (PlayerRivive[2] - 1)
          • Floating Text - Change text of ReviveText[3] to (String(PlayerRivive[3])) using font size 25.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[3] Equal to 10
        • Then - Actions
          • Floating Text - Change the color of ReviveText[3] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[3] Equal to 9
        • Then - Actions
          • Floating Text - Change the position of ReviveText[3] to ((Position of CircelofPower[3]) offset by (-15.00, -25.00)) with Z offset 0.00
        • Else - Actions
      • -------- 5 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[4] Not equal to 0
        • Then - Actions
          • Set PlayerRivive[4] = (PlayerRivive[4] - 1)
          • Floating Text - Change text of ReviveText[4] to (String(PlayerRivive[4])) using font size 25.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[4] Equal to 10
        • Then - Actions
          • Floating Text - Change the color of ReviveText[4] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[4] Equal to 9
        • Then - Actions
          • Floating Text - Change the position of ReviveText[4] to ((Position of CircelofPower[4]) offset by (-15.00, -25.00)) with Z offset 0.00
        • Else - Actions
      • -------- 6 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[5] Not equal to 0
        • Then - Actions
          • Set PlayerRivive[5] = (PlayerRivive[5] - 1)
          • Floating Text - Change text of ReviveText[5] to (String(PlayerRivive[5])) using font size 25.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[5] Equal to 10
        • Then - Actions
          • Floating Text - Change the color of ReviveText[5] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[5] Equal to 9
        • Then - Actions
          • Floating Text - Change the position of ReviveText[5] to ((Position of CircelofPower[5]) offset by (-15.00, -25.00)) with Z offset 0.00
        • Else - Actions
      • -------- 7 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[6] Not equal to 0
        • Then - Actions
          • Set PlayerRivive[6] = (PlayerRivive[6] - 1)
          • Floating Text - Change text of ReviveText[6] to (String(PlayerRivive[6])) using font size 25.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[6] Equal to 10
        • Then - Actions
          • Floating Text - Change the color of ReviveText[6] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[6] Equal to 9
        • Then - Actions
          • Floating Text - Change the position of ReviveText[6] to ((Position of CircelofPower[6]) offset by (-15.00, -25.00)) with Z offset 0.00
        • Else - Actions
      • -------- 8 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[7] Not equal to 0
        • Then - Actions
          • Set PlayerRivive[7] = (PlayerRivive[7] - 1)
          • Floating Text - Change text of ReviveText[7] to (String(PlayerRivive[7])) using font size 25.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[7] Equal to 10
        • Then - Actions
          • Floating Text - Change the color of ReviveText[7] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[7] Equal to 9
        • Then - Actions
          • Floating Text - Change the position of ReviveText[7] to ((Position of CircelofPower[7]) offset by (-15.00, -25.00)) with Z offset 0.00
        • Else - Actions
      • -------- 9 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[8] Not equal to 0
        • Then - Actions
          • Set PlayerRivive[8] = (PlayerRivive[8] - 1)
          • Floating Text - Change text of ReviveText[8] to (String(PlayerRivive[8])) using font size 25.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[8] Equal to 10
        • Then - Actions
          • Floating Text - Change the color of ReviveText[8] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[8] Equal to 9
        • Then - Actions
          • Floating Text - Change the position of ReviveText[8] to ((Position of CircelofPower[8]) offset by (-15.00, -25.00)) with Z offset 0.00
        • Else - Actions
      • -------- 10 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[9] Not equal to 0
        • Then - Actions
          • Set PlayerRivive[9] = (PlayerRivive[9] - 1)
          • Floating Text - Change text of ReviveText[9] to (String(PlayerRivive[9])) using font size 25.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[9] Equal to 10
        • Then - Actions
          • Floating Text - Change the color of ReviveText[9] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[9] Equal to 9
        • Then - Actions
          • Floating Text - Change the position of ReviveText[9] to ((Position of CircelofPower[9]) offset by (-15.00, -25.00)) with Z offset 0.00
        • Else - Actions
      • -------- 11 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[10] Not equal to 0
        • Then - Actions
          • Set PlayerRivive[10] = (PlayerRivive[10] - 1)
          • Floating Text - Change text of ReviveText[10] to (String(PlayerRivive[10])) using font size 25.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[10] Equal to 10
        • Then - Actions
          • Floating Text - Change the color of ReviveText[10] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[10] Equal to 9
        • Then - Actions
          • Floating Text - Change the position of ReviveText[10] to ((Position of CircelofPower[10]) offset by (-15.00, -25.00)) with Z offset 0.00
        • Else - Actions
      • -------- 12 --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[11] Not equal to 0
        • Then - Actions
          • Set PlayerRivive[11] = (PlayerRivive[11] - 1)
          • Floating Text - Change text of ReviveText[11] to (String(PlayerRivive[11])) using font size 25.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[11] Equal to 10
        • Then - Actions
          • Floating Text - Change the color of ReviveText[11] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[11] Equal to 9
        • Then - Actions
          • Floating Text - Change the position of ReviveText[11] to ((Position of CircelofPower[11]) offset by (-15.00, -25.00)) with Z offset 0.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[10] Not equal to 0
        • Then - Actions
          • Set PlayerRivive[10] = (PlayerRivive[10] - 1)
          • Floating Text - Change text of ReviveText[10] to (String(PlayerRivive[10])) using font size 25.00
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[10] Equal to 10
        • Then - Actions
          • Floating Text - Change the color of ReviveText[10] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[10] Equal to 9
        • Then - Actions
          • Floating Text - Change the position of ReviveText[10] to ((Position of CircelofPower[10]) offset by (-15.00, -25.00)) with Z offset 0.00
        • Else - Actions
I try to make by Player Group but is work only for player red
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,539
  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set VariableSet PN = (Player number of (Picked player))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ReviveTime[PN] Not equal to 0
            • Then - Actions
              • Set VariableSet ReviveTime[PN] = (ReviveTime[PN] - 1)
              • -------- Do stuff --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ReviveTime[PN] Equal to 10
                • Then - Actions
                  • -------- Do stuff --------
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ReviveTime[PN] Equal to 9
                    • Then - Actions
                      • -------- Do stuff --------
                    • Else - Actions
            • Else - Actions
 
Level 7
Joined
Sep 19, 2020
Messages
190
  • Untitled Trigger 001
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set VariableSet PN = (Player number of (Picked player))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ReviveTime[PN] Not equal to 0
            • Then - Actions
              • Set VariableSet ReviveTime[PN] = (ReviveTime[PN] - 1)
              • -------- Do stuff --------
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ReviveTime[PN] Equal to 10
                • Then - Actions
                  • -------- Do stuff --------
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ReviveTime[PN] Equal to 9
                    • Then - Actions
                      • -------- Do stuff --------
                    • Else - Actions
            • Else - Actions
sorry but is not work as you see in this video
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
I think the problem is in how your variables are defined, because when your create variable arrays there are some types you need to define first before to use it.
Example:
If you create a integer array and it have a size of 1, when you initialize the trigger usually you do: myinteger[2]=0 so even is greater than the size you can use it.
In case of groups, if you create a variable array with size 1, and yo do: Add unit to mygroup[2] this do nothing because when you initialize a group variable array they are initialize as an empty group, but the 2nd no, because this is outside of the size and this group doesn't exist.
To fix this you can or increase the size of the array, or use.
  • Custom script: set udg_mygroup[2]=CreateGroup()
  • When you used it
  • Custom script: call DestroyGroup(udg_mygroup[2])
Is the same case with timers.
 
Level 7
Joined
Sep 19, 2020
Messages
190
I think the problem is in how your variables are defined, because when your create variable arrays there are some types you need to define first before to use it.
Example:
If you create a integer array and it have a size of 1, when you initialize the trigger usually you do: myinteger[2]=0 so even is greater than the size you can use it.
In case of groups, if you create a variable array with size 1, and yo do: Add unit to mygroup[2] this do nothing because when you initialize a group variable array they are initialize as an empty group, but the 2nd no, because this is outside of the size and this group doesn't exist.
To fix this you can or increase the size of the array, or use.
  • Custom script: set udg_mygroup[2]=CreateGroup()
  • When you used it
  • Custom script: call DestroyGroup(udg_mygroup[2])
Is the same case with timers.
I have 4 array and all size is 12 and Pick Player Group have a problem when using for Time Trigger because a have aother trigger and use player group when unit is die and it's very good working, i guess is player group is not work in time trigger
 
Level 7
Joined
Sep 19, 2020
Messages
190
for now i use trigger for every player

  • Events
    • Unit - A unit Dies
  • Conditions
    • ((Unit-type of (Dying unit)) is A Hero) Equal to True
  • Actions
  • Player Group - Pick every player in (All players) and 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 (Triggering player)
        • Then - Actions
          • Set PlayerRivive[((Player number of (Triggering player)) - 1)] = (30 + ((((Hero level of (Killing unit)) / 2) + ((Hero level of (Dying unit)) / 2)) + ((Die[1] + Die[2]) + (Die[3] + Die[4]))))
          • Set ReviveHero[((Player number of (Triggering player)) - 1)] = (Triggering unit)
          • Floating Text - Create floating text that reads (String(PlayerRivive[((Player number of (Triggering player)) - 1)])) at ((Position of CircelofPower[((Player number of (Triggering player)) - 1)]) offset by (-25.00, -25.00)) with Z offset 0.00, using font size 25.00, color (0.00%, 100.00%, 0.00%), and 25.00% transparency
          • Set ReviveText[((Player number of (Triggering player)) - 1)] = (Last created floating text)
          • Floating Text - Change ReviveText[((Player number of (Triggering player)) - 1)]: Disable permanence
          • Floating Text - Change the lifespan of ReviveText[((Player number of (Triggering player)) - 1)] to ((Real(PlayerRivive[((Player number of (Triggering player)) - 1)])) + 1.00) seconds
          • Floating Text - Change the fading age of ReviveText[((Player number of (Triggering player)) - 1)] to (Real(PlayerRivive[((Player number of (Triggering player)) - 1)])) seconds
          • Countdown Timer - Start ReviveTimer[((Player number of (Triggering player)) - 1)] as a One-shot timer that will expire in (Real(PlayerRivive[((Player number of (Triggering player)) - 1)])) seconds
        • Else - Actions
just it's work for all player
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,539
Just show your triggers, that will let us know what the problem is, the video doesn't really tell us anything.

And that trigger that I created does work, but it doesn't use timers, so I imagine that's your issue.

Timers Arrays are a pain to use in GUI because you need to create the Timers yourself:
  • Events:
  • Map initialization
  • Actions:
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • Set Variable PN = (Player number of (Picked player))
      • Custom script: set udg_ReviveTimer[udg_PN] = CreateTimer()
The above trigger will create 1 Timer for each player. After doing this you can use these timers in your other triggers.

When referencing global variables in Custom Script you need to type "udg_" before their name. That's why I typed "udg_ReviveTimer[udg_PN]", because both ReviveTimer and PN are global variables and need the "udg_" prefix.
 
Last edited:
Level 24
Joined
Jun 26, 2020
Messages
1,852
for now i use trigger for every player

  • Events
    • Unit - A unit Dies
  • Conditions
    • ((Unit-type of (Dying unit)) is A Hero) Equal to True
  • Actions
  • Player Group - Pick every player in (All players) and 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 (Triggering player)
        • Then - Actions
          • Set PlayerRivive[((Player number of (Triggering player)) - 1)] = (30 + ((((Hero level of (Killing unit)) / 2) + ((Hero level of (Dying unit)) / 2)) + ((Die[1] + Die[2]) + (Die[3] + Die[4]))))
          • Set ReviveHero[((Player number of (Triggering player)) - 1)] = (Triggering unit)
          • Floating Text - Create floating text that reads (String(PlayerRivive[((Player number of (Triggering player)) - 1)])) at ((Position of CircelofPower[((Player number of (Triggering player)) - 1)]) offset by (-25.00, -25.00)) with Z offset 0.00, using font size 25.00, color (0.00%, 100.00%, 0.00%), and 25.00% transparency
          • Set ReviveText[((Player number of (Triggering player)) - 1)] = (Last created floating text)
          • Floating Text - Change ReviveText[((Player number of (Triggering player)) - 1)]: Disable permanence
          • Floating Text - Change the lifespan of ReviveText[((Player number of (Triggering player)) - 1)] to ((Real(PlayerRivive[((Player number of (Triggering player)) - 1)])) + 1.00) seconds
          • Floating Text - Change the fading age of ReviveText[((Player number of (Triggering player)) - 1)] to (Real(PlayerRivive[((Player number of (Triggering player)) - 1)])) seconds
          • Countdown Timer - Start ReviveTimer[((Player number of (Triggering player)) - 1)] as a One-shot timer that will expire in (Real(PlayerRivive[((Player number of (Triggering player)) - 1)])) seconds
        • Else - Actions
just it's work for all player
This is because the condition "Owner of triggering unit equal to Triggering player" always will be true. Again, why are you using a "Pick every player function" if you even not use "Picked player", with this you are doing the same action 16 times (not kidding) previously I shared you a better trigger
@DexterFstone you have a lot of unnecessary stuff in your trigger that @J2Krauser already explained, the trigger would be better like this:
  • Revive Start
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Unit-type of (Dying unit)) is A Hero) Equal to True
    • Actions
      • Set Temp_int = (Player number of (Owner of (Triggering unit))) - 1
      • Set PlayerRivive[Temp_int] = (30 + ((((Hero level of (Killing unit)) / 2) + ((Hero level of (Dying unit)) / 2)) + ((Die[1] + Die[2]) + (Die[3] + Die[4]))))
      • Set ReviveHero[Temp_int] = (Triggering unit)
      • Set Temp_loc = (Position of CircelofPower[Temp_int])
      • Set Temp_loc2 = (Temp_loc offset by (-25.00, -25.00))
      • Floating Text - Create floating text that reads (String(PlayerRivive[Temp_int])) at Temp_loc2 with Z offset 0.00, using font size 25.00, color (100.00%, 0.00%, 0.00%), and 25.00% transparency
      • Custom script: call RemoveLocation(udg_Temp_loc)
      • Custom script: call RemoveLocation(udg_Temp_loc2)
      • Set ReviveText[Temp_int] = (Last created floating text)
      • Floating Text - Change ReviveText[Temp_int]: Disable permanence
      • Floating Text - Change the lifespan of ReviveText[Temp_int] to ((Real(PlayerRivive[Temp_int])) + 1.00) seconds
      • Countdown Timer - Start ReviveTimer[Temp_int] as a One-shot timer that will expire in (Real(PlayerRivive[Temp_int])) seconds
But, why "(Player number of (Owner of (Triggering unit))) - 1"? Why -1? Do you have a reason for that?
PD: The variable "PlayerRivive" is spelled wrong, and the Temp_loc is to prevent memory leak but if the circle is always in the same place you can create a variable of its location in Map Initialization and use it instead of creating and destroying everytime.
Pls share us all the triggers you have related to this.
 
Level 7
Joined
Sep 19, 2020
Messages
190
Just show your triggers, that will let us know what the problem is, the video doesn't really tell us anything.

And that trigger that I created does work, but it doesn't use timers, so I imagine that's your issue.

Timers Arrays are a pain to use in GUI because you need to create the Timers yourself:
  • Events:
  • Map initialization
  • Actions:
  • Player Group - Pick every player in (All players) and do (Actions)
    • Loop - Actions
      • Set Variable PN = (Player number of (Picked player))
      • Custom script: set udg_ReviveTimer[udg_PN] = CreateTimer()
The above trigger will create 1 Timer for each player. After doing this you can use these timers in your other triggers.
I have a timer for 12 player
countdown timer if it's your mean
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,539
I left out some stuff like the Timer Window and Floating Text but this should be a working system that you can use:

Make sure your Timers have an Array Size equal to the number of players:
  • Create Revive Timers
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Set Variable PN = (Player number of (Picked player))
          • Custom script: set udg_ReviveTimer[udg_PN] = CreateTimer()
  • Hero Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Triggering unit) is an illusion) Equal to False
    • Actions
      • -------- Reference PN throughout the trigger: --------
      • Set Variable PN = (Player number of (Owner of (Triggering unit)))
      • Set Variable ReviveHero[PN] = (Triggering unit)
      • Countdown Timer - Start ReviveTimer[PN] as a One-shot timer that will expire in 30.00 seconds
  • Revive Timers
    • Events
      • Time - ReviveTimer[1] expires
      • Time - ReviveTimer[2] expires
      • Time - ReviveTimer[3] expires
      • -------- add all 12 timers to the events --------
    • Conditions
    • Actions
      • Custom script: local integer i = 1
      • Custom script: loop
      • Custom script: exitwhen (i > 12)
      • Custom script: if GetExpiredTimer() == udg_ReviveTimer[i] then
      • Custom script: set udg_PN = i
      • Custom script: set i = 12
      • -------- /////////////////// --------
      • -------- Your Revive Actions go here: --------
      • Hero - Instantly revive ReviveHero[PN] at some point, Show revival graphics
      • -------- /////////////////// --------
      • Custom script: endif
      • Custom script: set i = i + 1
      • Custom script: endloop
PN is set to the Player's Number in each trigger. The Player Number of each player is simple: Red = 1, Blue = 2, Teal = 3, Purple = 4, etc...

Variables:
PN = Integer
ReviveHero = Unit (Array), Size can remain as 1
ReviveTimer = Timer (Array), Size = Total Players
 
Last edited:
Level 7
Joined
Sep 19, 2020
Messages
190
ok first trigger make revive time for all hero and show top on the circle of power

  • Revive Start
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Unit-type of (Dying unit)) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Triggering unit)) Equal to Player 1 (Red)
              • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
              • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
        • Then - Actions
          • Unit Group - Add (Dying unit) to ReviveTeam[0]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
              • (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
              • (Owner of (Triggering unit)) Equal to Player 6 (Orange)
        • Then - Actions
          • Unit Group - Add (Dying unit) to ReviveTeam[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Triggering unit)) Equal to Player 7 (Green)
              • (Owner of (Triggering unit)) Equal to Player 8 (Pink)
              • (Owner of (Triggering unit)) Equal to Player 9 (Gray)
        • Then - Actions
          • Unit Group - Add (Dying unit) to ReviveTeam[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Owner of (Triggering unit)) Equal to Player 10 (Light Blue)
              • (Owner of (Triggering unit)) Equal to Player 11 (Dark Green)
              • (Owner of (Triggering unit)) Equal to Player 12 (Brown)
        • Then - Actions
          • Unit Group - Add (Dying unit) to ReviveTeam[3]
        • Else - Actions
      • Player Group - Pick every player in (All players) and 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 (Triggering player)
            • Then - Actions
              • Set PlayerRivive[((Player number of (Triggering player)) - 1)] = (30 + ((((Hero level of (Killing unit)) / 2) + ((Hero level of (Dying unit)) / 2)) + ((Die[1] + Die[2]) + (Die[3] + Die[4]))))
              • Set ReviveHero[((Player number of (Triggering player)) - 1)] = (Triggering unit)
              • Floating Text - Create floating text that reads (String(PlayerRivive[((Player number of (Triggering player)) - 1)])) at ((Position of CircelofPower[((Player number of (Triggering player)) - 1)]) offset by (-25.00, -25.00)) with Z offset 0.00, using font size 25.00, color (0.00%, 100.00%, 0.00%), and 25.00% transparency
              • Set ReviveText[((Player number of (Triggering player)) - 1)] = (Last created floating text)
              • Floating Text - Change ReviveText[((Player number of (Triggering player)) - 1)]: Disable permanence
              • Floating Text - Change the lifespan of ReviveText[((Player number of (Triggering player)) - 1)] to ((Real(PlayerRivive[((Player number of (Triggering player)) - 1)])) + 1.00) seconds
              • Floating Text - Change the fading age of ReviveText[((Player number of (Triggering player)) - 1)] to (Real(PlayerRivive[((Player number of (Triggering player)) - 1)])) seconds
              • Countdown Timer - Start ReviveTimer[((Player number of (Triggering player)) - 1)] as a One-shot timer that will expire in (Real(PlayerRivive[((Player number of (Triggering player)) - 1)])) seconds
            • Else - Actions
and I have 4 team when all players of team is die timer is stop

The next trigger is a countdown timer for count every sec and changes the text on top of circle of power

  • Revive Loop
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • And - All (Conditions) are true
            • Conditions
              • (ReviveHero[0] is in ReviveTeam[0]) Equal to True
              • (ReviveHero[1] is in ReviveTeam[0]) Equal to True
              • (ReviveHero[2] is in ReviveTeam[0]) Equal to True
        • Then - Actions
          • Countdown Timer - Pause ReviveTimer[0]
          • Floating Text - Change the lifespan of ReviveText[0] to 2.00 seconds
          • Countdown Timer - Pause ReviveTimer[1]
          • Floating Text - Change the lifespan of ReviveText[1] to 2.00 seconds
          • Countdown Timer - Pause ReviveTimer[2]
          • Floating Text - Change the lifespan of ReviveText[2] to 2.00 seconds
        • Else - Actions
          • -------- 1 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerRivive[0] Not equal to 0
            • Then - Actions
              • Set PlayerRivive[0] = (PlayerRivive[0] - 1)
              • Floating Text - Change text of ReviveText[0] to (String(PlayerRivive[0])) using font size 25.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[0] Equal to 10
                • Then - Actions
                  • Floating Text - Change the color of ReviveText[0] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[0] Equal to 9
                • Then - Actions
                  • Floating Text - Change the position of ReviveText[0] to ((Position of CircelofPower[0]) offset by (-15.00, -25.00)) with Z offset 0.00
                • Else - Actions
            • Else - Actions
          • -------- 2 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerRivive[1] Not equal to 0
            • Then - Actions
              • Set PlayerRivive[1] = (PlayerRivive[1] - 1)
              • Floating Text - Change text of ReviveText[1] to (String(PlayerRivive[1])) using font size 25.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[1] Equal to 10
                • Then - Actions
                  • Floating Text - Change the color of ReviveText[1] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[1] Equal to 9
                • Then - Actions
                  • Floating Text - Change the position of ReviveText[1] to ((Position of CircelofPower[1]) offset by (-15.00, -25.00)) with Z offset 0.00
                • Else - Actions
            • Else - Actions
          • -------- 3 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerRivive[2] Not equal to 0
            • Then - Actions
              • Set PlayerRivive[2] = (PlayerRivive[2] - 1)
              • Floating Text - Change text of ReviveText[2] to (String(PlayerRivive[2])) using font size 25.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[2] Equal to 10
                • Then - Actions
                  • Floating Text - Change the color of ReviveText[2] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[2] Equal to 9
                • Then - Actions
                  • Floating Text - Change the position of ReviveText[2] to ((Position of CircelofPower[2]) offset by (-15.00, -25.00)) with Z offset 0.00
                • Else - Actions
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (ReviveHero[3] is in ReviveTeam[1]) Equal to True
          • (ReviveHero[4] is in ReviveTeam[1]) Equal to True
          • (ReviveHero[5] is in ReviveTeam[1]) Equal to True
        • Then - Actions
          • Countdown Timer - Pause ReviveTimer[3]
          • Floating Text - Change the lifespan of ReviveText[3] to 2.00 seconds
          • Countdown Timer - Pause ReviveTimer[4]
          • Floating Text - Change the lifespan of ReviveText[4] to 2.00 seconds
          • Countdown Timer - Pause ReviveTimer[5]
          • Floating Text - Change the lifespan of ReviveText[5] to 2.00 seconds
        • Else - Actions
          • -------- 4 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerRivive[3] Not equal to 0
            • Then - Actions
              • Set PlayerRivive[3] = (PlayerRivive[3] - 1)
              • Floating Text - Change text of ReviveText[3] to (String(PlayerRivive[3])) using font size 25.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[3] Equal to 10
                • Then - Actions
                  • Floating Text - Change the color of ReviveText[3] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[3] Equal to 9
                • Then - Actions
                  • Floating Text - Change the position of ReviveText[3] to ((Position of CircelofPower[3]) offset by (-15.00, -25.00)) with Z offset 0.00
                • Else - Actions
            • Else - Actions
          • -------- 5 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerRivive[4] Not equal to 0
            • Then - Actions
              • Set PlayerRivive[4] = (PlayerRivive[4] - 1)
              • Floating Text - Change text of ReviveText[4] to (String(PlayerRivive[4])) using font size 25.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[4] Equal to 10
                • Then - Actions
                  • Floating Text - Change the color of ReviveText[4] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[4] Equal to 9
                • Then - Actions
                  • Floating Text - Change the position of ReviveText[4] to ((Position of CircelofPower[4]) offset by (-15.00, -25.00)) with Z offset 0.00
                • Else - Actions
            • Else - Actions
          • -------- 6 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerRivive[5] Not equal to 0
            • Then - Actions
              • Set PlayerRivive[5] = (PlayerRivive[5] - 1)
              • Floating Text - Change text of ReviveText[5] to (String(PlayerRivive[5])) using font size 25.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[5] Equal to 10
                • Then - Actions
                  • Floating Text - Change the color of ReviveText[5] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[5] Equal to 9
                • Then - Actions
                  • Floating Text - Change the position of ReviveText[5] to ((Position of CircelofPower[5]) offset by (-15.00, -25.00)) with Z offset 0.00
                • Else - Actions
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (ReviveHero[6] is in ReviveTeam[2]) Equal to True
          • (ReviveHero[7] is in ReviveTeam[2]) Equal to True
          • (ReviveHero[8] is in ReviveTeam[2]) Equal to True
        • Then - Actions
          • Countdown Timer - Pause ReviveTimer[6]
          • Floating Text - Change the lifespan of ReviveText[6] to 2.00 seconds
          • Countdown Timer - Pause ReviveTimer[7]
          • Floating Text - Change the lifespan of ReviveText[7] to 2.00 seconds
          • Countdown Timer - Pause ReviveTimer[8]
          • Floating Text - Change the lifespan of ReviveText[8] to 2.00 seconds
        • Else - Actions
          • -------- 7 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerRivive[6] Not equal to 0
            • Then - Actions
              • Set PlayerRivive[6] = (PlayerRivive[6] - 1)
              • Floating Text - Change text of ReviveText[6] to (String(PlayerRivive[6])) using font size 25.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[6] Equal to 10
                • Then - Actions
                  • Floating Text - Change the color of ReviveText[6] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[6] Equal to 9
                • Then - Actions
                  • Floating Text - Change the position of ReviveText[6] to ((Position of CircelofPower[6]) offset by (-15.00, -25.00)) with Z offset 0.00
                • Else - Actions
            • Else - Actions
          • -------- 8 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerRivive[7] Not equal to 0
            • Then - Actions
              • Set PlayerRivive[7] = (PlayerRivive[7] - 1)
              • Floating Text - Change text of ReviveText[7] to (String(PlayerRivive[7])) using font size 25.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[7] Equal to 10
                • Then - Actions
                  • Floating Text - Change the color of ReviveText[7] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[7] Equal to 9
                • Then - Actions
                  • Floating Text - Change the position of ReviveText[7] to ((Position of CircelofPower[7]) offset by (-15.00, -25.00)) with Z offset 0.00
                • Else - Actions
            • Else - Actions
          • -------- 9 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerRivive[8] Not equal to 0
            • Then - Actions
              • Set PlayerRivive[8] = (PlayerRivive[8] - 1)
              • Floating Text - Change text of ReviveText[8] to (String(PlayerRivive[8])) using font size 25.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[8] Equal to 10
                • Then - Actions
                  • Floating Text - Change the color of ReviveText[8] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[8] Equal to 9
                • Then - Actions
                  • Floating Text - Change the position of ReviveText[8] to ((Position of CircelofPower[8]) offset by (-15.00, -25.00)) with Z offset 0.00
                • Else - Actions
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (ReviveHero[9] is in ReviveTeam[3]) Equal to True
          • (ReviveHero[10] is in ReviveTeam[3]) Equal to True
          • (ReviveHero[11] is in ReviveTeam[3]) Equal to True
        • Then - Actions
          • Countdown Timer - Pause ReviveTimer[9]
          • Floating Text - Change the lifespan of ReviveText[9] to 2.00 seconds
          • Countdown Timer - Pause ReviveTimer[10]
          • Floating Text - Change the lifespan of ReviveText[10] to 2.00 seconds
          • Countdown Timer - Pause ReviveTimer[11]
          • Floating Text - Change the lifespan of ReviveText[11] to 2.00 seconds
        • Else - Actions
          • -------- 10 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerRivive[9] Not equal to 0
            • Then - Actions
              • Set PlayerRivive[9] = (PlayerRivive[9] - 1)
              • Floating Text - Change text of ReviveText[9] to (String(PlayerRivive[9])) using font size 25.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[9] Equal to 10
                • Then - Actions
                  • Floating Text - Change the color of ReviveText[9] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[9] Equal to 9
                • Then - Actions
                  • Floating Text - Change the position of ReviveText[9] to ((Position of CircelofPower[9]) offset by (-15.00, -25.00)) with Z offset 0.00
                • Else - Actions
            • Else - Actions
          • -------- 11 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerRivive[10] Not equal to 0
            • Then - Actions
              • Set PlayerRivive[10] = (PlayerRivive[10] - 1)
              • Floating Text - Change text of ReviveText[10] to (String(PlayerRivive[10])) using font size 25.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[10] Equal to 10
                • Then - Actions
                  • Floating Text - Change the color of ReviveText[10] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[10] Equal to 9
                • Then - Actions
                  • Floating Text - Change the position of ReviveText[10] to ((Position of CircelofPower[10]) offset by (-15.00, -25.00)) with Z offset 0.00
                • Else - Actions
            • Else - Actions
          • -------- 12 --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • PlayerRivive[11] Not equal to 0
            • Then - Actions
              • Set PlayerRivive[11] = (PlayerRivive[11] - 1)
              • Floating Text - Change text of ReviveText[11] to (String(PlayerRivive[11])) using font size 25.00
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[11] Equal to 10
                • Then - Actions
                  • Floating Text - Change the color of ReviveText[11] to (100.00%, 0.00%, 0.00%) with 25.00% transparency
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • PlayerRivive[11] Equal to 9
                • Then - Actions
                  • Floating Text - Change the position of ReviveText[11] to ((Position of CircelofPower[11]) offset by (-15.00, -25.00)) with Z offset 0.00
                • Else - Actions
            • Else - Actions
and the last trigger is for timer finish
  • Revive End
    • Events
      • Time - ReviveTimer[0] expires
      • Time - ReviveTimer[1] expires
      • Time - ReviveTimer[2] expires
      • Time - ReviveTimer[3] expires
      • Time - ReviveTimer[4] expires
      • Time - ReviveTimer[5] expires
      • Time - ReviveTimer[6] expires
      • Time - ReviveTimer[7] expires
      • Time - ReviveTimer[8] expires
      • Time - ReviveTimer[9] expires
      • Time - ReviveTimer[10] expires
      • Time - ReviveTimer[11] expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[0] Equal to 0
        • Then - Actions
          • Hero - Instantly revive ReviveHero[0] at (Center of ReviveRegion[0]), Show revival graphics
          • Unit Group - Remove (Random unit from (Units owned by Player 1 (Red))) from ReviveTeam[0]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[1] Equal to 0
        • Then - Actions
          • Hero - Instantly revive ReviveHero[1] at (Center of ReviveRegion[1]), Show revival graphics
          • Unit Group - Remove (Random unit from (Units owned by Player 2 (Blue))) from ReviveTeam[0]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[2] Equal to 0
        • Then - Actions
          • Hero - Instantly revive ReviveHero[2] at (Center of ReviveRegion[2]), Show revival graphics
          • Unit Group - Remove (Random unit from (Units owned by Player 3 (Teal))) from ReviveTeam[0]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[3] Equal to 0
        • Then - Actions
          • Hero - Instantly revive ReviveHero[3] at (Center of ReviveRegion[3]), Show revival graphics
          • Unit Group - Remove (Random unit from (Units owned by Player 4 (Purple))) from ReviveTeam[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[4] Equal to 0
        • Then - Actions
          • Hero - Instantly revive ReviveHero[4] at (Center of ReviveRegion[4]), Show revival graphics
          • Unit Group - Remove (Random unit from (Units owned by Player 5 (Yellow))) from ReviveTeam[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[5] Equal to 0
        • Then - Actions
          • Hero - Instantly revive ReviveHero[5] at (Center of ReviveRegion[5]), Show revival graphics
          • Unit Group - Remove (Random unit from (Units owned by Player 6 (Orange))) from ReviveTeam[1]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[6] Equal to 0
        • Then - Actions
          • Hero - Instantly revive ReviveHero[6] at (Center of ReviveRegion[6]), Show revival graphics
          • Unit Group - Remove (Random unit from (Units owned by Player 7 (Green))) from ReviveTeam[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[7] Equal to 0
        • Then - Actions
          • Hero - Instantly revive ReviveHero[7] at (Center of ReviveRegion[7]), Show revival graphics
          • Unit Group - Remove (Random unit from (Units owned by Player 8 (Pink))) from ReviveTeam[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[8] Equal to 0
        • Then - Actions
          • Hero - Instantly revive ReviveHero[8] at (Center of ReviveRegion[8]), Show revival graphics
          • Unit Group - Remove (Random unit from (Units owned by Player 9 (Gray))) from ReviveTeam[2]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[9] Equal to 0
        • Then - Actions
          • Hero - Instantly revive ReviveHero[9] at (Center of ReviveRegion[9]), Show revival graphics
          • Unit Group - Remove (Random unit from (Units owned by Player 10 (Light Blue))) from ReviveTeam[3]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[10] Equal to 0
        • Then - Actions
          • Hero - Instantly revive ReviveHero[10] at (Center of ReviveRegion[10]), Show revival graphics
          • Unit Group - Remove (Random unit from (Units owned by Player 11 (Dark Green))) from ReviveTeam[3]
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • PlayerRivive[11] Equal to 0
        • Then - Actions
          • Hero - Instantly revive ReviveHero[11] at (Center of ReviveRegion[11]), Show revival graphics
          • Unit Group - Remove (Random unit from (Units owned by Player 12 (Brown))) from ReviveTeam[3]
        • Else - Actions
if all of the triggers make by Pick Player Group it's better but I try but it's not work
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,539
Like Herly said, you're referencing Triggering Player in your first trigger when you need to reference Picked player:

  • (Owner of (Triggering unit)) Equal to (Triggering player)
^That should be:
  • (Owner of (Triggering unit)) Equal to (Picked player)
Replace ALL instances of Triggering player with Picked player:
  • Set PlayerRivive[((Player number of (Picked player)) - 1)]
And I recommend using an Integer variable to make your life easier:
  • Set PN = (Player number of Picked player - 1)
  • Set PlayerRivive[PN] = (30 + ((((Hero level of (Killing unit)) / 2) + ((Hero level of (Dying unit)) / 2)) + ((Die[1] + Die[2]) + (Die[3] + Die[4]))))
  • Set ReviveHero[PN] = (Triggering unit)
When you use "Pick every player in..." you need to use Picked player to reference the player that is picked. Triggering player is the player that was involved in the Event, in this case it's the Owner of the Event unit -> A unit dies.

So if Player 2's Hero dies, Triggering Player will be set to Player 2.
So when you Pick every player in All Players and run the Actions, your Actions are referencing Player 2 the entire time because Player 2 is the Triggering Player.
 
Last edited:
Level 7
Joined
Sep 19, 2020
Messages
190
Like Herly said, you're referencing Triggering Player in your first trigger when you need to reference Picked player:

  • (Owner of (Triggering unit)) Equal to (Triggering player)
^That should be:
  • (Owner of (Triggering unit)) Equal to (Picked player)
Replace ALL instances of Triggering player with Picked player:
  • Set PlayerRivive[((Player number of (Picked player)) - 1)]
And I recommend using an Integer variable to make your life easier:
  • Set PN = (Player number of Picked player - 1)
  • Set PlayerRivive[PN] = (30 + ((((Hero level of (Killing unit)) / 2) + ((Hero level of (Dying unit)) / 2)) + ((Die[1] + Die[2]) + (Die[3] + Die[4]))))
  • Set ReviveHero[PN] = (Triggering unit)
When you use "Pick every player in..." you need to use Picked player to reference the player that is picked. Triggering player is the player that was involved in the Event, in this case it's the Owner of the Event unit -> A unit dies.

So if Player 2's Hero dies, Triggering Player will be set to Player 2.
So when you Pick every player in All Players and run the Actions, your Actions are referencing Player 2 the entire time because Player 2 is the Triggering Player.
Triggering Player is work why to need to change?, for the first time I use Picked player but is not work then use the matching player and try all but only Triggering Player is work for first trigger
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
Triggering Player is work why to need to change?, for the first time I use Picked player but is not work then use the matching player and try all but only Triggering Player is work for first trigger
Because with that you are repeating the same action 16 times (not kidding), just not use "Pick every player" I passed you how your trigger be like before.
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
A trigger is work but not by a picked player, only work by Triggering Player
I told you, don't use "Pick every player in..."
  • Revive Start
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Unit-type of (Dying unit)) is A Hero) Equal to True
    • Actions
      • Set Temp_int = (Player number of (Owner of (Triggering unit))) - 1
      • Set PlayerRivive[Temp_int] = (30 + ((((Hero level of (Killing unit)) / 2) + ((Hero level of (Dying unit)) / 2)) + ((Die[1] + Die[2]) + (Die[3] + Die[4]))))
      • Set ReviveHero[Temp_int] = (Triggering unit)
      • Set Temp_loc = (Position of CircelofPower[Temp_int])
      • Set Temp_loc2 = (Temp_loc offset by (-25.00, -25.00))
      • Floating Text - Create floating text that reads (String(PlayerRivive[Temp_int])) at Temp_loc2 with Z offset 0.00, using font size 25.00, color (100.00%, 0.00%, 0.00%), and 25.00% transparency
      • Custom script: call RemoveLocation(udg_Temp_loc)
      • Custom script: call RemoveLocation(udg_Temp_loc2)
      • Set ReviveText[Temp_int] = (Last created floating text)
      • Floating Text - Change ReviveText[Temp_int]: Disable permanence
      • Floating Text - Change the lifespan of ReviveText[Temp_int] to ((Real(PlayerRivive[Temp_int])) + 1.00) seconds
      • Countdown Timer - Start ReviveTimer[Temp_int] as a One-shot timer that will expire in (Real(PlayerRivive[Temp_int])) seconds
 
Status
Not open for further replies.
Top