• 🏆 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] Respawn using multiboard issues

Status
Not open for further replies.
Level 8
Joined
Apr 23, 2010
Messages
312
I'm trying to show on the multiboard if the defined hero is alive, to say "Alive" under the respawn portion of the board and if it's dead to show the amount of waiting time before it's respawned. The problem is, after a hero is selected for play, the entire respawn section is replaced saying "Alive" in each column when it should be just on the rows with player names.

Below is close to what the board should look like (this is also before a hero is chosen).
Multiboard_1.jpg


After a hero is picked the board becomes what you see below, not exactly what i'm looking for.
Multiboard_2.jpg


This last image below only shows for a split second after the hero has died, showing the waiting time and then returning to the previous image above.
Multiboard_3.jpg


Here is the trigger I used to create the multiboard. Everything else works the way it's intended.
  • Create the Multiboard
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Set MultiBoard_Players = (Number of players in (All players matching (((Matching player) slot status) Equal to Is playing)))
      • Multiboard - Create a multiboard with 4 columns and (MultiBoard_Players + 2) rows, titled Statistics
      • Set MultiBoard = (Last created multiboard)
      • Multiboard - Set the text for (Last created multiboard) item in column 1, row 1 to Player
      • Multiboard - Set the text for (Last created multiboard) item in column 2, row 1 to Kills
      • Multiboard - Set the text for (Last created multiboard) item in column 3, row 1 to Deaths
      • Multiboard - Set the text for (Last created multiboard) item in column 4, row 1 to Respawn
      • For each (Integer A) from 1 to (MultiBoard_Players + 2), do (Actions)
        • Loop - Actions
          • Multiboard - Set the display style for (Last created multiboard) item in column 1, row (Integer A) to Show text and Hide icons
          • Multiboard - Set the display style for (Last created multiboard) item in column 2, row (Integer A) to Show text and Hide icons
          • Multiboard - Set the display style for (Last created multiboard) item in column 3, row (Integer A) to Show text and Hide icons
          • Multiboard - Set the display style for (Last created multiboard) item in column 4, row (Integer A) to Show text and Hide icons
          • Multiboard - Set the width for (Last created multiboard) item in column 1, row (Integer A) to 10.00% of the total screen width
          • Multiboard - Set the width for (Last created multiboard) item in column 2, row (Integer A) to 5.00% of the total screen width
          • Multiboard - Set the width for (Last created multiboard) item in column 3, row (Integer A) to 5.00% of the total screen width
          • Multiboard - Set the width for (Last created multiboard) item in column 4, row (Integer A) to 5.00% of the total screen width
      • Multiboard - Set the display style for (Last created multiboard) item in column 1, row 1 to Show text and Hide icons
      • Set List = 3
      • Player Group - Pick every player in Forces[1] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) slot status) Equal to Is playing
              • And - All (Conditions) are true
                • Conditions
                  • (Picked player) Not equal to Player 10 (Light Blue)
                  • (Picked player) Not equal to Player 11 (Dark Green)
            • Then - Actions
              • Set Multiboard_Spots[(Player number of (Picked player))] = List
              • Multiboard - Set the text for (Last created multiboard) item in column 1, row List to (Color_Text[(Player number of (Picked player))] + ((Name of (Picked player)) + |r))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked player) is an ally of Player 10 (Light Blue)) Equal to True
                • Then - Actions
                  • Multiboard - Set the icon for (Last created multiboard) item in column 1, row List to ReplaceableTextures\CommandButtons\BTNPeasant.blp
                  • Multiboard - Set the display style for (Last created multiboard) item in column 1, row List to Show text and Show icons
                • Else - Actions
                  • Multiboard - Set the icon for (Last created multiboard) item in column 1, row List to ReplaceableTextures\CommandButtons\BTNPeon.blp
                  • Multiboard - Set the display style for (Last created multiboard) item in column 1, row List to Show text and Show icons
              • Multiboard - Set the text for (Last created multiboard) item in column 2, row List to 0
              • Multiboard - Set the text for (Last created multiboard) item in column 3, row List to 0
              • Set List = (List + 1)
            • Else - Actions
      • Multiboard - Show (Last created multiboard)
      • Multiboard - Maximize (Last created multiboard)
This is for when a hero dies, everything is prepared for the revival trigger.
  • Set Revival
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set temp_point = (Position of (Triggering unit))
      • Special Effect - Create a special effect at temp_point using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Custom script: call RemoveLocation(udg_temp_point)
      • Set R_PlayerNumber = (Player number of (Owner of (Triggering unit)))
      • Set R_Wait[R_PlayerNumber] = (((Hero level of (Triggering unit)) x 2) + 8)
      • Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[R_PlayerNumber] to (|cffFF0000 + (String(R_Wait[R_PlayerNumber])))
      • Set Revive_Instances = (Revive_Instances + 1)
      • Trigger - Turn on Revive <gen>
Last but not least, the evil trigger that doesn't want to cooperate. It does wait the set amount of time before the hero is respawned, though it doesn't count down in the multiboard. R_Unit is defined in a different trigger, when the hero is selected for play.
  • Revive
    • 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
          • Revive_Instances Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
      • For each (Integer R_MUI) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (R_Unit[R_MUI] is dead) Equal to True
                  • R_Wait[R_MUI] Less than or equal to 0
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player(R_MUI)) is an ally of Player 10 (Light Blue)) Equal to True
                • Then - Actions
                  • Set temp_point = (Random point in Humans <gen>)
                • Else - Actions
                  • Set temp_point = (Random point in Orcs <gen>)
              • Hero - Instantly revive R_Unit[R_MUI] at temp_point, Hide revival graphics
              • Unit - Set life of R_Unit[R_MUI] to ((Max life of R_Unit[R_MUI]) x 0.25)
              • Unit - Set mana of R_Unit[R_MUI] to ((Max mana of R_Unit[R_MUI]) x 0.25)
              • Selection - Select R_Unit[R_MUI] for (Player(R_MUI))
              • Camera - Pan camera for (Owner of R_Unit[R_MUI]) to temp_point over 0.50 seconds
              • Special Effect - Create a special effect at temp_point using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation(udg_temp_point)
              • Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[R_MUI] to |cff00FF00Alive
              • Set Revive_Instances = (Revive_Instances - 1)
            • Else - Actions
              • Set R_Wait[R_MUI] = (R_Wait[R_MUI] - 1)
              • Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[R_MUI] to (|cffFF0000 + (String(R_Wait[R_PlayerNumber])))
Any help is appreciated, I've been banging my head against the wall trying to figure out why this wont work correctly.
 
Level 8
Joined
Apr 23, 2010
Messages
312
Hmm.. I see what you're saying but I don't think that's the issue, could be wrong though. I believe it does select a specific row here.
  • Archmage
    • Events
      • Unit - A unit enters HuArchmage <gen>
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Spirit
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Archmage 0055 <gen> is alive) Equal to True
        • Then - Actions
          • Unit - Explode (Triggering unit)
          • Unit - Kill Archmage 0055 <gen>
          • Set temp_point = (Random point in Humans <gen>)
          • Set temp_point_2 = (Center of HuArchmage <gen>)
          • Special Effect - Create a special effect at temp_point_2 using Environment\NightElfBuildingFire\ElfLargeBuildingFire1.mdl
          • Unit - Create 1 Archmage for (Owner of (Triggering unit)) at temp_point facing temp_point
          • Set R_PlayerNumber = (Player number of (Owner of (Triggering unit)))
          • Set R_Unit[R_PlayerNumber] = (Last created unit)
          • Unit Group - Add R_Unit[R_PlayerNumber] to Heroes
          • Camera - Pan camera for (Owner of (Triggering unit)) to temp_point over 0.00 seconds
          • Selection - Select (Last created unit) for (Owner of (Triggering unit))
          • Multiboard - Set the icon for (Last created multiboard) item in column 1, row Multiboard_Spots[R_PlayerNumber] to ReplaceableTextures\CommandButtons\BTNHeroArchMage.blp
          • Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[R_PlayerNumber] to |cff00FF00Alive
        • Else - Actions
          • Unit - Move (Triggering unit) instantly to (Center of HumanSelectionSpawn <gen>)
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: That Hero has alrea...
 
Level 8
Joined
Apr 23, 2010
Messages
312
Disabling the set text line didn't change anything. Changing that to 'larger than 0' would just cycle everything that is supposed to happen when the hero is being revived, tried that before haha

I've got to go to work so I'll check back later. Here's the map with all the triggers on it if you want to play around yourself and see what's going on. Thanks for all the help so far Wietlol! Also, sorry for my terrible trigger structure.

CommanderZ
 
Level 24
Joined
Aug 1, 2013
Messages
4,657
Yea, you might want to rewrite this feature of yours.

First of all, when you select a hero, you kill the Neutral hero that is standing in that position.
Because of this, your "Set Revival" runs for that hero and finds that Multiboard_Spots of player 16 is 0.
You can see that the entire fourth column will now be -10.

However, that is not everything:
First of all, you use the fourth column for two things:
1, Respawn timer.
2, Hero Level.

Having two values in one field is definately possible but not how it is done in the map.

Last but not least,
  • For each (Integer R_MUI) from 1 to 6, do (Actions)
Are you sure you dont want to loop for each player that is playing instead of for each integer between ... and ... ?
 
Level 8
Joined
Apr 23, 2010
Messages
312
Oh wow, I thought I removed everything for hero leveling. I'll change that, also yes I'm planning on changing the loop later, wanted to fix this issue first. Ok cool I'll iron out those issues and see if that helps, thanks.
 
Last edited:
Level 8
Joined
Apr 23, 2010
Messages
312
It's fixed for the most part, following what you said Wietlol. Now it just doesn't work for multiple players, and sometimes it moves the camera even after the hero has been revived.

Here is the updated triggers.
  • Set Revival
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Owner of (Triggering unit)) Not equal to Neutral Passive
    • Actions
      • Set temp_point = (Position of (Triggering unit))
      • Special Effect - Create a special effect at temp_point using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Custom script: call RemoveLocation(udg_temp_point)
      • Set R_PlayerNumber = (Player number of (Owner of (Triggering unit)))
      • Set R_Wait[R_PlayerNumber] = (((Hero level of (Triggering unit)) x 2) + 8)
      • Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[R_PlayerNumber] to (|cffFF0000 + (String(R_Wait[R_PlayerNumber])))
      • Set Revive_Instances = (Revive_Instances + 1)
      • Trigger - Turn on Revive <gen>
  • Revive
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer R_MUI) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (R_Unit[R_MUI] is dead) Equal to True
              • R_Wait[R_MUI] Greater than 0
            • Then - Actions
              • Set R_Wait[R_MUI] = (R_Wait[R_MUI] - 1)
              • Multiboard - Set the text for MultiBoard item in column 4, row Multiboard_Spots[R_MUI] to (|cffFF0000 + (String(R_Wait[R_MUI])))
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Player(R_MUI)) is an ally of Player 10 (Light Blue)) Equal to True
                • Then - Actions
                  • Set temp_point = (Random point in Humans <gen>)
                • Else - Actions
                  • Set temp_point = (Random point in Orcs <gen>)
              • Hero - Instantly revive R_Unit[R_MUI] at temp_point, Hide revival graphics
              • Unit - Set life of R_Unit[R_MUI] to ((Max life of R_Unit[R_MUI]) x 0.25)
              • Unit - Set mana of R_Unit[R_MUI] to ((Max mana of R_Unit[R_MUI]) x 0.25)
              • Selection - Select R_Unit[R_MUI] for (Player(R_MUI))
              • Camera - Pan camera for (Owner of R_Unit[R_MUI]) to temp_point over 0.50 seconds
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (R_Unit[R_MUI] is alive) Equal to True
                • Then - Actions
                  • Special Effect - Create a special effect at temp_point using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Custom script: call RemoveLocation(udg_temp_point)
                  • Set R_PlayerNumber = (Player number of (Owner of R_Unit[R_MUI]))
                  • Multiboard - Set the text for MultiBoard item in column 4, row Multiboard_Spots[R_PlayerNumber] to |cff00FF00Alive
                  • Set Revive_Instances = (Revive_Instances - 1)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Revive_Instances Less than or equal to 0
                • Then - Actions
                  • Set Revive_Instances = 0
                  • Trigger - Turn off (This trigger)
                • Else - Actions
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
Where are you setting R_Unit to? You reference it in your loop, but I don't see it in the Set Revival trigger.

I also see these as a problem:
  • ((Player(R_MUI)) is an ally of Player 10 (Light Blue)) Equal to True
  • Selection - Select R_Unit[R_MUI] for (Player(R_MUI))

You can't change a player's index. Player 1 will always be index 1 and player 2 will always be index 2. You can't just suddenly change them in a loop. Here's my recommended approach:

  • Hero Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set indexMax = (indexMax + 1)
      • Set Hero[indexMax] = (Triggering unit)
      • Set Player[indexMax] = (Owner of Hero[indexMax])
      • Set playerNumber[indexMax] = (Player number of Player[indexMax])
      • Set Counter[indexMax] = (((Hero level of Hero[indexMax]) x 2) + 8)
      • -------- change multiboard item --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • indexMax Equal to 1
        • Then - Actions
          • Trigger - Turn on Revive Timer <gen>
        • Else - Actions
  • Revive Timer
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer indexCurrent) from 1 to indexMax, do (Actions)
        • Loop - Actions
          • Set Counter[indexCurrent] = (Counter[indexCurrent] - 1)
          • -------- change multiboard item --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Counter[indexCurrent] Less than or equal to 0
            • Then - Actions
              • -------- revive hero stuff --------
              • -------- pan to hero --------
              • -------- change multiboard item --------
              • Set Hero[indexCurrent] = Hero[indexMax]
              • Set Player[indexCurrent] = Player[indexMax]
              • Set playerNumber[indexCurrent] = (Player number of Player[indexMax])
              • Set Counter[indexCurrent] = Counter[indexMax]
              • Set indexMax = (indexMax - 1)
              • Set indexCurrent = (indexCurrent - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • indexMax Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions
 
Level 8
Joined
Apr 23, 2010
Messages
312
Where are you setting R_Unit to? You reference it in your loop, but I don't see it in the Set Revival trigger.

I also see these as a problem:
  • ((Player(R_MUI)) is an ally of Player 10 (Light Blue)) Equal to True
  • Selection - Select R_Unit[R_MUI] for (Player(R_MUI))

You can't change a player's index. Player 1 will always be index 1 and player 2 will always be index 2. You can't just suddenly change them in a loop. Here's my recommended approach:

  • Hero Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
    • Actions
      • Set indexMax = (indexMax + 1)
      • Set Hero[indexMax] = (Triggering unit)
      • Set Player[indexMax] = (Owner of Hero[indexMax])
      • Set playerNumber[indexMax] = (Player number of Player[indexMax])
      • Set Counter[indexMax] = (((Hero level of Hero[indexMax]) x 2) + 8)
      • -------- change multiboard item --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • indexMax Equal to 1
        • Then - Actions
          • Trigger - Turn on Revive Timer <gen>
        • Else - Actions
  • Revive Timer
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer indexCurrent) from 1 to indexMax, do (Actions)
        • Loop - Actions
          • Set Counter[indexCurrent] = (Counter[indexCurrent] - 1)
          • -------- change multiboard item --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Counter[indexCurrent] Less than or equal to 0
            • Then - Actions
              • -------- revive hero stuff --------
              • -------- pan to hero --------
              • -------- change multiboard item --------
              • Set Hero[indexCurrent] = Hero[indexMax]
              • Set Player[indexCurrent] = Player[indexMax]
              • Set playerNumber[indexCurrent] = (Player number of Player[indexMax])
              • Set Counter[indexCurrent] = Counter[indexMax]
              • Set indexMax = (indexMax - 1)
              • Set indexCurrent = (indexCurrent - 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • indexMax Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions

R_Unit is set to every hero when it's selected for play in a different trigger, with the players number who selected it. I referenced it in an earlier reply.

I don't see how i'm trying to change the players index, that's just calling the player so it doesn't have everyone select the same unit. Could be wrong though, it's been a while since I tried any triggering.

I'll try out your suggestions, thanks.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
R_Unit is set to every hero when it's selected for play in a different trigger, with the players number who selected it. I referenced it in an earlier reply.

Sorry I didn't look at the other posts. I just looked at the most recent.

I don't see how i'm trying to change the players index, that's just calling the player so it doesn't have everyone select the same unit. Could be wrong though, it's been a while since I tried any triggering.

I was talking about (Player(R_MUI). Imagine player 2's hero died and is the first iteration of the loop. R_MUI will be 1, even though player 2's index is 2. In theory, it would select player 2's hero for player 1 when it revives.
 
Level 8
Joined
Apr 23, 2010
Messages
312
@KILLCIDE,

Alright I finally got around to doing this and it works now. Thanks for the help! Here's the working triggers, and +rep.

  • Set Revival
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • (Owner of (Triggering unit)) Not equal to Neutral Passive
    • Actions
      • Set R_Index = (R_Index + 1)
      • Set R_Hero[R_Index] = (Triggering unit)
      • Set R_Player[R_Index] = (Owner of (Triggering unit))
      • Set R_PN[R_Index] = (Player number of (Owner of (Triggering unit)))
      • Set R_Wait[R_Index] = (((Hero level of (Triggering unit)) x 2) + 8)
      • Set temp_point = (Position of (Triggering unit))
      • Special Effect - Create a special effect at temp_point using Abilities\Spells\Human\MarkOfChaos\MarkOfChaosTarget.mdl
      • Custom script: call RemoveLocation(udg_temp_point)
      • Multiboard - Set the text for (Last created multiboard) item in column 4, row Multiboard_Spots[R_PN[R_Index]] to (|cffFF0000 + (String(R_Wait[R_PN[R_Index]])))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • R_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Revive <gen>
        • Else - Actions
  • Revive
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • For each (Integer R_IndexCurrent) from 1 to R_Index, do (Actions)
        • Loop - Actions
          • Set R_Wait[R_IndexCurrent] = (R_Wait[R_IndexCurrent] - 1)
          • Multiboard - Set the text for MultiBoard item in column 4, row Multiboard_Spots[R_PN[R_IndexCurrent]] to (|cffFF0000 + (String(R_Wait[R_IndexCurrent])))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (R_Hero[R_IndexCurrent] is dead) Equal to True
              • R_Wait[R_IndexCurrent] Less than or equal to 0
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (R_Player[R_IndexCurrent] is an ally of Player 10 (Light Blue)) Equal to True
                • Then - Actions
                  • Set temp_point = (Random point in Humans <gen>)
                • Else - Actions
                  • Set temp_point = (Random point in Orcs <gen>)
              • Hero - Instantly revive R_Hero[R_IndexCurrent] at temp_point, Hide revival graphics
              • Unit - Set life of R_Hero[R_IndexCurrent] to ((Max life of R_Hero[R_IndexCurrent]) x 0.25)
              • Unit - Set mana of R_Hero[R_IndexCurrent] to ((Max mana of R_Hero[R_IndexCurrent]) x 0.25)
              • Selection - Select R_Hero[R_IndexCurrent] for R_Player[R_IndexCurrent]
              • Camera - Pan camera for (Owner of R_Hero[R_IndexCurrent]) to temp_point over 0.50 seconds
              • Special Effect - Create a special effect at temp_point using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • Custom script: call RemoveLocation(udg_temp_point)
              • Multiboard - Set the text for MultiBoard item in column 4, row Multiboard_Spots[R_PN[R_IndexCurrent]] to |cff00FF00Alive
              • Set R_Hero[R_IndexCurrent] = R_Hero[R_Index]
              • Set R_Player[R_IndexCurrent] = R_Player[R_Index]
              • Set R_PN[R_IndexCurrent] = R_PN[R_Index]
              • Set R_Wait[R_IndexCurrent] = R_Wait[R_Index]
              • Set R_Index = (R_Index - 1)
              • Set R_IndexCurrent = (R_IndexCurrent - 1)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • R_Index Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
 
Level 8
Joined
Apr 23, 2010
Messages
312
Glad to hear it worked. However, you don't need this condition in the loop. The hero will always be dead during the loop.

  • (R_Hero[R_IndexCurrent] is dead) Equal to True

I'd also replace all the triggering units with R_Hero. You made that variable for a reason xD

Ha true, i also had an R_Index variable that I wasn't using before. Does it run faster if it's set to R_Hero rather than triggering unit? Always thought it was about the same speed.

I can create this for you, though I only work in vjass when it comes to systems these days. Is that fine with you?

Feel free to make this in vJass if you want to, I just wanted it in GUI since I never learned vJass or jass.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
Ha true, i also had an R_Index variable that I wasn't using before. Does it run faster if it's set to R_Hero rather than triggering unit? Always thought it was about the same speed.

Yes it does. One set of parentheses means one function call. So if you have something like "Set R_Player[R_Index] = (Owner of (Triggering unit))," that means there are two function calls. The less parentheses, the better! In my opinion, they also look a lot cleaner.

  • Set R_Player[R_Index] = (Owner of (Triggering unit))
  • Set R_Player[R_Index] = (Owner of R_Hero[R_Index])
 
Status
Not open for further replies.
Top