• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Arena Trigger

Status
Not open for further replies.
Level 3
Joined
Dec 27, 2012
Messages
36
Im trying to make an arena for my map, the problem is i dont know how should i make the trigger when only 1 unit(hero) is left in the arena to be automatically moved to its town...i managed to make a trigger when all players are in the arena..but im still not sure how should i make it for 1v1.

  • Arena Done
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Player Group - Add Player 1 (Red) to Human
      • Player Group - Add Player 2 (Blue) to Human
      • Player Group - Add Player 3 (Teal) to Human
      • Player Group - Pick every player in Human and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • (Number of units in (Units in Region 025 <gen> owned by Player 1 (Red))) Equal to 0
                  • (Number of units in (Units in Region 025 <gen> owned by Player 2 (Blue))) Equal to 0
                  • (Number of units in (Units in Region 025 <gen> owned by Player 3 (Teal))) Equal to 0
            • Then - Actions
              • Player Group - Add Player 4 (Purple) to Undead
              • Player Group - Add Player 5 (Yellow) to Undead
              • Player Group - Add Player 6 (Orange) to Undead
              • Player Group - Pick every player in Undead and do (Actions)
                • Loop - Actions
                  • Unit Group - Pick every unit in (Units in Region 025 <gen> owned by (Picked player)) and do (Actions)
                    • Loop - Actions
                      • Unit - Move (Picked unit) instantly to (Center of Undead Spawn <gen>)
            • Else - Actions
              • Player Group - Pick every player in Undead and do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • And - All (Conditions) are true
                        • Conditions
                          • (Number of units in (Units in Region 025 <gen> owned by Player 4 (Purple))) Equal to 0
                          • (Number of units in (Units in Region 025 <gen> owned by Player 5 (Yellow))) Equal to 0
                          • (Number of units in (Units in Region 025 <gen> owned by Player 6 (Orange))) Equal to 0
                    • Then - Actions
                      • Player Group - Pick every player in Human and do (Actions)
                        • Loop - Actions
                          • Unit Group - Pick every unit in (Units in Region 025 <gen> owned by (Picked player)) and do (Actions)
                            • Loop - Actions
                              • Unit - Move (Picked unit) instantly to (Center of Alliance Spawn <gen>)
                    • Else - Actions
 
Level 3
Joined
Dec 27, 2012
Messages
36
Yup...for now my trigger only works when all 6 players are in the arena but ill doubt that ill have a "full house" evry time ill play...so i want to make a similar trigger but only 2 players fighting...1 v 1
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Okay sure I think I've got what you need

So when the Arena Starts however you manage it--

Run this trigger or put it in yours
  • Arena start
    • Events
    • Conditions
    • Actions
      • Set ArenaHeroes = (Units in Arena <gen> matching (((Matching unit) is A Hero) Equal to True))


  • Arena End
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • -------- Is in Heroes --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is in Heroes) Equal to True
        • Then - Actions
          • Unit Group - Remove (Triggering unit) from Heroes
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Heroes) Less than or equal to 1
        • Then - Actions
          • Set WinningPlayer = (Owner of (Random unit from Heroes))
          • Trigger - Run Arena End 2 <gen> (ignoring conditions)
        • Else - Actions
  • Arena End 2
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • WinningPlayer Equal to Player 1 (Red)
    • Then - Actions
      • Give Reward and Move Instantly to Player 1's base (Likely a Region)
    • Else - Actions
If the Player's do not have fixed bases, whatever the Main Building is do this.

  • Set Home base (Red)
    • Events
      • Unit - A unit owned by Player 1 (Red) Finishes construction
    • Conditions
      • (Unit-type of (Constructed structure)) Equal to Main Base
    • Actions
      • Set RedHomeBase = (Position of (Constructed structure))
  • Arena End 2
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • WinningPlayer Equal to Player 1 (Red)
    • Then - Actions
      • Give Reward
        • Unit - Move (Random unit from Heroes) instantly to RedHomeBase
    • Else - Actions
You'll just need to add as necessary the # of players now!
 
Level 3
Joined
Dec 27, 2012
Messages
36
well i forgot to tell you that its an periodically event meaning that every 9 min of the game 2 random players are taken from 2 different player groups each containing 3 players....so the thing is i dont know how to make it for all players because i dont know wich player will be in the arena. I tried making it with a "or-any conditions are true" but it wont work.

  • Arena Done 1v1
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Player Group - Add Player 1 (Red) to Human
      • Player Group - Add Player 2 (Blue) to Human
      • Player Group - Add Player 3 (Teal) to Human
      • Player Group - Pick every player in Human and do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units in Region 025 <gen> owned by (Picked player)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Or - Any (Conditions) are true
                    • Conditions
                      • (Number of units in (Units in Region 025 <gen> owned by Player 1 (Red))) Equal to 0
                      • (Number of units in (Units in Region 025 <gen> owned by Player 2 (Blue))) Equal to 0
                      • (Number of units in (Units in Region 025 <gen> owned by Player 3 (Teal))) Equal to 0
                • Then - Actions
                  • Player Group - Add Player 4 (Purple) to Undead
                  • Player Group - Add Player 5 (Yellow) to Undead
                  • Player Group - Add Player 6 (Orange) to Undead
                  • Player Group - Pick every player in Undead and do (Actions)
                    • Loop - Actions
                      • Unit Group - Pick every unit in (Units in Region 025 <gen> owned by (Picked player)) and do (Actions)
                        • Loop - Actions
                          • Unit - Move (Picked unit) instantly to (Center of Undead Spawn <gen>)
                • Else - Actions

  • Arena Showdown
    • Events
      • Time - Arena expires
    • Conditions
    • Actions
      • Unit - Pause all units
      • Game - Display to (All players) for 6.00 seconds the text: Let the BATTLE begi...
      • Player Group - Add Player 1 (Red) to Human
      • Player Group - Add Player 2 (Blue) to Human
      • Player Group - Add Player 3 (Teal) to Human
      • Wait 4.00 game-time seconds
      • Player Group - Pick every player in (Player group((Random player from Human))) and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Picked player) to (Center of Region 011 <gen>) over 0.00 seconds
          • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is A Hero) Equal to True
                • Then - Actions
                  • Unit - Set mana of (Picked unit) to 100.00%
                  • Unit - Set life of (Picked unit) to 100.00%
                  • Unit - Move (Picked unit) instantly to (Center of Region 011 <gen>)
                • Else - Actions
      • Player Group - Add Player 6 (Orange) to Undead
      • Player Group - Add Player 5 (Yellow) to Undead
      • Player Group - Add Player 4 (Purple) to Undead
      • Player Group - Pick every player in (Player group((Random player from Undead))) and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Picked player) to (Center of Region 012 <gen>) over 0.00 seconds
          • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is A Hero) Equal to True
                • Then - Actions
                  • Unit - Set mana of (Picked unit) to 100.00%
                  • Unit - Set life of (Picked unit) to 100.00%
                  • Unit - Move (Picked unit) instantly to (Center of Region 012 <gen>)
                • Else - Actions
      • Unit - Unpause all units

EDIT:im trying your trigger right now

EDIT (again): this is what i made based on your trigger

  • Arena done move
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • winningplayer Equal to Player 1 (Red)
              • winningplayer Equal to Player 2 (Blue)
              • winningplayer Equal to Player 3 (Teal)
        • Then - Actions
          • Unit - Move (Random unit from Arena_Heroes) instantly to (Center of Alliance Spawn <gen>)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • winningplayer Equal to Player 4 (Purple)
              • winningplayer Equal to Player 5 (Yellow)
              • winningplayer Equal to Player 6 (Orange)
            • Then - Actions
              • Unit - Move (Random unit from Arena_Heroes) instantly to (Center of Undead Spawn <gen>)
            • Else - Actions
  • Arena done 1 v 1
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) is in Arena_Heroes) Equal to True
        • Then - Actions
          • Unit Group - Remove (Dying unit) from Arena_Heroes
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Arena_Heroes) Less than or equal to 1
        • Then - Actions
          • Set winningplayer = (Random player from (Player group((Owner of (Random unit from Arena_Heroes)))))
          • Trigger - Run Arena done move <gen> (ignoring conditions)
        • Else - Actions
 
Last edited:
Level 13
Joined
Mar 24, 2013
Messages
1,105
well i forgot to tell you that its an periodically event meaning that every 9 min of the game 2 random players are taken from 2 different player groups each containing 3 players....so the thing is i dont know how to make it for all players because i dont know wich player will be in the arena. I tried making it with a "or-any conditions are true" but it wont work.

I'm confused by this quote. But my main question is why you're using Player Groups? You should just add all the heroes (that you want to go to the Arena) for Player 1, 2, 3 to a Unit Group and then move that unit to the Arena.

This being said, I'm going to assume you only want one hero for each player. I'm also going to assume you have to Train the hero, if that's not the case you'll need to edit my first trigger to make it so that the Hero for each unit is added to Heroes (Arena_Heroes) Unit Group unit .

  • Hero Set
    • Events
      • Unit - A unit owned by Player 1 (Red) Finishes training a unit
    • Conditions
      • ((Trained unit) is A Hero) Equal to True
    • Actions
      • Unit Group - Add (Trained unit) to Team1_UnitGroup
Of course do this for Player 2,3 and 4,5,6 add to Team2_UnitGroup also

  • Arena Start
    • Events
      • Time - Every 540.00 seconds of game time/Arena Timer Expire
    • Conditions
    • Actions
      • Unit - Pause all units
      • Game - Display to (All players) the text: Your MSG
      • Wait 4.00 game-time seconds
      • Unit Group - Pick every unit in (Random 1 units from Team1_UnitGroup) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to Heroes
          • Unit - Set life of (Picked unit) to (Max life of (Picked unit))
          • Unit - Set mana of (Picked unit) to (Max mana of (Picked unit))
          • Unit - Move (Picked unit) instantly to (Center of Arena2 <gen>)
      • Unit Group - Pick every unit in (Random 1 units from Team2_UnitGroup) and do (Actions)
        • Loop - Actions
          • Unit Group - Add (Picked unit) to Heroes
          • Unit - Set life of (Picked unit) to (Max life of (Picked unit))
          • Unit - Set mana of (Picked unit) to (Max mana of (Picked unit))
          • Unit - Move (Picked unit) instantly to (Center of Arena2 <gen>)
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Picked player) to (Center of Arena <gen>) over 0.00 seconds
      • Unit - Unpause all units
This will pretty much replace your Arena showdown trigger.

Also in your Arena done move make sure to change it so that winningplayer = players 4,5,6 are also a OR condition

Also in Arena done 1v1
set winningplayer = random unit from Arena_Heroes

(You don't need to make a different trigger for 1v1s this will work for full house or 1v1)
 
Level 3
Joined
Dec 27, 2012
Messages
36
i did everything you said but one small question: if im using taverns as a hero chooser...what should the event be..."A Unit Sells a Unit" or "A Unit Revives a Unit" or something like that?
 
Level 13
Joined
Mar 24, 2013
Messages
1,105
Yes exactly, A unit Sells a unit
Here's a trigger that might help you
  • Hero Set
    • Events
      • Unit - A unit Sells a unit
    • Conditions
      • ((Sold unit) is A Hero) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Sold unit) belongs to an ally of Player 1 (Red)) Equal to True
        • Then - Actions
          • Unit Group - Add (Sold unit) to Team1_UnitGroup
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Sold unit) belongs to an enemy of Player 1 (Red)) Equal to True
        • Then - Actions
          • Unit Group - Add (Sold unit) to Team2_UnitGroup
        • Else - Actions
 
Status
Not open for further replies.
Top