• 🏆 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] Arena/Duel System

Status
Not open for further replies.
Level 9
Joined
Dec 16, 2017
Messages
339
Hello guys, for some reason my arena system stopped working in my map, and i can't find the reason why,because i haven't changed anything, or using the duel variables somewhere else..
So, my arena system starts when the last boss of the map is killed(i have a hero defense type map) and a little cinematic starts, where boss takes the killing blow from player 1,and after that all players from 1 to 5 argue about "leading the group" and they set up in a last duel where every player is enemy with the other players, when the hero dies, he is removed from the game and a counting shows up (each time after a hero dies) that says how many heroes remained alive, when the number of heroes alive is 1, a little cinematic starts for all players featuring the remained alive hero and then the map ends. But for some reason, the arena group formed by the players heroes, doesn't get recognized by the counting trigger and always shows 0 heroes alive, even if there are 5 or 1..and i tried to do more things, but didn't fixed it yet so i am out of ideas..if someone may know, thanks !

I mention that i use 1.28.5 patch of Wc3

This is the trigger that runs the ending of the cinematic and beginning of the duel
  • Victory Cutscene P3
    • Events
      • Unit - A unit owned by Player 11 (Dark Green) Is attacked
    • Conditions
      • (Attacked unit) Equal to GuardianofHyajl
    • Actions
      • Unit - Kill GuardianofHyajl
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Killing unit) Equal to PlayerRedHero
        • Then - Actions
          • Unit - Make (Killing unit) face 45.00 over 1.00 seconds
          • Cinematic - Send transmission to (All players) from PlayerRedHero named ((Name of Player 1 (Red)) + (, the + (Name of PlayerRedHero))): Play No sound and display With him dead, we c.... Modify duration: Set to 6.00 seconds and Wait
        • Else - Actions
          • Unit - Make (Killing unit) face 90.00 over 1.00 seconds
          • Cinematic - Send transmission to (All players) from PlayerYellowHero named ((Name of Player 5 (Yellow)) + (, the + (Name of PlayerYellowHero))): Play No sound and display With him dead, we c.... Modify duration: Set to 6.00 seconds and Wait
      • Unit - Make PlayerPurpleHero face PlayerBlueHero over 0.50 seconds
      • Unit - Make PlayerRedHero face PlayerBlueHero over 0.50 seconds
      • Unit - Make PlayerTealHero face PlayerBlueHero over 0.50 seconds
      • Unit - Make PlayerYellowHero face PlayerBlueHero over 0.50 seconds
      • Cinematic - Send transmission to (All players) from PlayerBlueHero named ((Name of Player 2 (Blue)) + (, the + (Name of PlayerBlueHero))): Play No sound and display Together? I thought.... Modify duration: Set to 7.00 seconds and Wait
      • Unit - Make PlayerBlueHero face PlayerPurpleHero over 0.50 seconds
      • Unit - Make PlayerRedHero face PlayerPurpleHero over 0.50 seconds
      • Unit - Make PlayerTealHero face PlayerPurpleHero over 0.50 seconds
      • Unit - Make PlayerYellowHero face PlayerPurpleHero over 0.50 seconds
      • Cinematic - Send transmission to (All players) from PlayerPurpleHero named ((Name of Player 4 (Purple)) + (, the + (Name of PlayerPurpleHero))): Play No sound and display You? Ha! No, we agr.... Modify duration: Set to 7.00 seconds and Wait
      • Unit - Make PlayerBlueHero face PlayerTealHero over 0.50 seconds
      • Unit - Make PlayerPurpleHero face PlayerTealHero over 0.50 seconds
      • Unit - Make PlayerRedHero face PlayerTealHero over 0.50 seconds
      • Unit - Make PlayerYellowHero face PlayerTealHero over 0.50 seconds
      • Cinematic - Send transmission to (All players) from PlayerTealHero named ((Name of Player 3 (Teal)) + (, the + (Name of PlayerTealHero))): Play No sound and display Enough of this! Let.... Modify duration: Set to 7.00 seconds and Wait
      • 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
      • Unit - Move PlayerRedHero instantly to (Center of ArenaRedSpawn <gen>)
      • Unit - Move PlayerBlueHero instantly to (Center of ArenaBlueSpawn <gen>)
      • Unit - Move PlayerTealHero instantly to (Center of ArenaTealSpawn <gen>)
      • Unit - Move PlayerPurpleHero instantly to (Center of ArenaPurpleSpawn <gen>)
      • Unit - Move PlayerYellowHero instantly to (Center of ArenaYellowSpawn <gen>)
      • Unit - Make PlayerBlueHero face 180.00 over 0.00 seconds
      • Unit - Make PlayerPurpleHero face 90.00 over 0.00 seconds
      • Unit - Make PlayerTealHero face 0.00 over 0.00 seconds
      • Unit - Make PlayerRedHero face 270.00 over 0.00 seconds
      • Unit - Make PlayerYellowHero face 90.00 over 0.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 1 (Red) to (Position of PlayerRedHero) over 0.10 seconds
      • Camera - Pan camera for Player 2 (Blue) to (Position of PlayerBlueHero) over 0.10 seconds
      • Camera - Pan camera for Player 3 (Teal) to (Position of PlayerTealHero) over 0.10 seconds
      • Camera - Pan camera for Player 4 (Purple) to (Position of PlayerPurpleHero) over 0.10 seconds
      • Camera - Pan camera for Player 5 (Yellow) to (Position of PlayerYellowHero) over 0.10 seconds
      • Unit - Set life of PlayerBlueHero to 100.00%
      • Unit - Set life of PlayerPurpleHero to 100.00%
      • Unit - Set life of PlayerRedHero to 100.00%
      • Unit - Set life of PlayerTealHero to 100.00%
      • Unit - Set life of PlayerYellowHero to 100.00%
      • Unit - Set mana of PlayerBlueHero to 100.00%
      • Unit - Set mana of PlayerPurpleHero to 100.00%
      • Unit - Set mana of PlayerRedHero to 100.00%
      • Unit - Set mana of PlayerTealHero to 100.00%
      • Unit - Set mana of PlayerYellowHero to 100.00%
      • 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 Group - Add PlayerBlueHero to ArenaUnits
      • Unit Group - Add PlayerPurpleHero to ArenaUnits
      • Unit Group - Add PlayerRedHero to ArenaUnits
      • Unit Group - Add PlayerTealHero to ArenaUnits
      • Unit Group - Add PlayerYellowHero to ArenaUnits
      • Visibility - Create an initially Enabled visibility modifier for Player 1 (Red) emitting Visibility across TheGrove <gen>
      • Visibility - Create an initially Enabled visibility modifier for Player 2 (Blue) emitting Visibility across TheGrove <gen>
      • Visibility - Create an initially Enabled visibility modifier for Player 3 (Teal) emitting Visibility across TheGrove <gen>
      • Visibility - Create an initially Enabled visibility modifier for Player 4 (Purple) emitting Visibility across TheGrove <gen>
      • Visibility - Create an initially Enabled visibility modifier for Player 5 (Yellow) emitting Visibility across TheGrove <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>
      • Unit Group - Pick every unit in ArenaUnits and do (Unit - Order (Picked unit) to Attack-Move To (Center of Origin <gen>))
      • Trigger - Turn on Hero Die Arena <gen>
This is the trigger that detects the number of alive heroes and fires the win if it's 1
  • Arena Victory
    • Events
    • Conditions
    • Actions
      • Wait 2.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in ArenaUnits) Equal to 1
        • Then - Actions
          • Trigger - Turn off Inferno <gen>
          • Trigger - Turn off Flamestrike <gen>
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Killing unit)) Not equal to Flamestrike
              • ((Killing unit) is A Hero) Equal to True
            • Then - Actions
              • Set Winner = (Killing unit)
            • Else - Actions
              • Set Winner = (Random unit from ArenaUnits)
          • Wait 2.00 seconds
          • Unit - Order Winner to Stop
          • Selection - Remove Winner from selection for (Owner of Winner)
          • Cinematic - Disable user control for (All players)
          • 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 - Move Winner instantly to (Center of Origin <gen>)
          • Unit - Make Winner face 270.00 over 0.00 seconds
          • Sound - Play HeroicVictory <gen>
          • Camera - Apply WCAM1 <gen> for Player 1 (Red) over 0.00 seconds
          • Camera - Apply WCAM2 <gen> for Player 1 (Red) over 10.00 seconds
          • Camera - Apply WCAM1 <gen> for Player 2 (Blue) over 0.00 seconds
          • Camera - Apply WCAM2 <gen> for Player 2 (Blue) over 10.00 seconds
          • Camera - Apply WCAM1 <gen> for Player 3 (Teal) over 0.00 seconds
          • Camera - Apply WCAM2 <gen> for Player 3 (Teal) over 10.00 seconds
          • Camera - Apply WCAM1 <gen> for Player 4 (Purple) over 0.00 seconds
          • Camera - Apply WCAM2 <gen> for Player 4 (Purple) over 10.00 seconds
          • Camera - Apply WCAM1 <gen> for Player 5 (Yellow) over 0.00 seconds
          • Camera - Apply WCAM2 <gen> for Player 5 (Yellow) over 10.00 seconds
          • Cinematic - Send transmission to (All players) from Winner named (Name of (Owner of Winner)): Play No sound and display The world is mine!. Modify duration: Set to 10.00 seconds and Wait
          • Wait 1.00 seconds
          • Game - Defeat Player 1 (Red) with the message: Game over!
          • Game - Defeat Player 2 (Blue) with the message: Game over!
          • Game - Defeat Player 3 (Teal) with the message: Game over!
          • Game - Defeat Player 4 (Purple) with the message: Game over!
          • Game - Defeat Player 5 (Yellow) with the message: Game over!
        • Else - Actions
          • Game - Display to (All players) the text: (Only + ((String((Number of units in ArenaUnits))) + heroes remaining!))
This is the trigger that removes the dying heroes from the ArenaUnits group
  • Hero Die Arena
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Sound - Play Herodeath <gen> at 100.00% volume, located at (Position of (Dying unit)) with Z offset 0.00
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) is in ArenaUnits) Equal to True
          • (Owner of (Killing unit)) Equal to Player 7 (Green)
        • Then - Actions
          • Game - Display to (All players) the text: ((Name of (Owner of (Dying unit))) + was slain by natural forces!)
          • Unit Group - Remove (Dying unit) from ArenaUnits
          • Trigger - Run Arena Victory <gen> (ignoring conditions)
        • Else - Actions
          • Game - Display to (All players) the text: ((Name of (Owner of (Killing unit))) + ( has slain + ((Name of (Owner of (Dying unit))) + !)))
          • Unit Group - Remove (Dying unit) from ArenaUnits
          • Trigger - Run Arena Victory <gen> (ignoring conditions)
And the [PlayerRedHero][PlayerBlueHero][PlayerTealHero][PlayerPurpleHero][PlayerYellowHero] variables are set from the hero choosing, i use whisp entering in location and giving the hero that is in that location, i will post a trigger of 1 hero aswell.
  • Demon Hunter Havoc
    • Events
      • Unit - A unit enters RegionDemonHunterHavoc <gen>
    • Conditions
      • (Unit-type of (Entering unit)) Equal to Hero Chooser
    • Actions
      • Trigger - Turn off (This trigger)
      • Trigger - Turn off Demon Hunter Tormentor <gen>
      • Trigger - Turn off Demon Hunter Vengeance <gen>
      • Special Effect - Create a special effect at (Position of (Entering unit)) using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
      • Unit - Remove (Entering unit) from the game
      • Special Effect - Destroy (Last created special effect)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Owner of (Triggering unit)) Equal to Player 1 (Red)
        • Then - Actions
          • Set PlayerRedHeroPicked = True
          • Set PlayerRedHeroType = |c00990099Demon Hunter HAVOC|r
          • Unit - Create 1 |c00990099Demon Hunter HAVOC|r for Player 1 (Red) at (Center of RegionHeroSpawn <gen>) facing 90.00 degrees
          • Set PlayerRedHero = (Last created unit)
          • Camera - Pan camera for Player 1 (Red) to (Position of PlayerRedHero) over 0.20 seconds
          • Special Effect - Create a special effect at (Position of PlayerRedHero) using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Change ownership of Demon Hunter Class Hall 0208 <gen> to Player 1 (Red) and Change color
          • Visibility - Destroy GroveVisRed
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Owner of (Triggering unit)) Equal to Player 2 (Blue)
            • Then - Actions
              • Set PlayerBlueHeroPicked = True
              • Set PlayerBlueHeroType = |c00990099Demon Hunter HAVOC|r
              • Unit - Create 1 |c00990099Demon Hunter HAVOC|r for Player 2 (Blue) at (Center of RegionHeroSpawn <gen>) facing 90.00 degrees
              • Set PlayerBlueHero = (Last created unit)
              • Camera - Pan camera for Player 2 (Blue) to (Position of PlayerBlueHero) over 0.20 seconds
              • Special Effect - Create a special effect at (Position of PlayerBlueHero) using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
              • Special Effect - Destroy (Last created special effect)
              • Unit - Change ownership of Demon Hunter Class Hall 0208 <gen> to Player 2 (Blue) and Change color
              • Visibility - Destroy GroveVisBlue
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Triggering unit)) Equal to Player 3 (Teal)
                • Then - Actions
                  • Set PlayerTealHeroPicked = True
                  • Set PlayerTealHeroType = |c00990099Demon Hunter HAVOC|r
                  • Unit - Create 1 |c00990099Demon Hunter HAVOC|r for Player 3 (Teal) at (Center of RegionHeroSpawn <gen>) facing 90.00 degrees
                  • Set PlayerTealHero = (Last created unit)
                  • Camera - Pan camera for Player 3 (Teal) to (Position of PlayerBlueHero) over 0.20 seconds
                  • Special Effect - Create a special effect at (Position of PlayerTealHero) using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Unit - Change ownership of Demon Hunter Class Hall 0208 <gen> to Player 3 (Teal) and Change color
                  • Visibility - Destroy GroveVisTeal
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
                    • Then - Actions
                      • Set PlayerPurpleHeroPicked = True
                      • Set PlayerPurpleHeroType = |c00990099Demon Hunter HAVOC|r
                      • Unit - Create 1 |c00990099Demon Hunter HAVOC|r for Player 4 (Purple) at (Center of RegionHeroSpawn <gen>) facing 90.00 degrees
                      • Set PlayerPurpleHero = (Last created unit)
                      • Camera - Pan camera for Player 4 (Purple) to (Position of PlayerPurpleHero) over 0.20 seconds
                      • Special Effect - Create a special effect at (Position of PlayerTealHero) using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
                      • Special Effect - Destroy (Last created special effect)
                      • Unit - Change ownership of Demon Hunter Class Hall 0208 <gen> to Player 4 (Purple) and Change color
                      • Visibility - Destroy GroveVisPurple
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Owner of (Triggering unit)) Equal to Player 5 (Yellow)
                        • Then - Actions
                          • Set PlayerYellowHeroPicked = True
                          • Set PlayerYellowHeroType = |c00990099Demon Hunter HAVOC|r
                          • Unit - Create 1 |c00990099Demon Hunter HAVOC|r for Player 5 (Yellow) at (Center of RegionHeroSpawn <gen>) facing 90.00 degrees
                          • Set PlayerYellowHero = (Last created unit)
                          • Camera - Pan camera for Player 5 (Yellow) to (Position of PlayerPurpleHero) over 0.20 seconds
                          • Special Effect - Create a special effect at (Position of PlayerYellowHero) using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
                          • Special Effect - Destroy (Last created special effect)
                          • Unit - Change ownership of Demon Hunter Class Hall 0208 <gen> to Player 5 (Yellow) and Change color
                          • Visibility - Destroy GroveVisYellow
                        • Else - Actions
                          • Do nothing
      • Unit - Remove Circle of Power 0143 <gen> from the game
      • Unit - Remove |c00990099Demon Hunter HAVOC|r 0209 <gen> from the game
      • Game - Display to (All players) the text: ((|c00996600 + (Name of (Owner of (Entering unit)))) + (|r + ( |c0000cc00decided to conquer the legion forces with|r + (Name of (Last created unit)))))
 
Last edited:
Level 21
Joined
Dec 4, 2007
Messages
1,473
empty.gif
joinbottomminus.gif
if.gif
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • empty.gif
    empty.gif
    joinminus.gif
    cond.gif
    If - Conditions
    • empty.gif
      empty.gif
      line.gif
      joinbottom.gif
      if.gif
      (Number of units in ArenaUnits) Equal to 1
  • empty.gif
    empty.gif
    joinminus.gif
    actions.gif
    Then - Actions
    • empty.gif
      empty.gif
      line.gif
      join.gif
      page.gif
      Trigger - Turn off Inferno <gen>
    • empty.gif
      empty.gif
      line.gif
      join.gif
      page.gif
      Trigger - Turn off Flamestrike <gen>
    • empty.gif
      empty.gif
      line.gif
      joinminus.gif
      if.gif
      If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • empty.gif
        empty.gif
        line.gif
        line.gif
        joinminus.gif
        cond.gif
        If - Conditions
        • empty.gif
          empty.gif
          line.gif
          line.gif
          line.gif
          join.gif
          if.gif
          (Unit-type of (Killing unit)) Not equal to Flamestrike
        • empty.gif
          empty.gif
          line.gif
          line.gif
          line.gif
          joinbottom.gif
          if.gif
          ((Killing unit) is A Hero) Equal to True
      • empty.gif
        empty.gif
        line.gif
        line.gif
        joinminus.gif
        actions.gif
        Then - Actions
        • empty.gif
          empty.gif
          line.gif
          line.gif
          line.gif
          joinbottom.gif
          set.gif
          Set Winner = (Killing unit)
      • empty.gif
        empty.gif
        line.gif
        line.gif
        joinbottomminus.gif
        actions.gif
        Else - Actions
        • empty.gif
          empty.gif
          line.gif
          line.gif
          empty.gif
          joinbottom.gif
          set.gif
          Set Winner = (Random unit from ArenaUnits)

You are referencing to a non-existing event here (there is no event), wherefore all the killing/dying unit conditions and actions are ignored.
You need to move this part into the "Hero Die Arena" trigger to fix the problem.
 
Level 9
Joined
Dec 16, 2017
Messages
339
You are referencing to a non-existing event here (there is no event), wherefore all the killing/dying unit conditions and actions are ignored.
You need to move this part into the "Hero Die Arena" trigger to fix the problem.
Hmm, if i do that, i can't run this trigger each time a unit is getting removed from ArenaUnits, to see how many units remain in arena units from "Hero Die Arena"
There is something wrong with the detection of the "ArenaUnits" and i don't understand why..because when i teleport heroes from the cinematic to duel it works and uses the same variable,but suddenly it's like the group get's empty when teleported to arena..
 
Last edited:
Level 21
Joined
Dec 4, 2007
Messages
1,473
Btw, there are quite some more inconsistent event references going on:

base.gif
Victory Cutscene P3
  • joinminus.gif
    events.gif
    Events
    • line.gif
      joinbottom.gif
      unit.gif
      Unit - A unit owned by Player 11 (Dark Green) Is attacked
  • joinminus.gif
    cond.gif
    Conditions
    • line.gif
      joinbottom.gif
      if.gif
      (Attacked unit) Equal to GuardianofHyajl
  • joinbottomminus.gif
    actions.gif
    Actions
    • empty.gif
      join.gif
      unit.gif
      Unit - Kill GuardianofHyajl
    • empty.gif
      joinminus.gif
      if.gif
      If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • empty.gif
        line.gif
        joinminus.gif
        cond.gif
        If - Conditions
        • empty.gif
          line.gif
          line.gif
          joinbottom.gif
          if.gif
          (Killing unit) Equal to PlayerRedHero
      • empty.gif
        line.gif
        joinminus.gif
        actions.gif
        Then - Actions
        • empty.gif
          line.gif
          line.gif
          join.gif
          unit.gif
          Unit - Make (Killing unit) face 45.00 over 1.00 seconds
        • empty.gif
          line.gif
          line.gif
          joinbottom.gif
          cam.gif
          Cinematic - Send transmission to (All players) from PlayerRedHero named ((Name of Player 1 (Red)) + (, the + (Name of PlayerRedHero))): Play No sound and display With him dead, we c.... Modify duration: Set to 6.00 seconds and Wait
      • empty.gif
        line.gif
        joinbottomminus.gif
        actions.gif
        Else - Actions
        • empty.gif
          line.gif
          empty.gif
          join.gif
          unit.gif
          Unit - Make (Killing unit) face 90.00 over 1.00 seconds
        • empty.gif
          line.gif
          empty.gif
          joinbottom.gif
          cam.gif
          Cinematic - Send transmission to (All players) from PlayerYellowHero named ((Name of Player 5 (Yellow)) + (, the + (Name of PlayerYellowHero))): Play No sound and display With him dead, we c.... Modify duration: Set to 6.00 seconds and Wait

^The if then else part can't trigger, because the event is "
unit.gif
Unit - A unit owned by Player 11 (Dark Green) Is attacked".

Also many triggers can be shortened by quite a bit with the usage of the "for each integer variable" and/or "pick every player/unitgroup" actions.

I would cleanup a lot of that first and double check your events-conditions-action chains carefully.
 
Level 9
Joined
Dec 16, 2017
Messages
339
Btw, there are quite some more inconsistent event references going on:



^The if then else part can't trigger, because the event is "
unit.gif
Unit - A unit owned by Player 11 (Dark Green) Is attacked".

Also many triggers can be shortened by quite a bit with the usage of the "for each integer variable" and/or "pick every player/unitgroup" actions.

I would cleanup a lot of that first and double check your events-conditions-action chains carefully.
I tried to separate the duel part from the cinematic trigger,and when i do that, it doesn't even move the heroes to the arena..for some reason, the "ArenaUnits" group get's wrecked and i don't understand why..
 
Level 12
Joined
Feb 5, 2018
Messages
521
Well, I don't even know where to start. Your triggers are a bit messy and all over the place.

The first improvement I would make is to use tavern hero system instead of regions. It's really really simple and needs only one trigger to run.
  • Selecting Hero
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Custom script: local player = udg_Player
      • Custom script: local unit = Soldunit
      • Set VariableSet Player = (Owner of (Buying unit))
      • Game - Display to (All players) for 15.00 seconds the text: ((Name of (Owner of (Buying unit))) + ( has chosen + (|c0020C000 + ((Name of (Sold unit)) + |r))))
      • Selection - Select (Sold unit) for Player
      • Unit - Move (Sold unit) instantly to (Center of HeroStartPoint <gen>)
      • Unit - Kill (Buying unit)
      • Camera - Pan camera for Player to (Center of HeroStartPoint <gen>) over 0.00 seconds

And instead of having PlayerHeroRed, PlayerHeroBlue, etc.

You could add to the Hero Select trigger: Set Integer = Player Number of Player and then use Hero unit variable with index and do: Set Hero[Integer] = (Sold Unit)

Then later you can use this index with a loop to make your triggers more simple instead of this bloated code you are currently stuck with.

I would also combine Hero Arena Die and Arena Victory triggers.

You should remove the first wait from the Arena Victory trigger, I get that you want a wait after the conditions are met to transition to the cinematic event.
 
Level 9
Joined
Dec 16, 2017
Messages
339
Well, I don't even know where to start. Your triggers are a bit messy and all over the place.

The first improvement I would make is to use tavern hero system instead of regions. It's really really simple and needs only one trigger to run.
  • Selecting Hero
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Custom script: local player = udg_Player
      • Custom script: local unit = Soldunit
      • Set VariableSet Player = (Owner of (Buying unit))
      • Game - Display to (All players) for 15.00 seconds the text: ((Name of (Owner of (Buying unit))) + ( has chosen + (|c0020C000 + ((Name of (Sold unit)) + |r))))
      • Selection - Select (Sold unit) for Player
      • Unit - Move (Sold unit) instantly to (Center of HeroStartPoint <gen>)
      • Unit - Kill (Buying unit)
      • Camera - Pan camera for Player to (Center of HeroStartPoint <gen>) over 0.00 seconds

And instead of having PlayerHeroRed, PlayerHeroBlue, etc.

You could add to the Hero Select trigger: Set Integer = Player Number of Player and then use Hero unit variable with index and do: Set Hero[Integer] = (Sold Unit)

Then later you can use this index with a loop to make your triggers more simple instead of this bloated code you are currently stuck with.

I would also combine Hero Arena Die and Arena Victory triggers.

You should remove the first wait from the Arena Victory trigger, I get that you want a wait after the conditions are met to transition to the cinematic event.

Hello, i wanted to transit from a hero choose with whisp into Tavern system, the problem is that, i have 3 specs for each class, like in wow, and with tavern i can't find a way to make it delete the other 2 specs when one spec is chosen..and that's why this messy thing is there..because i want when one player chooses for example mage fire,to delete mage arcane and mage frost from choosing for him and other remained players..
Heroes.jpg
 
Level 12
Joined
Feb 5, 2018
Messages
521
Well the HeroTypes must be made with triggers and then add the hero types into the taverns with triggers.
  • Set HeroType[1] = Mage Arcane
  • Add HeroType[1] to Tavern XXX with stock value 1 and maxium value 1
  • Set HeroType[2] = Mage Fire
  • Add HeroType[2] to Tavern XXX with stock value 1 and maxium value 1
  • Set HeroType[3] = Mage Frost
  • Add HeroType[3] to Tavern XXX with stock value 1 and maxium value 1
A unit won't be removed from the tavern if it is not added there trough the triggers.

There are examples somewhere in the forums :p

This is a frequently asked question.
 
Level 9
Joined
Dec 16, 2017
Messages
339
Well the HeroTypes must be made with triggers and then add the hero types into the taverns with triggers.
  • Set HeroType[1] = Mage Arcane
  • Add HeroType[1] to Tavern XXX with stock value 1 and maxium value 1
  • Set HeroType[2] = Mage Fire
  • Add HeroType[2] to Tavern XXX with stock value 1 and maxium value 1
  • Set HeroType[3] = Mage Frost
  • Add HeroType[3] to Tavern XXX with stock value 1 and maxium value 1
A unit won't be removed from the tavern if it is not added there trough the triggers.

There are examples somewhere in the forums :p

This is a frequently asked question.
Yeah, this is where i got close too aswell, the part that i couldn't get into, is to delete the others 2 that were unselected for all players because i can't figure it out, i have 39 heroes, so i do 3 herotypes per hero class,but how does the tavern can be configured out to know exactly which hero type was choosed and delete the others 2 from selection?
Shall i make smth like
-herotypemage[1] [2] [3]
-herotypewarrior[1] [2] [3]
-herotypewarlock[1] [2] [3]
and so on?
 
Level 12
Joined
Feb 5, 2018
Messages
521
If all conditions are true
or (any) conditions
Unittype of Sold Unit equal to
HerotypeMage[1]
HerotypeMage[2]
HerotypeMage[3]
For each HeroInteger from 1 to 3 do actions
Remove HeroType[HeroInteger] from all marketplaces

I know @Uncle has helped with a system like this in the past, but I couldn't find it so maybe he can help you out a bit here :)
 
Level 9
Joined
Dec 16, 2017
Messages
339
If all conditions are true
or (any) conditions
Unittype of Sold Unit equal to
HerotypeMage[1]
HerotypeMage[2]
HerotypeMage[3]
For each HeroInteger from 1 to 3 do actions
Remove HeroType[HeroInteger] from all marketplaces

I know @Uncle has helped with a system like this in the past, but I couldn't find it so maybe he can help you out a bit here :)
ok, i will try smth like this on my own, so i do a condition like this for each herotype, right? because i can't set all heroes to just a herotype variable, and i have to make a herotype variable for each class,as it seems from my view
Or i could do with same variable too and change the integer from 1 to 3 for mage, from 4 to 6 for warrior, from 7 to 10 for warlock and so on,hmm,thanks a lot !

Later Edit:
How can i add the unit to the tavern from triggers? I can't find the function, i use 1.28.5 WE if that might be a problem..
And for some reason, at the "remove herotype[herointeger]" part , it doesn't let me chose a unit-type variable,only units variables.. and the "hero" variable that i used there, is the one from players numbers,i did that just so i can complete the function.
@DoomBlade

  • HeroSelection
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • Custom script: local player = udg_Player
      • Custom script: local unit = Soldunit
      • Set Player = (Owner of (Buying unit))
      • Set PlayerInteger = (Player number of (Owner of (Sold unit)))
      • Set Hero[PlayerInteger] = (Sold unit)
      • 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)))))
      • Selection - Select (Sold unit) for Player
      • Unit - Move (Sold unit) instantly to (Center of RegionHeroSpawn <gen>)
      • Unit - Kill (Buying unit)
      • Camera - Pan camera for Player to (Center of RegionHeroSpawn <gen>) over 0.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to HeroType[1]
          • (Unit-type of (Sold unit)) Equal to HeroType[2]
          • (Unit-type of (Sold unit)) Equal to HeroType[3]
        • Then - Actions
          • For each (Integer HeroInteger) from 1 to 3, do (Unit - Remove Hero[HeroInteger] from the game)
        • Else - Actions
  • HeroesForSelection
    • Events
    • Conditions
    • Actions
      • Set HeroType[1] = |c00ff6666Paladin RETRIBUTION|r
      • Set HeroType[2] = |c00ff6666Paladin PROTECTION|r
      • Set HeroType[3] = |c00ff6666Paladin HOLY|r
I've found this as an option,shall it work?
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Sold unit)) Equal to HeroType[1]
      • (Unit-type of (Sold unit)) Equal to HeroType[2]
      • (Unit-type of (Sold unit)) Equal to HeroType[3]
    • Then - Actions
      • For each (Integer HeroInteger) from 1 to 3, do (Player - Limit training of HeroType[HeroInteger] to 0 for Player)
    • Else - Actions
 
Last edited:
Level 12
Joined
Feb 5, 2018
Messages
521
How can i add the unit to the tavern from triggers? I can't find the function, i use 1.28.5 WE if that might be a problem..

Ohhh, I'm sorry I don't have earlier versions currently, but if it existed back then it should be under "neutral building" and from there "add unit-type to marketplace".

if.gif
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • empty.gif
    empty.gif
    joinminus.gif
    cond.gif
    If - Conditions
    • empty.gif
      empty.gif
      line.gif
      join.gif
      if.gif
      (Unit-type of (Sold unit)) Equal to HeroType[1]
    • empty.gif
      empty.gif
      line.gif
      join.gif
      if.gif
      (Unit-type of (Sold unit)) Equal to HeroType[2]
    • empty.gif
      empty.gif
      line.gif
      joinbottom.gif
      if.gif
      (Unit-type of (Sold unit)) Equal to HeroType[3]

Also to this add or (any conditions) are true and list the hero types underneath that.
 
Level 9
Joined
Dec 16, 2017
Messages
339
  • Heroes Selection
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • For each (Integer IntA) from 1 to 12, 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 Player = (Owner of (Buying unit))
              • Set PlayerInteger = (Player number of (Owner of (Sold unit)))
              • Set Hero[PlayerInteger] = (Sold unit)
              • 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 12, 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))
                        • 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
  • Heroes
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Hero Types --------
      • -------- Here you will set the type of heroes created in the object editor --------
      • 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
      • -------- Hero Classes --------
      • -------- Here you will set the class for the heroes. This is linked to the Class Types defined above --------
      • -------- 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
I've done this and works, thanks for the help !
Tommorrow i will start remaking triggers that used the "PlayerTealHero" etc
 
Level 9
Joined
Dec 16, 2017
Messages
339
I'm glad you are getting it to work! :)
Yeah, i am currently working on version 0.4C of my map, i think it will have the biggest update of all until now xD
This hero tavern,already added 3 new heroes and have another 3 in plan, remaking the cinematic triggers because they all use "PlayerRedHero" to refer for players,and duel triggers.
Thanks for the help !
 
Status
Not open for further replies.
Top