Arena System, helpppp!

Glorn2

Slap n' Tickle
Reaction score
4
I am having a really rough time figuring out how to make this arena system. What I want is for it to pick an equal number of random players from all teams to compete in the arena... And this number cannot be higher than the number of players on the smallest team.

I can set one up for full team duels, and 1v1 fights... But the whole "equal number not exceeding the smallest team" is what is getting me. Anyone know how I could do this?
 

Glorn2

Slap n' Tickle
Reaction score
4
I need help making a dueling/arena system.

There are either 2 or 4 teams, containing up to 6 players in 6v6, and up to 3 players in 3v3v3v3.

I need a "pick" system that will pick heroes from every team to fight in the arena.

conditions:
An equal number of players from every team must be picked. So, if it starts off as a 3v3v3v3, and 2 players leave team 4; it will only pick 1 RANDOM player from each team. If there are 2 players on the team with fewest players, I want it to pick 2 from every team, at random.

What I want is for it to pick an equal number of random players from all teams to compete in the arena... And this number cannot be higher than the number of players on the smallest team

That is about as clear as I can make it.

to rephrase again, I need a system that will pick X number of random players heroes to compete in there arena, where X is the number of players on the smallest team.
 

Moridin

Snow Leopard
Reaction score
144
To get the number of players in the smallest team:

Have an integer variable, say - Small_Team
Then do this

Player Group - Pick all Players in Team 1 and do multiple actions -
Loop -
Set Small_Team = Small_Team + 1

This will count the number of players in Team 1 (so long as Small_Team is originally 0).

You can also set arrays for it to count multiple teams and compare the values to FIND the smallest team.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
This trigger will give you the number of players on the smaller team, you just need to make an interger varible. You will need to make player group varibles for each team however and add the players to them, which is a good thing cause it will also come in handy for a lot of your triggers.

Trigger:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Number of players in (Team_1)) Less than (Number of players in (Team_2))
    • Then - Actions
      • Set Interger = (Number of players in (Team_1))
    • Else - Actions
      • Set Interger = (Number of players in (Team_2)))


The triggers are kinda old and leak, but this map has a pretty nice dueling system.
http://www.epicwar.com/maps/20136/

You can use this to check for the min players on 4 teams


Trigger:
  • Events
    • Conditions
    • Actions
      • Set Interger = (Number of players in Teams[1])
      • For each (Integer A) from 1 to 3, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Interger Greater than (Number of players in Teams[((Integer A) + 1)])
            • Then - Actions
              • Set Interger = (Number of players in Teams[((Integer A) + 1)])
            • Else - Actions
 

Glorn2

Slap n' Tickle
Reaction score
4
I am actually using Malt's system to clean up all GUI triggers... It is cheap, but works amazingly.

I had actually started working on what you suggested, I got the idea from the above post; I already had the player groups made for my 4 team mode, so wanted to try to use them.

here is what I got so far:
Trigger:
  • Four Team Mode
    • Events
    • Conditions
    • Actions
      • Player Group - Add Player 1 (Red) to Team1
      • Player Group - Add Player 2 (Blue) to Team1
      • Player Group - Add Player 3 (Teal) to Team1
      • Player Group - Add Player 4 (Purple) to Team3
      • Player Group - Add Player 5 (Yellow) to Team3
      • Player Group - Add Player 6 (Orange) to Team3
      • Player Group - Add Player 7 (Green) to Team2
      • Player Group - Add Player 8 (Pink) to Team2
      • Player Group - Add Player 9 (Gray) to Team2
      • Player Group - Add Player 10 (Light Blue) to Team4
      • Player Group - Add Player 11 (Dark Green) to Team4
      • Player Group - Add Player 12 (Brown) to Team4
      • Player Group - Make Team1 treat Team3 as an Enemy
      • Player Group - Make Team3 treat Team1 as an Enemy
      • Player Group - Make Team4 treat Team2 as an Enemy
      • Player Group - Make Team2 treat Team4 as an Enemy


Trigger:
  • Small Team Pick
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in Team1) Less than or equal to (Number of players in Team2)
          • (Number of players in Team1) Less than or equal to (Number of players in Team3)
          • (Number of players in Team1) Less than or equal to (Number of players in Team4)
        • Then - Actions
          • Set LowTeam = (Number of players in Team1)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in Team2) Less than or equal to (Number of players in Team1)
          • (Number of players in Team2) Less than or equal to (Number of players in Team3)
          • (Number of players in Team2) Less than or equal to (Number of players in Team4)
        • Then - Actions
          • Set LowTeam = (Number of players in Team2)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in Team3) Less than or equal to (Number of players in Team1)
          • (Number of players in Team3) Less than or equal to (Number of players in Team2)
          • (Number of players in Team3) Less than or equal to (Number of players in Team4)
        • Then - Actions
          • Set LowTeam = (Number of players in Team3)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in Team4) Less than or equal to (Number of players in Team1)
          • (Number of players in Team4) Less than or equal to (Number of players in Team2)
          • (Number of players in Team4) Less than or equal to (Number of players in Team3)
        • Then - Actions
          • Set LowTeam = (Number of players in Team4)
          • Skip remaining actions
        • Else - Actions


The above trigger is run before the first duel, and every time a player leaves the game. How does it look?
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
It looks good, a little rought but it will still work. :)
 

Glorn2

Slap n' Tickle
Reaction score
4
Okay, I have been frying my brain over this for a while, and cant figure out where I went wrong...

Trigger:
  • Small Team Pick 2T
    • Events
      • Time - Elapsed game time is 60.00 seconds
      • Player - Player 1 (Red) leaves the game
      • Player - Player 2 (Blue) leaves the game
      • Player - Player 3 (Teal) leaves the game
      • Player - Player 4 (Purple) leaves the game
      • Player - Player 5 (Yellow) leaves the game
      • Player - Player 6 (Orange) leaves the game
      • Player - Player 7 (Green) leaves the game
      • Player - Player 8 (Pink) leaves the game
      • Player - Player 9 (Gray) leaves the game
      • Player - Player 10 (Light Blue) leaves the game
      • Player - Player 11 (Dark Green) leaves the game
      • Player - Player 12 (Brown) leaves the game
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in Team1) Less than or equal to (Number of players in Team2)
        • Then - Actions
          • Set LowTeam = (Number of players in Team1)
        • Else - Actions
          • Set LowTeam = (Number of players in Team2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LowTeam Equal to 0
        • Then - Actions
          • Countdown Timer - Destroy ArenaStartTimer
          • Trigger - Turn off Timer Start <gen>
          • Trigger - Turn off Even Move To Arena <gen>
          • Trigger - Turn off Small Team <gen>
          • Trigger - Turn off Arena Ends <gen>
          • Trigger - Turn off Full Move to Arena <gen>
          • Trigger - Turn off (This trigger)
        • Else - Actions


That is what you have posted above; and I also made it so that all of my arena triggers would turn off if there is only 1 team left in the game. It runs whenever it may need to be updated.

Problem being, when I use my move to arena trigger, and my arena ends trigger... it doesn't work how it should...

Trigger:
  • Even Move To Arena Copy
    • Events
      • Time - ArenaStart expires
    • Conditions
    • Actions
      • Unit Group - Pick every unit in PlayerHeroes and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an ally of Player 1 (Red)) Equal to True
            • Then - Actions
              • Hero - Instantly revive (Picked unit) at (Center of Temp Start <gen>), Hide revival graphics
            • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) belongs to an ally of Player 7 (Green)) Equal to True
            • Then - Actions
              • Hero - Instantly revive (Picked unit) at (Center of Temp Start 2 <gen>), Hide revival graphics
            • Else - Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and (((Owner of (Matching unit)) is in Team1) Equal to True))) and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to (Center of Team 1 Start 2 <gen>)
          • Camera - Pan camera for (Owner of (Picked unit)) to (Position of (Picked unit)) over 0.00 seconds
          • Unit - Pause (Picked unit)
      • Unit Group - Pick every unit in (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and (((Owner of (Matching unit)) is in Team2) Equal to True))) and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to (Center of Team 2 Start 2 <gen>)
          • Camera - Pan camera for (Owner of (Picked unit)) to (Position of (Picked unit)) over 0.00 seconds
          • Unit - Pause (Picked unit)
      • Wait 0.00 seconds
      • Unit Group - Pick every unit in (Random LowTeam units from (Units in Team 1 Start 2 <gen> matching (((Matching unit) is A Hero) Equal to True))) and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to (Center of Arena Team 1 <gen>)
          • Unit - Unpause (Picked unit)
          • Camera - Pan camera for (Owner of (Picked unit)) to (Position of (Picked unit)) over 0.00 seconds
      • Unit Group - Pick every unit in (Random LowTeam units from (Units in Team 2 Start 2 <gen> matching (((Matching unit) is A Hero) Equal to True))) and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to (Center of Arena Team 2 <gen>)
          • Unit - Unpause (Picked unit)
          • Camera - Pan camera for (Owner of (Picked unit)) to (Position of (Picked unit)) over 0.00 seconds


When the above trigger runs, rather than picking "Lowteam" number of random heroes, it picks... all of the heroes... I may simply be misunderstanding the concept of picking a random number of units.. but this is not working....

any thoughtttssss?
 

Glorn2

Slap n' Tickle
Reaction score
4
Alright, I have figured this out; kinda. I got it to finally get an even number of heroes in the arena for a 2 team mode. Had to re-word some things; and set the players being added to groups to if/then statements. It is a little sloppy, but with leak cleaning, and the trigger rarely being run I dont see a problem with it. If anyone is interested in the fixed trigger, just ask and I can post it.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top