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

[Solved] Player indexing

Status
Not open for further replies.
Level 9
Joined
Dec 16, 2017
Messages
343
Hello guys, i am storing into a variable the heroes created in the choosing trigger and also the players of the heroes, because i need to use them again at the end of the game for some cinematics and teleports, but for some reason it takes just the first picked hero and player, not all of them, how can i fix this?
If i use numbers from 1 to 5(i have only 5 players), it doesn't do anything in game, the cinematics run without a hero portrait or player name.

I use 1.28.5 Wc3 Patch

This is the hero picking trigger:
  • Hero Selection
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • For each (Integer IntA) from 1 to 47, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Sold unit)) Equal to HeroType[IntA]
            • Then - Actions
              • Set BuyingU = (Buying unit)
              • Set SoldU = (Sold unit)
              • Set HeroSpawn = (Center of RegionHeroSpawn <gen>)
              • Set MaxPlayers = (Number of players in (All players))
              • Set PlayerInteger = (Player number of (Owner of (Buying unit)))
              • Set Player[PlayerInteger] = (Owner of (Buying unit))
              • Set Hero[PlayerInteger] = (Sold unit)
              • Unit Group - Add Hero[PlayerInteger] to ArenaHeroes
              • Unit - Explode BuyingU
              • Unit - Move SoldU instantly to HeroSpawn
              • Camera - Pan camera for (Owner of SoldU) to HeroSpawn over 0.05 seconds
              • Selection - Select SoldU for (Owner of SoldU)
              • Unit - Make SoldU face 270.00 over 0.00 seconds
              • Special Effect - Create a special effect at (Position of SoldU) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • For each (Integer IntB) from 1 to 47, do (Actions)
                • Loop - Actions
                  • For each (Integer CurrentPlayer) from 1 to MaxPlayers, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • HeroClass[IntA] Equal to HeroClass[IntB]
                        • Then - Actions
                          • Player - Make HeroType[IntB] Unavailable for training/construction by (Player(CurrentPlayer))
                          • Unit - Change ownership of ClassHall[HeroClass[IntB]] to (Owner of Hero[PlayerInteger]) and Change color
                        • Else - Actions
              • Game - Display to (All players) the text: ((|c00996600 + (Name of (Owner of (Buying unit)))) + (|r + ( |c0000cc00decided to conquer the legion forces with|r + (|c00990000 + ((Name of (Sold unit)) + |r)))))
              • Custom script: call RemoveLocation(udg_HeroSpawn)
            • Else - Actions
And these are some of the triggers used for cinematics:
  • Victory Cutscene P2
    • Events
      • Unit - A unit enters VICCINGUARDIANMOVE <gen>
    • Conditions
      • (Entering unit) Equal to GuardianofHyajl
    • Actions
      • Wait 0.70 seconds
      • Unit - Make GuardianofHyajl face 90.00 over 1.00 seconds
      • Unit - Order Hero[PlayerInteger] to Move To (Center of CinematicEndingMove[1])
      • Unit - Order Hero[PlayerInteger] to Move To (Center of CinematicEndingMove[2])
      • Unit - Order Hero[PlayerInteger] to Move To (Center of CinematicEndingMove[3])
      • Unit - Order Hero[PlayerInteger] to Move To (Center of CinematicEndingMove[4])
      • Unit - Order Hero[PlayerInteger] to Move To (Center of CinematicEndingMove[5])
      • Cinematic - Send transmission to (All players) from GuardianofHyajl named The Guardian of Hyj...: Play No sound and display Heroes, the world o.... Modify duration: Set to 7.00 seconds and Wait
      • Unit Group - Pick every unit in ArenaHeroes and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) face GuardianofHyajl over 0.00 seconds
      • Unit - Make GuardianofHyajl Vulnerable
      • Cinematic - Send transmission to (All players) from Hero[PlayerInteger] named ((Name of Player[PlayerInteger]) + (, the + (Name of Hero[PlayerInteger]))): Play No sound and display Aid you? We only ev.... Modify duration: Set to 9.00 seconds and Wait
      • Unit - Order Hero[PlayerInteger] to Attack GuardianofHyajl
  • Victory Cutscene P3
    • Events
      • Unit - A unit owned by Player 11 (Dark Green) Is attacked
    • Conditions
      • (Attacked unit) Equal to GuardianofHyajl
    • Actions
      • Unit - Add a 2.00 second Generic expiration timer to Hero Chooser 0073 <gen>
      • Unit - Add a 2.00 second Generic expiration timer to Hero Chooser 0074 <gen>
      • Unit - Add a 2.00 second Generic expiration timer to Hero Chooser 0075 <gen>
      • Unit - Add a 2.00 second Generic expiration timer to Hero Chooser 0076 <gen>
      • Unit - Add a 2.00 second Generic expiration timer to Hero Chooser 0077 <gen>
      • Unit - Kill GuardianofHyajl
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Killing unit) Equal to Hero[PlayerInteger]
        • Then - Actions
          • Unit - Make (Killing unit) face 45.00 over 1.00 seconds
          • Cinematic - Send transmission to (All players) from Hero[PlayerInteger] named ((Name of Player[PlayerInteger]) + (, the + (Name of Hero[PlayerInteger]))): Play No sound and display With him dead, we c.... Modify duration: Set to 6.00 seconds and Wait
        • Else - Actions
      • Unit - Make Hero[PlayerInteger] face Hero[PlayerInteger] over 0.50 seconds
      • Unit - Make Hero[PlayerInteger] face Hero[PlayerInteger] over 0.50 seconds
      • Unit - Make Hero[PlayerInteger] face Hero[PlayerInteger] over 0.50 seconds
      • Unit - Make Hero[PlayerInteger] face Hero[PlayerInteger] over 0.50 seconds
      • Unit - Make Hero[PlayerInteger] face Hero[PlayerInteger] over 0.50 seconds
      • Cinematic - Send transmission to (All players) from Hero[PlayerInteger] named ((Name of Player[PlayerInteger]) + (, the + (Name of Hero[PlayerInteger]))): Play No sound and display Together?Ha..Enough.... Modify duration: Set to 7.00 seconds and Wait
      • Unit - Make Hero[PlayerInteger] face Hero[PlayerInteger] over 0.50 seconds
      • Unit - Make Hero[PlayerInteger] face Hero[PlayerInteger] over 0.50 seconds
      • Unit - Make Hero[PlayerInteger] face Hero[PlayerInteger] over 0.50 seconds
      • Unit - Make Hero[PlayerInteger] face Hero[PlayerInteger] over 0.50 seconds
      • Unit - Make Hero[PlayerInteger] face Hero[PlayerInteger] over 0.50 seconds
      • Cinematic - Fade out over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Trigger - Turn off Enter Pick Region <gen>
      • Wait 2.00 seconds
      • Camera - Reset camera for Player 1 (Red) to standard game-view over 0.00 seconds
      • Camera - Reset camera for Player 2 (Blue) to standard game-view over 0.00 seconds
      • Camera - Reset camera for Player 3 (Teal) to standard game-view over 0.00 seconds
      • Camera - Reset camera for Player 4 (Purple) to standard game-view over 0.00 seconds
      • Camera - Reset camera for Player 5 (Yellow) to standard game-view over 0.00 seconds
      • Camera - Pan camera for Player[PlayerInteger] to (Center of CinematicArenaPosition[1]) over 0.10 seconds
      • Camera - Pan camera for Player[PlayerInteger] to (Center of CinematicArenaPosition[2]) over 0.10 seconds
      • Camera - Pan camera for Player[PlayerInteger] to (Center of CinematicArenaPosition[3]) over 0.10 seconds
      • Camera - Pan camera for Player[PlayerInteger] to (Center of CinematicArenaPosition[4]) over 0.10 seconds
      • Camera - Pan camera for Player[PlayerInteger] to (Center of CinematicArenaPosition[5]) over 0.10 seconds
      • Sound - Play PursuitTheme <gen>
      • Cinematic - Turn cinematic mode Off for (All players)
      • Cinematic - Turn off letterbox mode (show interface) for (All players): fade in over 1.00 seconds
      • Cinematic - Enable user control for (All players)
      • Cinematic - Fade in over 1.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Player - Make Player 1 (Red) treat Player 2 (Blue) as an Enemy
      • Player - Make Player 1 (Red) treat Player 3 (Teal) as an Enemy
      • Player - Make Player 1 (Red) treat Player 4 (Purple) as an Enemy
      • Player - Make Player 1 (Red) treat Player 5 (Yellow) as an Enemy
      • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Enemy
      • Player - Make Player 2 (Blue) treat Player 3 (Teal) as an Enemy
      • Player - Make Player 2 (Blue) treat Player 4 (Purple) as an Enemy
      • Player - Make Player 2 (Blue) treat Player 5 (Yellow) as an Enemy
      • Player - Make Player 3 (Teal) treat Player 1 (Red) as an Enemy
      • Player - Make Player 3 (Teal) treat Player 2 (Blue) as an Enemy
      • Player - Make Player 3 (Teal) treat Player 4 (Purple) as an Enemy
      • Player - Make Player 3 (Teal) treat Player 5 (Yellow) as an Enemy
      • Player - Make Player 4 (Purple) treat Player 1 (Red) as an Enemy
      • Player - Make Player 4 (Purple) treat Player 2 (Blue) as an Enemy
      • Player - Make Player 4 (Purple) treat Player 3 (Teal) as an Enemy
      • Player - Make Player 4 (Purple) treat Player 5 (Yellow) as an Enemy
      • Player - Make Player 5 (Yellow) treat Player 1 (Red) as an Enemy
      • Player - Make Player 5 (Yellow) treat Player 2 (Blue) as an Enemy
      • Player - Make Player 5 (Yellow) treat Player 3 (Teal) as an Enemy
      • Player - Make Player 5 (Yellow) treat Player 4 (Purple) as an Enemy
      • Player - Make Player 7 (Green) treat Player 1 (Red) as an Enemy
      • Player - Make Player 7 (Green) treat Player 2 (Blue) as an Enemy
      • Player - Make Player 7 (Green) treat Player 3 (Teal) as an Enemy
      • Player - Make Player 7 (Green) treat Player 4 (Purple) as an Enemy
      • Player - Make Player 7 (Green) treat Player 5 (Yellow) as an Enemy
      • Unit - Move Hero[PlayerInteger] instantly to (Center of CinematicArenaPosition[1])
      • Unit - Move Hero[PlayerInteger] instantly to (Center of CinematicArenaPosition[2])
      • Unit - Move Hero[PlayerInteger] instantly to (Center of CinematicArenaPosition[3])
      • Unit - Move Hero[PlayerInteger] instantly to (Center of CinematicArenaPosition[4])
      • Unit - Move Hero[PlayerInteger] instantly to (Center of CinematicArenaPosition[5])
      • Unit Group - Pick every unit in ArenaHeroes and do (Actions)
        • Loop - Actions
          • Unit - Set mana of (Picked unit) to 100.00%
          • Unit - Set life of (Picked unit) to 100.00%
          • Visibility - Create an initially Enabled visibility modifier for (Owner of (Picked unit)) emitting Visibility across WiderArena <gen>
      • Unit - Create 1 Damage Tier Set Level 1 for Player 7 (Green) at (Center of RegionArenaDamage <gen>) facing Default building facing degrees
      • Set Meteor1 = (Last created unit)
      • Hero - Learn skill for Meteor1: Inferno (Level 1 Damage Tier Set)
      • Unit - Create 1 Flamestrike for Player 7 (Green) at (Center of RegionArenaDamage <gen>) facing Default building facing degrees
      • Set Flamestrike1 = (Last created unit)
      • Hero - Learn skill for Flamestrike1: Flame Strike (Abyssius)
      • Unit - Create 1 Flamestrike for Player 7 (Green) at (Center of RegionArenaDamage <gen>) facing Default building facing degrees
      • Set Flamestrike2 = (Last created unit)
      • Hero - Learn skill for Flamestrike2: Flame Strike (Abyssius)
      • Trigger - Turn on Flamestrike <gen>
      • Trigger - Turn on Inferno <gen>
      • Trigger - Turn on Hero Die Arena <gen>
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
Okay, where do I begin.

1) You're only saving 1 Hero per Player because of how Arrays and variables work. A variable can only be set to one value at a time. If you set it to a different value then you overwrite the previous value.
An array gives you more control because it allows you to store a single value to each [index] in the array. But in this case you're using the Player Number as that Index, so all you're able to do is store 1 value PER player.

So you're storing Player 1's HERO, not Heroes, at Hero[1] and you're storing Player 2's HERO at Hero[2], etc... Hero[1] is always going to be equal to the most recent Hero that Player 1 has purchased.

Remember, you're overwriting the value of a variable whenever you Set it.
  • Set Hero[PlayerInteger] = (Sold unit)
An easy solution to this is to add the Heroes to a Unit Group array in order to keep track of them. PlayerHeroes[1] = Player 1's heroes, PlayerHeroes[2] = Player 2's heroes, etc... Then you can use Pick Every Unit to go through these groups and interact with the Picked units.
  • Unit Group - Add (Sold unit) to PlayerHeroes[PlayerInteger]
An alternative solution:
Use a Hashtable, as this will allow you to save multiple heroes per player and it gives you greater control. This is the best option if you want full control of everything.


2) In Victory Cutscene 2 and 3 you're referencing PlayerInteger without ever setting it. Again, this variable can only be set to 1 value at a time.


3) In your Victory Cutscene P3 trigger there is no Killing unit:
  • Unit - Kill GuardianofHyajl
^GuardianofHyajl isn't killed by another unit, it's just killed.
So when you check:
  • (Killing unit) Equal to Hero[PlayerInteger]
This is incorrect. The (Killing unit) does not exist because no unit killed GuardianofHyajl.

The solution: Reference the (Attacking unit), not the (Killing unit). Since the Attacking unit is meant to be the Killing unit anyway for the sake of the cinematic, there's no reason that this wouldn't work.


Here's an example of how you would manage all of this. I cut out a lot of the Actions as it'd be hard for me to recreate everything. This should give you an idea of how to manage PlayerInteger and how to handle the Player's Heroes.

So when you purchase a Hero add it to a Unit Group array (PlayerHeroes) using player indexing.
IMPORTANT: You need to go into the Variable Editor (Control + B) and set the Size of PlayerHeroes to the maximum number of players. Some Variable types need to have their Sizes set beyond the default value of 1, Unit Groups being one of them.
  • Purchase Hero
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • Set Variable PlayerInteger = (Player number of (Owner of (Sold unit)))
      • Unit Group - Add (Sold unit) to PlayerHeroes[PlayerInteger]
Here's an example of Victory Cutscene 3 trigger done properly:
  • Victory Cutscene 3
    • Events
      • Unit - A unit owned by Player 11 (Dark Green) Is attacked
    • Conditions
      • (Attacked unit) Equal to GuardianofHyajl
    • Actions
      • Unit - Kill (Attacked unit)
      • Unit - Make (Attacking unit) face 45.00 over 1.00 seconds
      • Cinematic - Send transmission to (All players) from (Attacking unit) named (Name of (Owner of (Attacking unit))): Play No sound and display blah blah blah. Modify duration: Set to 6.00 seconds and Wait
      • -------- make heroes face unit example: --------
      • Player Group - Pick every player in Players and do (Actions)
        • Loop - Actions
          • Set Variable PlayerInteger = (Player number of (Picked player))
          • Unit Group - Pick every unit in PlayerHeroes[PlayerInteger] and do (Actions)
            • Loop - Actions
              • Unit - Make (Picked unit) face (Attacked unit) over 0.50 seconds
      • Wait 2.00 seconds
      • -------- pan camera example: --------
      • Player Group - Pick every player in Players and do (Actions)
        • Loop - Actions
          • Set Variable PlayerInteger = (Player number of (Picked player))
          • Camera - Pan camera for (Picked player) to CinematicArenaPosition[PlayerInteger] over 0.10 seconds
You should also add your Players to a Player Group, in this case I named the Player Group -> "Players".

I have access to all of the user players with the Players variable, and I have access to those player's Heroes with the PlayerHeroes variable. This allows me to easily loop through each player, and then loop through each of their heroes. Remember, the PlayerInteger variable can only be set to ONE thing at a time, and it'll remain this value FOREVER, or until you set it to something else. You can't reference PlayerInteger without setting it, otherwise you'll most likely get some value that is not equal to your desired Player Number (you'll get some other player's number).

Side note: You're leaking here and there throughout all of the triggers (Memory Leaks). Maybe you don't care, and that's fine, but I figured I'd let you know. Removing the leaks can help improve map performance and is just good practice.
 
Last edited:
Level 9
Joined
Dec 16, 2017
Messages
343
Thanks for such a big help !
I have some questions before i start improving the stuff you showed me:
1) How can i use just 1 player from the variable of the heroes to have a cinematic speech? At the end i need 2-3 heroes to have like a little speech
2) If i set the heroes group variable to 5 from variables menu, and in a game players are lesser than 5, how does it affects the triggers?
3) I have the killing unit in another trigger that turns on this trigger, because the killing unit is a hero, that will have the first speech after, shall i still use what you showed with killing?
4) Also how can i move all of them to different points? I have stored the points in the heroes init, and i have them with array from 1 to 5
5) About the leaks, what leaks in there? Beside the creating of those 3 units, they are just for duel which is the last thing in my map, and another trigger make's those 3 units cast spells every 8 seconds in the arena
6) Look bellow at the cinematic start trigger, it's ok if i check like that if heroes are dead and revive them and move to the specified point or i can use a group aswell?

Heroes Init
  • Heroes
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set CinematicEndingPosition[1] = VICCINREDSTAND <gen>
      • Set CinematicEndingPosition[2] = VICCINBLUESTAND <gen>
      • Set CinematicEndingPosition[3] = VICCINORANGESTAND <gen>
      • Set CinematicEndingPosition[4] = VICCINTEALSTAND <gen>
      • Set CinematicEndingPosition[5] = VICCINPURPLESTAND <gen>
      • Set CinematicEndingMove[1] = VICCINREDMOVE <gen>
      • Set CinematicEndingMove[2] = VICCINBLUEMOVE <gen>
      • Set CinematicEndingMove[3] = VICCINORANGEMOVE <gen>
      • Set CinematicEndingMove[4] = VICCINTEALMOVE <gen>
      • Set CinematicEndingMove[5] = VICCINPURPLEMOVE <gen>
      • Set CinematicArenaPosition[1] = ArenaRedSpawn <gen>
      • Set CinematicArenaPosition[2] = ArenaBlueSpawn <gen>
      • Set CinematicArenaPosition[3] = ArenaTealSpawn <gen>
      • Set CinematicArenaPosition[4] = ArenaPurpleSpawn <gen>
      • Set CinematicArenaPosition[5] = ArenaYellowSpawn <gen>
      • -------- Hero Types --------
      • Set HeroType[1] = |c00990099Demon Hunter HAVOC|r
      • Set HeroType[2] = |c00990099Demon Hunter VENGEANCE|r
      • Set HeroType[3] = |c00990099Demon Hunter TORMENTOR|r
      • Set HeroType[4] = |c00990000Death Knight BLOOD|r
      • Set HeroType[5] = |c00990000Death Knight FROST|r
      • Set HeroType[6] = |c00990000Death Knight UNHOLY|r
      • Set HeroType[7] = |c00ff6600Druid FERAL|r
      • Set HeroType[8] = |c00ff6600Druid GUARDIAN|r
      • Set HeroType[9] = |c00ff6600Druid RESTORATION|r
      • Set HeroType[10] = |c00ff6666Paladin HOLY|r
      • Set HeroType[11] = |c00ff6666Paladin PROTECTION|r
      • Set HeroType[12] = |c00ff6666Paladin RETRIBUTION|r
      • Set HeroType[13] = |cffa56f34Warrior ARMS|r
      • Set HeroType[14] = |cffa56f34Warrior FURY|r
      • Set HeroType[15] = |cffa56f34Warrior PROTECTION|r
      • Set HeroType[16] = |c0066cc00Hunter BEAST MASTERY|r
      • Set HeroType[17] = |c0066cc00Hunter MAKRSMANSHIP|r
      • Set HeroType[18] = |c0066cc00Hunter SURVIVAL|r
      • Set HeroType[19] = |c00ffff33Rogue ASSASSINATION|r
      • Set HeroType[20] = |c00ffff33Rogue OUTLAW|r
      • Set HeroType[21] = |c00ffff33Rogue SUBTLETY|r
      • Set HeroType[22] = |c000033ccShaman EARTHFURY|r
      • Set HeroType[23] = |c000033ccShaman ELEMENTAL|r
      • Set HeroType[24] = |c000033ccShaman RESTORATION|r
      • Set HeroType[25] = |c0066ffffMage ARCANE|r
      • Set HeroType[26] = |c0066ffffMage FIRE|r
      • Set HeroType[27] = |c0066ffffMage FROST|r
      • Set HeroType[28] = |c00ffffffPriest DISCIPLINE|r
      • Set HeroType[29] = |c00ffffffPriest HOLY|r
      • Set HeroType[30] = |c00ffffffPriest SHADOW|r
      • Set HeroType[31] = |c009966ffWarlock AFFLICTION|r
      • Set HeroType[32] = |c009966ffWarlock DEMONOLOGY|r
      • Set HeroType[33] = |c009966ffWarlock DESTRUCTION|r
      • Set HeroType[34] = |c00006666Necromancer CHAOS|r
      • Set HeroType[35] = |c00006666Necromancer DARK|r
      • Set HeroType[36] = |c00006666Necromancer UNHOLY|r
      • Set HeroType[37] = |c00ccccccChronomancer|r
      • Set HeroType[38] = |c007EBFF1Spellblader|r
      • Set HeroType[39] = |cffecce87Engineer|r
      • Set HeroType[40] = |c0099ff00Warden KNIFER|r
      • Set HeroType[41] = |c0099ff00Warden ESCAPER|r
      • Set HeroType[42] = |c0099ff00Warden ILLUSIONIST|r
      • Set HeroType[43] = |c00999900Gronn MARAUDER|r
      • Set HeroType[44] = |c00999900Gronn CHAINER|r
      • Set HeroType[45] = |c00009966Genesaur DOCTOR|r
      • Set HeroType[46] = |c00009966Genesaur BRUTE|r
      • Set HeroType[47] = |c00ccff66Illidari FELREAPER|r
      • -------- Hero Classes --------
      • -------- Demon Hunter --------
      • Set HeroClass[1] = 1
      • Set HeroClass[2] = 1
      • Set HeroClass[3] = 1
      • -------- Death Knight --------
      • Set HeroClass[4] = 2
      • Set HeroClass[5] = 2
      • Set HeroClass[6] = 2
      • -------- Druid --------
      • Set HeroClass[7] = 3
      • Set HeroClass[8] = 3
      • Set HeroClass[9] = 3
      • -------- Paladin --------
      • Set HeroClass[10] = 4
      • Set HeroClass[11] = 4
      • Set HeroClass[12] = 4
      • -------- Warrior --------
      • Set HeroClass[13] = 5
      • Set HeroClass[14] = 5
      • Set HeroClass[15] = 5
      • -------- Hunter --------
      • Set HeroClass[16] = 6
      • Set HeroClass[17] = 6
      • Set HeroClass[18] = 6
      • -------- Rogue --------
      • Set HeroClass[19] = 7
      • Set HeroClass[20] = 7
      • Set HeroClass[21] = 7
      • -------- Shaman --------
      • Set HeroClass[22] = 8
      • Set HeroClass[23] = 8
      • Set HeroClass[24] = 8
      • -------- Mage --------
      • Set HeroClass[25] = 9
      • Set HeroClass[26] = 9
      • Set HeroClass[27] = 9
      • -------- Priest --------
      • Set HeroClass[28] = 10
      • Set HeroClass[29] = 10
      • Set HeroClass[30] = 10
      • -------- Warlock --------
      • Set HeroClass[31] = 11
      • Set HeroClass[32] = 11
      • Set HeroClass[33] = 11
      • -------- Necromancer --------
      • Set HeroClass[34] = 12
      • Set HeroClass[35] = 12
      • Set HeroClass[36] = 12
      • -------- Chronomancer --------
      • Set HeroClass[37] = 13
      • -------- Spellblade --------
      • Set HeroClass[38] = 14
      • -------- Engineer --------
      • Set HeroClass[39] = 15
      • -------- Warden --------
      • Set HeroClass[40] = 16
      • Set HeroClass[41] = 16
      • Set HeroClass[42] = 16
      • -------- Gronn --------
      • Set HeroClass[43] = 17
      • Set HeroClass[44] = 17
      • -------- Genesaur --------
      • Set HeroClass[45] = 18
      • Set HeroClass[46] = 18
      • -------- Illidari --------
      • Set HeroClass[47] = 19
The previous ending cinematic with killing unit
  • Victory Cutscene P2
    • Events
      • Unit - A unit enters VICCINGUARDIANMOVE <gen>
    • Conditions
      • (Entering unit) Equal to GuardianofHyajl
    • Actions
      • Wait 0.70 seconds
      • Unit - Make GuardianofHyajl face 90.00 over 1.00 seconds
      • Unit - Order Hero[PlayerInteger] to Move To (Center of CinematicEndingMove[1])
      • Unit - Order Hero[PlayerInteger] to Move To (Center of CinematicEndingMove[2])
      • Unit - Order Hero[PlayerInteger] to Move To (Center of CinematicEndingMove[3])
      • Unit - Order Hero[PlayerInteger] to Move To (Center of CinematicEndingMove[4])
      • Unit - Order Hero[PlayerInteger] to Move To (Center of CinematicEndingMove[5])
      • Cinematic - Send transmission to (All players) from GuardianofHyajl named The Guardian of Hyj...: Play No sound and display Heroes, the world o.... Modify duration: Set to 7.00 seconds and Wait
      • Unit Group - Pick every unit in ArenaHeroes and do (Actions)
        • Loop - Actions
          • Unit - Make (Picked unit) face GuardianofHyajl over 0.00 seconds
      • Unit - Make GuardianofHyajl Vulnerable
      • Cinematic - Send transmission to (All players) from Hero[PlayerInteger] named ((Name of Player[PlayerInteger]) + (, the + (Name of Hero[PlayerInteger]))): Play No sound and display Aid you? We only ev.... Modify duration: Set to 9.00 seconds and Wait
      • Unit - Order Hero[PlayerInteger] to Attack GuardianofHyajl
Cinematic start that checks if heroes are dead and revive directly and move to the specified point
  • Cutscene Victory Entry
    • Events
    • Conditions
    • Actions
      • Environment - Turn (Last created weather effect) Off
      • Leaderboard - Destroy Leaderboard
      • Multiboard - Destroy Multiboard
      • Cinematic - Fade out over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Disable user control for (All players)
      • Wait 2.00 seconds
      • Cinematic - Turn cinematic mode On for (All players)
      • Cinematic - Turn on letterbox mode (hide interface) for (All players): fade out over 2.00 seconds
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 7 (Green)) and do (Unit - Remove (Picked unit) from the game)
      • Unit Group - Pick every unit in (Units of type The Scorpion) and do (Selection - Remove (Picked unit) from selection)
      • Unit - Create 1 Eredar Lord (Boss 10) for Player 11 (Dark Green) at (Center of VICCINARCHSTAND <gen>) facing 270.00 degrees
      • Set ArchimondeCutscene = (Last created unit)
      • Unit - Change color of ArchimondeCutscene to Green
      • Unit - Create 1 Ghost for Player 11 (Dark Green) at (Center of VICCINGUARDIANSTAND <gen>) facing 90.00 degrees
      • Set GuardianofHyajl = (Last created unit)
      • Unit - Make GuardianofHyajl Invulnerable
      • If ((Hero[PlayerInteger] is dead) Equal to True) then do (Hero - Instantly revive Hero[PlayerInteger] at (Center of CinematicEndingPosition[1]), Hide revival graphics) else do (Unit - Move Hero[PlayerInteger] instantly to (Center of CinematicEndingPosition[1]))
      • If ((Hero[PlayerInteger] is dead) Equal to True) then do (Hero - Instantly revive Hero[PlayerInteger] at (Center of CinematicEndingPosition[2]), Hide revival graphics) else do (Unit - Move Hero[PlayerInteger] instantly to (Center of CinematicEndingPosition[2]))
      • If ((Hero[PlayerInteger] is dead) Equal to True) then do (Hero - Instantly revive Hero[PlayerInteger] at (Center of CinematicEndingPosition[3]), Hide revival graphics) else do (Unit - Move Hero[PlayerInteger] instantly to (Center of CinematicEndingPosition[3]))
      • If ((Hero[PlayerInteger] is dead) Equal to True) then do (Hero - Instantly revive Hero[PlayerInteger] at (Center of CinematicEndingPosition[4]), Hide revival graphics) else do (Unit - Move Hero[PlayerInteger] instantly to (Center of CinematicEndingPosition[4]))
      • If ((Hero[PlayerInteger] is dead) Equal to True) then do (Hero - Instantly revive Hero[PlayerInteger] at (Center of CinematicEndingPosition[5]), Hide revival graphics) else do (Unit - Move Hero[PlayerInteger] instantly to (Center of CinematicEndingPosition[5]))
      • Unit - Make Hero[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
      • Unit - Make Hero[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
      • Unit - Make Hero[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
      • Unit - Make Hero[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
      • Unit - Make Hero[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
      • Sound - Play DarkVictory <gen>
      • Trigger - Run Victory Cutscene P1 <gen> (ignoring conditions)
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
1) You could get a Random unit from the Unit Group.
example:
  • Set Variable RandomUnit = Random unit from PlayerHeroes[PlayerInteger]
  • Unit - Kill RandomUnit
2) It doesn't affect anything. All that's doing is telling the game to initialize 5 Unit Group variables so that they're ready to be used if need be. Note that the Size should be equal to the highest Player Number among those players. So if your map was only 5 players but those players were using Player Slot 8, 9, 10, 11, and 12, you'd want to set the Size to 12.

3) It looked to me like you wanted the unit that got the killing blow on the boss to show up in the cinematic speech. But you also KILL the boss yourself... Is it being killed twice? I'm a bit confused on this one.

4) You would use the same method that I'm using to make the heroes face the attacked unit, but change the Actions: Move (Picked unit) to YourPoint[PlayerInteger]

5) You have Point leaks:
  • (Center of RegionArenaDamage <gen>)
  • Special Effect - Create a special effect at (Position of SoldU) using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
Position of unit/Center of Region both leak a Point.
 
Last edited:
Level 9
Joined
Dec 16, 2017
Messages
343
3) It's just one boss[Archimonde] and one ally[Hyjal Guardian], after archimonde is defeated the cinematics runs up with him being bloody injured, hyjal guardian does some speech, and after that give's him the last blow, after that he requests the aid of the heroes to restore the nature that was destroyed, and they kill him because they want "supremacy", after that, 2-3 heroes do a speech about "leading the world" and they go into a FFA duel
Can you check the 6) too, please? edited previous post exactly after you posted a new one
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
I think you still use Attacking unit, the attacking unit is the one that "kills" hyjal.

Edit:
6) You need to use my method for ALL of your Actions related to the Heroes.

Anywhere that you're using Hero[PlayerInteger] is incorrect. Why?

1) You never set PlayerInteger, so it's going to be equal to whatever value it was last set to (probably 5 for player 5).

2) Hero[PlayerInteger] is only equal to one unit a a time. When you do this:
  • Unit - Make Hero[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
First the game checks what PlayerInteger is equal to. Let's say it's equal to 3 because that's what it was last set to in some other trigger.
  • Unit - Make Hero[3] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero[3] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero[3] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero[3] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero[3] face ArchimondeCutscene over 0.00 seconds
See the problem?
Hero[3] is the same exact unit. You're basically telling ONE unit to face Archimonde FIVE times. And you're doing this throughout all of your triggers whenever you use Hero[#].

This unit will ALWAYS be equal to the most recently purchased Hero for that player. So if Player 3 just bought a Mountain King a moment ago, Hero[3] will be equal to the Mountain King, even if his first Hero was the Paladin.

This would make more sense for what you want but I don't recommend this method:
  • Unit - Make Hero1[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero2[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero3[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero4[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero5[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
So in the above example you'd have five Unit arrays, Hero1[], Hero2[], Hero3[], Hero4[], and Hero5[]. Again, this is really bad practice and I don't recommend doing it. Also, you'd still need to Set PlayerInteger for EACH player, like:
  • Set Variable PlayerInteger = 1
  • Unit - Make Hero1[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero2[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero3[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero4[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero5[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Set Variable PlayerInteger = 2
  • Unit - Make Hero1[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero2[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero3[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero4[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero5[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Set Variable PlayerInteger = 3
  • Unit - Make Hero1[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero2[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero3[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero4[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • Unit - Make Hero5[PlayerInteger] face ArchimondeCutscene over 0.00 seconds
  • // And so on for each player. A very bad solution!
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
OHH, that makes things much easier then! You don't even need the Unit Group.

You can just do this:
  • Actions
    • Player Group - Pick every player in Players and do (Actions)
      • Loop - Actions
        • Set Variable PlayerInteger = (Player number of (Picked player))
        • Unit - Move Hero[PlayerInteger] instantly to CinematicPoint[PlayerInteger]
Since each Player only has 1 Hero, if you want to do something to EACH of those heroes simply loop through the Players and plug in their player number into the Hero[] index. The key thing here is that you're Setting PlayerInteger for each Picked player before you reference it.

So for example, let's say you have 5 players in your map, here's what the above trigger is doing:
  • Set Variable PlayerInteger = 1
  • Unit - Move Hero[PlayerInteger] instantly to CinematicPoint[PlayerInteger]
  • Set Variable PlayerInteger = 2
  • Unit - Move Hero[PlayerInteger] instantly to CinematicPoint[PlayerInteger]
  • Set Variable PlayerInteger = 3
  • Unit - Move Hero[PlayerInteger] instantly to CinematicPoint[PlayerInteger]
  • Set Variable PlayerInteger = 4
  • Unit - Move Hero[PlayerInteger] instantly to CinematicPoint[PlayerInteger]
  • Set Variable PlayerInteger = 5
  • Unit - Move Hero[PlayerInteger] instantly to CinematicPoint[PlayerInteger]
Loops are great because they allow you to make only one Action that will run multiple times, in this case once for each Hero.
 
Level 9
Joined
Dec 16, 2017
Messages
343
And it's the same thing for heroes revive right? Because some heroes might die while killing archimonde, and at that point of the game, the revive timer is arround 50-60 sec, depends on their level, and i need all of them to be alive when cinematic starts
  • If ((Hero[PlayerInteger] is dead) Equal to True) then do (Hero - Instantly revive Hero[PlayerInteger] at (Center of CinematicEndingPosition[PlayerInteger]), Hide revival graphics) else do (Unit - Move Hero[PlayerInteger] instantly to (Center of CinematicEndingPosition[PlayerInteger]))
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
  • Actions
    • Player Group - Pick every player in Players and do (Actions)
      • Loop - Actions
        • Set Variable PlayerInteger = (Player number of (Picked player))
        • Hero - Instantly revive Hero[PlayerInteger] at (Center of CinematicEndingPosition[PlayerInteger]), Hide revival graphics
        • Unit - Move Hero[PlayerInteger] instantly to (Center of CinematicEndingPosition[PlayerInteger])
You don't even need to check if the Hero is dead. Nothing will happen if you try to revive a living Hero. (Unless I'm mistaken)

Is CinematicEndingPosition[PlayerInteger] a Region array? You're leaking points if it is. You're probably better off storing Point variables at the center of this Region instead of the Region itself.
 
Level 9
Joined
Dec 16, 2017
Messages
343
Ok,i will start doing all of those,will come back later,i am sure i will mess something out haha xD
Thanks for your time !

Later Edit: Yes it is a region array and i use from 1 to 5 for each player from 1 to 5
  • Heroes
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set CinematicEndingPosition[1] = VICCINREDSTAND <gen>
      • Set CinematicEndingPosition[2] = VICCINBLUESTAND <gen>
      • Set CinematicEndingPosition[3] = VICCINORANGESTAND <gen>
      • Set CinematicEndingPosition[4] = VICCINTEALSTAND <gen>
      • Set CinematicEndingPosition[5] = VICCINPURPLESTAND <gen>
      • Set CinematicEndingMove[1] = VICCINREDMOVE <gen>
      • Set CinematicEndingMove[2] = VICCINBLUEMOVE <gen>
      • Set CinematicEndingMove[3] = VICCINORANGEMOVE <gen>
      • Set CinematicEndingMove[4] = VICCINTEALMOVE <gen>
      • Set CinematicEndingMove[5] = VICCINPURPLEMOVE <gen>
      • Set CinematicArenaPosition[1] = ArenaRedSpawn <gen>
      • Set CinematicArenaPosition[2] = ArenaBlueSpawn <gen>
      • Set CinematicArenaPosition[3] = ArenaTealSpawn <gen>
      • Set CinematicArenaPosition[4] = ArenaPurpleSpawn <gen>
      • Set CinematicArenaPosition[5] = ArenaYellowSpawn <gen>
So i change the region array into point array? It's better?

  • Heroes
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set CinematicEndingPosition[1] = (Center of RedStand <gen>)
      • Set CinematicEndingPosition[2] = (Center of BlueStand <gen>)
      • Set CinematicEndingPosition[3] = (Center of TealStand <gen>)
      • Set CinematicEndingPosition[4] = (Center of PurpleStand <gen>)
      • Set CinematicEndingPosition[5] = (Center of YellowStand <gen>)
      • Set CinematicEndingMove[1] = (Center of RedMove <gen>)
      • Set CinematicEndingMove[2] = (Center of BlueMove <gen>)
      • Set CinematicEndingMove[3] = (Center of TealMove <gen>)
      • Set CinematicEndingMove[4] = (Center of PurpleMove <gen>)
      • Set CinematicEndingMove[5] = (Center of YellowMove <gen>)
      • Set CinematicArenaPosition[1] = (Center of ArenaRedSpawn <gen>)
      • Set CinematicArenaPosition[2] = (Center of ArenaBlueSpawn <gen>)
      • Set CinematicArenaPosition[3] = (Center of ArenaTealSpawn <gen>)
      • Set CinematicArenaPosition[4] = (Center of ArenaPurpleSpawn <gen>)
      • Set CinematicArenaPosition[5] = (Center of ArenaYellowSpawn <gen>)
Later Later Edit:
  • Hero Selection
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • For each (Integer IntA) from 1 to 47, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Sold unit)) Equal to HeroType[IntA]
            • Then - Actions
              • Set BuyingU = (Buying unit)
              • Set SoldU = (Sold unit)
              • Set HeroSpawn = (Center of RegionHeroSpawn <gen>)
              • Set MaxPlayers = (Number of players in (All players))
              • Set PlayerInteger = (Player number of (Owner of (Sold unit)))
              • Set Player[PlayerInteger] = (Owner of (Buying unit))
              • Set Hero[PlayerInteger] = (Sold unit)
              • Unit Group - Add (Sold unit) to PlayerHeroes[PlayerInteger]
              • Unit Group - Add Hero[PlayerInteger] to ArenaHeroes
              • Unit - Explode BuyingU
              • Unit - Move SoldU instantly to HeroSpawn
              • Camera - Pan camera for (Owner of SoldU) to HeroSpawn over 0.05 seconds
              • Selection - Select SoldU for (Owner of SoldU)
              • Unit - Make SoldU face 270.00 over 0.00 seconds
              • Special Effect - Create a special effect attached to the origin of SoldU using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
              • Special Effect - Destroy (Last created special effect)
              • For each (Integer IntB) from 1 to 47, do (Actions)
                • Loop - Actions
                  • For each (Integer CurrentPlayer) from 1 to MaxPlayers, do (Actions)
                    • Loop - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • HeroClass[IntA] Equal to HeroClass[IntB]
                        • Then - Actions
                          • Player - Make HeroType[IntB] Unavailable for training/construction by (Player(CurrentPlayer))
                          • Unit - Change ownership of ClassHall[HeroClass[IntB]] to (Owner of Hero[PlayerInteger]) and Change color
                        • Else - Actions
              • Game - Display to (All players) the text: ((|c00996600 + (Name of (Owner of (Buying unit)))) + (|r + ( |c0000cc00decided to conquer the legion forces with|r + (|c00990000 + ((Name of (Sold unit)) + |r)))))
              • Custom script: call RemoveLocation(udg_HeroSpawn)
            • Else - Actions
  • [trigger]
  • Cutscene Victory Entry
    • Events
    • Conditions
    • Actions
      • Environment - Turn (Last created weather effect) Off
      • Leaderboard - Destroy Leaderboard
      • Multiboard - Destroy Multiboard
      • Cinematic - Fade out over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Cinematic - Disable user control for (All players)
      • Wait 2.00 seconds
      • Cinematic - Turn cinematic mode On for (All players)
      • Cinematic - Turn on letterbox mode (hide interface) for (All players): fade out over 2.00 seconds
      • Unit Group - Pick every unit in (Units in (Playable map area) owned by Player 7 (Green)) and do (Unit - Remove (Picked unit) from the game)
      • Unit Group - Pick every unit in (Units of type The Scorpion) and do (Selection - Remove (Picked unit) from selection)
      • Unit - Create 1 Eredar Lord (Boss 10) for Player 11 (Dark Green) at (Center of VICCINARCHSTAND <gen>) facing 270.00 degrees
      • Set ArchimondeCutscene = (Last created unit)
      • Unit - Change color of ArchimondeCutscene to Green
      • Unit - Create 1 Ghost for Player 11 (Dark Green) at (Center of VICCINGUARDIANSTAND <gen>) facing 90.00 degrees
      • Set GuardianofHyajl = (Last created unit)
      • Unit - Make GuardianofHyajl Invulnerable
      • Player Group - Pick every player in PlayersGroup and do (Actions)
        • Loop - Actions
          • Set PlayerInteger = (Player number of (Picked player))
          • Hero - Instantly revive Hero[PlayerInteger] at CinematicEndingPosition[PlayerInteger], Hide revival graphics
          • Unit - Move Hero[PlayerInteger] instantly to CinematicEndingPosition[PlayerInteger]
      • Player Group - Pick every player in PlayersGroup and do (Actions)
        • Loop - Actions
          • Set PlayerInteger = (Player number of (Picked player))
          • Unit Group - Pick every unit in PlayerHeroes[PlayerInteger] and do (Actions)
            • Loop - Actions
              • Unit - Make (Picked unit) face ArchimondeCutscene over 0.50 seconds
      • Sound - Play DarkVictory <gen>
      • Trigger - Run Victory Cutscene P1 <gen> (ignoring conditions)
  • Victory Cutscene P1
    • Events
    • Conditions
    • Actions
      • Camera - Apply VCCAM1 <gen> for Player 1 (Red) over 0.00 seconds
      • Camera - Apply VCCAM2 <gen> for Player 1 (Red) over 30.00 seconds
      • Camera - Apply VCCAM1 <gen> for Player 2 (Blue) over 0.00 seconds
      • Camera - Apply VCCAM2 <gen> for Player 2 (Blue) over 30.00 seconds
      • Camera - Apply VCCAM1 <gen> for Player 3 (Teal) over 0.00 seconds
      • Camera - Apply VCCAM2 <gen> for Player 3 (Teal) over 30.00 seconds
      • Camera - Apply VCCAM1 <gen> for Player 4 (Purple) over 0.00 seconds
      • Camera - Apply VCCAM2 <gen> for Player 4 (Purple) over 30.00 seconds
      • Camera - Apply VCCAM1 <gen> for Player 5 (Yellow) over 0.00 seconds
      • Camera - Apply VCCAM2 <gen> for Player 5 (Yellow) over 30.00 seconds
      • Cinematic - Fade in over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Unit - Remove Damage Tier Set Level 1 0119 <gen> from the game
      • Unit Group - Pick every unit in (Units in TheGrove <gen> owned by Neutral Passive) and do (Unit - Remove (Picked unit) from the game)
      • Trigger - Turn on Victory Cutscene Bleed <gen>
      • Wait 2.00 seconds
      • Cinematic - Send transmission to (All players) from GuardianofHyajl named The Guardian of Hyj...: Play No sound and display Your foul Legion ha.... Modify duration: Set to 6.00 seconds and Wait
      • Trigger - Turn on Victory Cutscene Guardian Anim <gen>
      • Cinematic - Send transmission to (All players) from GuardianofHyajl named The Guardian of Hyj...: Play No sound and display Spirits of the fore.... Modify duration: Set to 9.00 seconds and Wait
      • Special Effect - Create a special effect attached to the overhead of GuardianofHyajl using Abilities\Spells\NightElf\Tranquility\Tranquility.mdl
      • Special Effect - Destroy (Last created special effect)
      • Cinematic - Send transmission to (All players) from ArchimondeCutscene named Archimonde: Play No sound and display Your little fairy m.... Modify duration: Set to 3.00 seconds and Wait
      • Special Effect - Create a special effect at (Center of VICCINARCHSTAND <gen>) using Doodads\Cinematic\Lightningbolt\Lightningbolt.mdl
      • Sound - Play LightningBolt1 <gen> at 100.00% volume, located at (Center of VICCINARCHSTAND <gen>) with Z offset 0.00
      • Set Lightning = (Last created special effect)
      • Unit - Kill ArchimondeCutscene
      • Trigger - Turn off Victory Cutscene Guardian Anim <gen>
      • Trigger - Turn off Victory Cutscene Bleed <gen>
      • Wait 2.00 seconds
      • Animation - Reset GuardianofHyajl's animation
      • Special Effect - Destroy Lightning
      • Cinematic - Send transmission to (All players) from GuardianofHyajl named Guardian of Hyjal: Play KeeperOfTheGroveYes3 <gen> and display Well, there it is.. Modify duration: Set to 7.00 seconds and Wait
      • Unit - Order GuardianofHyajl to Move To (Center of VICCINGUARDIANMOVE <gen>)
      • Camera - Apply VCCAM3 <gen> for Player 1 (Red) over 0.00 seconds
      • Camera - Apply VCCAM3 <gen> for Player 2 (Blue) over 0.00 seconds
      • Camera - Apply VCCAM3 <gen> for Player 3 (Teal) over 0.00 seconds
      • Camera - Apply VCCAM3 <gen> for Player 4 (Purple) over 0.00 seconds
      • Camera - Apply VCCAM3 <gen> for Player 5 (Yellow) over 0.00 seconds
  • Victory Cutscene P2
    • Events
      • Unit - A unit enters VICCINGUARDIANMOVE <gen>
    • Conditions
      • (Entering unit) Equal to GuardianofHyajl
    • Actions
      • Wait 0.70 seconds
      • Unit - Make GuardianofHyajl face 90.00 over 1.00 seconds
      • Player Group - Pick every player in PlayersGroup and do (Actions)
        • Loop - Actions
          • Set PlayerInteger = (Player number of (Picked player))
          • Unit - Order Hero[PlayerInteger] to Move To CinematicEndingMove[PlayerInteger]
          • Cinematic - Send transmission to (All players) from GuardianofHyajl named The Guardian of Hyj...: Play No sound and display Heroes, the world o.... Modify duration: Set to 7.00 seconds and Wait
          • Unit Group - Pick every unit in PlayerHeroes[PlayerInteger] and do (Actions)
            • Loop - Actions
              • Unit - Make (Picked unit) face GuardianofHyajl over 0.00 seconds
      • Set SpeechUnit = (Random unit from PlayerHeroes[PlayerInteger])
      • Unit - Make GuardianofHyajl Vulnerable
      • Cinematic - Send transmission to (All players) from SpeechUnit named ((Name of Player[PlayerInteger]) + (, the + (Name of SpeechUnit))): Play No sound and display Aid you? We only ev.... Modify duration: Set to 9.00 seconds and Wait
      • Unit - Order SpeechUnit to Attack GuardianofHyajl
  • Victory Cutscene P3
    • Events
      • Unit - A unit owned by Player 11 (Dark Green) Is attacked
    • Conditions
      • (Attacked unit) Equal to GuardianofHyajl
    • Actions
      • Unit - Add a 2.00 second Generic expiration timer to Hero Chooser 0073 <gen>
      • Unit - Add a 2.00 second Generic expiration timer to Hero Chooser 0074 <gen>
      • Unit - Add a 2.00 second Generic expiration timer to Hero Chooser 0075 <gen>
      • Unit - Add a 2.00 second Generic expiration timer to Hero Chooser 0076 <gen>
      • Unit - Add a 2.00 second Generic expiration timer to Hero Chooser 0077 <gen>
      • Unit - Kill GuardianofHyajl
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Attacking unit) Equal to SpeechUnit
        • Then - Actions
          • Unit - Make (Attacking unit) face 45.00 over 1.00 seconds
          • Cinematic - Send transmission to (All players) from Hero[PlayerInteger] named ((Name of Player[PlayerInteger]) + (, the + (Name of Hero[PlayerInteger]))): Play No sound and display With him dead, we c.... Modify duration: Set to 6.00 seconds and Wait
        • Else - Actions
      • Player Group - Pick every player in PlayersGroup and do (Actions)
        • Loop - Actions
          • Set PlayerInteger = (Player number of (Picked player))
          • Unit Group - Pick every unit in PlayerHeroes[PlayerInteger] and do (Actions)
            • Loop - Actions
              • Unit - Make (Picked unit) face SpeechUnit over 0.50 seconds
      • Cinematic - Send transmission to (All players) from Hero[PlayerInteger] named ((Name of Player[PlayerInteger]) + (, the + (Name of Hero[PlayerInteger]))): Play No sound and display Together?Ha..Enough.... Modify duration: Set to 7.00 seconds and Wait
      • Player Group - Pick every player in PlayersGroup and do (Actions)
        • Loop - Actions
          • Set PlayerInteger = (Player number of (Picked player))
          • Unit Group - Pick every unit in PlayerHeroes[PlayerInteger] and do (Actions)
            • Loop - Actions
              • Unit - Make (Picked unit) face Hero[PlayerInteger] over 0.50 seconds
      • Cinematic - Fade out over 2.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Trigger - Turn off Enter Pick Region <gen>
      • Wait 2.00 seconds
      • Camera - Reset camera for Player 1 (Red) to standard game-view over 0.00 seconds
      • Camera - Reset camera for Player 2 (Blue) to standard game-view over 0.00 seconds
      • Camera - Reset camera for Player 3 (Teal) to standard game-view over 0.00 seconds
      • Camera - Reset camera for Player 4 (Purple) to standard game-view over 0.00 seconds
      • Camera - Reset camera for Player 5 (Yellow) to standard game-view over 0.00 seconds
      • Player Group - Pick every player in PlayersGroup and do (Actions)
        • Loop - Actions
          • Set PlayerInteger = (Player number of (Picked player))
          • Camera - Pan camera for (Picked player) to CinematicArenaPosition[PlayerInteger] over 0.10 seconds
      • Sound - Play PursuitTheme <gen>
      • Cinematic - Turn cinematic mode Off for (All players)
      • Cinematic - Turn off letterbox mode (show interface) for (All players): fade in over 1.00 seconds
      • Cinematic - Enable user control for (All players)
      • Cinematic - Fade in over 1.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Player - Make Player 1 (Red) treat Player 2 (Blue) as an Enemy
      • Player - Make Player 1 (Red) treat Player 3 (Teal) as an Enemy
      • Player - Make Player 1 (Red) treat Player 4 (Purple) as an Enemy
      • Player - Make Player 1 (Red) treat Player 5 (Yellow) as an Enemy
      • Player - Make Player 2 (Blue) treat Player 1 (Red) as an Enemy
      • Player - Make Player 2 (Blue) treat Player 3 (Teal) as an Enemy
      • Player - Make Player 2 (Blue) treat Player 4 (Purple) as an Enemy
      • Player - Make Player 2 (Blue) treat Player 5 (Yellow) as an Enemy
      • Player - Make Player 3 (Teal) treat Player 1 (Red) as an Enemy
      • Player - Make Player 3 (Teal) treat Player 2 (Blue) as an Enemy
      • Player - Make Player 3 (Teal) treat Player 4 (Purple) as an Enemy
      • Player - Make Player 3 (Teal) treat Player 5 (Yellow) as an Enemy
      • Player - Make Player 4 (Purple) treat Player 1 (Red) as an Enemy
      • Player - Make Player 4 (Purple) treat Player 2 (Blue) as an Enemy
      • Player - Make Player 4 (Purple) treat Player 3 (Teal) as an Enemy
      • Player - Make Player 4 (Purple) treat Player 5 (Yellow) as an Enemy
      • Player - Make Player 5 (Yellow) treat Player 1 (Red) as an Enemy
      • Player - Make Player 5 (Yellow) treat Player 2 (Blue) as an Enemy
      • Player - Make Player 5 (Yellow) treat Player 3 (Teal) as an Enemy
      • Player - Make Player 5 (Yellow) treat Player 4 (Purple) as an Enemy
      • Player - Make Player 7 (Green) treat Player 1 (Red) as an Enemy
      • Player - Make Player 7 (Green) treat Player 2 (Blue) as an Enemy
      • Player - Make Player 7 (Green) treat Player 3 (Teal) as an Enemy
      • Player - Make Player 7 (Green) treat Player 4 (Purple) as an Enemy
      • Player - Make Player 7 (Green) treat Player 5 (Yellow) as an Enemy
      • Player Group - Pick every player in PlayersGroup and do (Actions)
        • Loop - Actions
          • Set PlayerInteger = (Player number of (Picked player))
          • Unit - Move Hero[PlayerInteger] instantly to CinematicArenaPosition[PlayerInteger]
      • Unit Group - Pick every unit in ArenaHeroes and do (Actions)
        • Loop - Actions
          • Unit - Set mana of (Picked unit) to 100.00%
          • Unit - Set life of (Picked unit) to 100.00%
          • Visibility - Create an initially Enabled visibility modifier for (Owner of (Picked unit)) emitting Visibility across WiderArena <gen>
      • Unit - Create 1 Damage Tier Set Level 1 for Player 7 (Green) at (Center of RegionArenaDamage <gen>) facing Default building facing degrees
      • Set Meteor1 = (Last created unit)
      • Hero - Learn skill for Meteor1: Inferno (Level 1 Damage Tier Set)
      • Unit - Create 1 Flamestrike for Player 7 (Green) at (Center of RegionArenaDamage <gen>) facing Default building facing degrees
      • Set Flamestrike1 = (Last created unit)
      • Hero - Learn skill for Flamestrike1: Flame Strike (Abyssius)
      • Unit - Create 1 Flamestrike for Player 7 (Green) at (Center of RegionArenaDamage <gen>) facing Default building facing degrees
      • Set Flamestrike2 = (Last created unit)
      • Hero - Learn skill for Flamestrike2: Flame Strike (Abyssius)
      • Trigger - Turn on Flamestrike <gen>
      • Trigger - Turn on Inferno <gen>
      • Trigger - Turn on Hero Die Arena <gen>
Ok, so this is all, i've edited everything, except the cinematics, because the unit that is supposed to attack the guardian hyjal in [Victory cutscene p2] doesn't fire for some reason, and also the cinematic in that trigger doesn't work, it shows the next with no player name,no unit name, no unit portrait..
@Uncle
 
Last edited:

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,537
Remember, Player Integer needs to be Set to something before you use it. It's being used in this Action without being Set:
  • Set SpeechUnit = (Random unit from PlayerHeroes[PlayerInteger])
So PlayerInteger's value is whatever it was last Set to, which is probably the reason why it's not working. It could be getting a Random unit from let's say PlayerHeroes[5] which wouldn't exist if there is no Player 5 in the game.

Note that you don't always have to use the PlayerInteger variable either, it's useful in Loops but for single Actions you can just do something like:
  • Set SpeechUnit = (Random unit from PlayerHeroes[1])
Understand that PlayerInteger is really just a shortcut/optimization. It's not needed. You can always reference for example: Player number of picked player.

But it's more convenient and more efficient to use the variable. One warning though, if you reuse PlayerInteger throughout your triggers then there's a possibility that some Actions could cause an Event of another trigger to go off, thus making the two triggers occur "at the same time". To understand this better you can read what I posted in this thread, ignore the thread title: [General] - What is the limit time a global variable can store a variable after get overwritten?. So in these cases your triggers may end up getting you the incorrect PlayerInteger values. It's hard to explain but just remember to actively Set PlayerInteger and you should be okay. You might not even run into the problem either, it depends on how you structure your triggers.

Anyway, in that particular trigger I would just set SpeechUnit = Triggering unit

Triggering unit will be equal to the unit that entered the region and this Event Response works fine even after Waits. It's the ONLY Event Response that will keep the same value throughout the entire trigger without the possibility of getting changed to something else or losing it's reference.


Also, you're still leaking Points:
  • Unit - Create 1 Flamestrike for Player 7 (Green) at (Center of RegionArenaDamage <gen>) facing Default building facing degrees
(Center of RegionArenaDamage <gen>) leaks a point. You need to reference a Point variable that is equal to the center of RegionArenaDamage.

Make sure you reference your other Point variables as well.

There's also room for optimization with your Pick Every Player/Pick Every Unit actions. When possible, you should try to put everything that needs to happen to the picked Player/Unit in the same Loop, instead of creating multiple Loops.

So instead of:
Pick every player in Players and do: Add 100 Gold to picked player
Pick every player in Players and do: Add 100 Lumber to picked player

You'd do:
Pick every player in Players and do: Add 100 Gold to picked player, Add 100 Lumber to picked player

If problems still happen after applying these fixes, try displaying text messages throughout your triggers. These can be really useful for debugging your map.

For example:
Pick every unit in PlayerHeroes[1] and do: Display text message (name of Picked unit)

If no names show up when you test this in-game, you'll know that PlayerHeroes[1] either doesn't exist or it's empty. In your case it's probably just empty, but maybe you forgot to set the Size of the Variable in the Variable Editor (Unit Groups/Player Groups need their Sizes to be set manually).

You can also display the value of PlayerInteger. If you see it display "5" then that's probably the reason it wasn't working for Player 1 (you forgot to set it back to 1).
 
Last edited:
Status
Not open for further replies.
Top