• 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.

Help with Leaderboard and Duel Arena

Status
Not open for further replies.
Level 2
Joined
Apr 8, 2020
Messages
14
Hi, so I've been recently remaking some old hero arena map. The game is almost playable but I need to fix the leaderboard and duel arena to fit togheter as when the countdown timer for duel reach 0, the player with most kills in each team enters the arena to duel. then the leaderboard reset for next round.
Most of the job is done but I need help to add/modify/remove triggers because this is still buggy and way above my knowledge haha.

The files named Duel and Leaderboard is where the problem at
 

Attachments

  • hero arena.w3m
    985.6 KB · Views: 33
Last edited:
Level 25
Joined
Mar 29, 2020
Messages
1,465
You might find some good samaritan that will actually go through your map and fix it for you. If that doesn't happen, I suggest you try to break down what the problems are and deal with them/ask here for help with them one by one. For instance for the problem with the leaderboards - post the relevant triggers when describing the problem.

good luck!
 
Level 2
Joined
Apr 8, 2020
Messages
14
yeah i'm not sure how to post a trigger else I would of done that instead.
but one of my problem you can probably help me is
what kind of trigger and variable do I need to choose the duelist on both side for the duel, if I want the duelist to be the ones with the highest number of points (hero kill) per round. all this related to the leaderboard
 
Level 2
Joined
Apr 8, 2020
Messages
14
You might find some good samaritan that will actually go through your map and fix it for you. If that doesn't happen, I suggest you try to break down what the problems are and deal with them/ask here for help with them one by one. For instance for the problem with the leaderboards - post the relevant triggers when describing the problem.

good luck!
I've looked on forum and I did not find any problem similar to mine
 
Level 2
Joined
Apr 8, 2020
Messages
14
maybe I misunderstood you. from your post it seemed you were saying "my map has a lot of bugs, here it is, please fix it. " and to that I suggested you post a specfic problem with the relevant triggers. I'm not sure how your response has to do with that... :confused:2
You were right so I asked a proper question, I think you did not see my second message. or if you can not answer me then leave it for some1 else.
 
Level 2
Joined
Apr 8, 2020
Messages
14
  • Duelist Pick
    • Events
      • Time - Dueltimer expires
    • Conditions
    • Actions
      • Trigger - Run Time Out Timer <gen> (checking conditions)
      • Wait 1.00 seconds
      • Unit Group - Pick every unit in (Units in (Playable map area)) 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
              • ((Picked unit) belongs to an ally of Player 1 (Red).) Equal to True
            • Then - Actions
              • Hero - Instantly revive (Picked unit) at (Center of Team1rez <gen>), Hide revival graphics
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is A Hero) Equal to True
                  • ((Picked unit) belongs to an ally of Player 7 (Green).) Equal to True
                • Then - Actions
                  • Hero - Instantly revive (Picked unit) at (Center of Team2rez <gen>), Hide revival graphics
                • Else - Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked player) Not equal to Neutral Victim
              • (Picked player) Not equal to Neutral Extra
              • (Picked player) Not equal to Neutral Passive
            • Then - Actions
              • Set VariableSet Player_Current_Kills[(Player number of (Picked player))] = 0
              • Set VariableSet LastPickedPlayer = (Picked player)
              • Player Group - Pick every player in (All players) and do (Actions)
                • Loop - Actions
                  • Leaderboard - Change the value for LastPickedPlayer in Leaderboard[(Player number of (Picked player))] to Player_Current_Kills[(Player number of LastPickedPlayer)]
            • Else - Actions
      • Countdown Timer - Destroy DueltimerW
      • Unit - Move Ferotuus 0097 <gen> instantly to (Center of Ferotuus Duel Position <gen>), facing (Center of Duel Visibility <gen>)
      • Unit - Make Ferotuus 0097 <gen> Invulnerable
      • Unit - Pause all units
      • Set VariableSet TempGroup = (Units in (Playable map area) matching ((Level of Dummy for (Matching unit)) Equal to 1))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Unpause (Picked unit)
      • Set VariableSet TempGroup = (Units in (Playable map area) matching ((Level of Dummy (Ward) for (Matching unit)) Equal to 1))
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Unpause (Picked unit)
      • Game - Display to (All players) the text: Its time for a duel!
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Camera - Pan camera for (Picked player) to (Center of Duel Visibility <gen>) over 1.00 seconds
      • Unit Group - Pick every unit in (Units in (Playable map area)) 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
              • (Owner of (Picked unit)) Not equal to Neutral Hostile
              • (Owner of (Picked unit)) Not equal to Neutral Passive
            • Then - Actions
              • Set VariableSet Hero_Position[(Player number of (Owner of (Picked unit)))] = (Position of (Picked unit))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Player 1 (Red)
                • Then - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Playerslot 1 <gen>)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Player 2 (Blue)
                • Then - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Playerslot 2 <gen>)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Player 3 (Teal)
                • Then - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Playerslot 3 <gen>)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Player 4 (Purple)
                • Then - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Playerslot 4 <gen>)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Player 5 (Yellow)
                • Then - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Playerslot 5 <gen>)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Player 6 (Orange)
                • Then - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Playerslot 6 <gen>)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Player 7 (Green)
                • Then - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Playerslot 7 <gen>)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Player 8 (Pink)
                • Then - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Playerslot 8 <gen>)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Player 9 (Gray)
                • Then - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Playerslot 9 <gen>)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Player 10 (Light Blue)
                • Then - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Playerslot 10 <gen>)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Player 11 (Dark Green)
                • Then - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Playerslot 11 <gen>)
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Owner of (Picked unit)) Equal to Player 12 (Brown)
                • Then - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Playerslot 12 <gen>)
                • Else - Actions
              • Unit Group - Pick every unit in (Units in Team1Duelposition <gen>) and do (Actions)
                • Loop - Actions
                  • Unit - Make (Picked unit) face (Center of Duel Visibility <gen>) over 0.00 seconds
                  • Unit - Make (Picked unit) Invulnerable
              • Unit Group - Pick every unit in (Units in Team2Duelposition <gen>) and do (Actions)
                • Loop - Actions
                  • Unit - Make (Picked unit) face (Center of Duel Visibility <gen>) over 0.00 seconds
                  • Unit - Make (Picked unit) Invulnerable
            • Else - Actions
      • Set VariableSet Duelist_1 = (Random unit from (Units in Team1Duelposition <gen>))
      • Set VariableSet Duelist_2 = (Random unit from (Units in Team2Duelposition <gen>))
      • Unit - Move Duelist_1 instantly to (Center of Team1 Dueler Position <gen>), facing (Center of Duel Visibility <gen>)
      • Selection - Select Duelist_1 for (Owner of Duelist_1)
      • Special Effect - Create a special effect at (Position of Duelist_1) using Abilities\Spells\Items\AIre\AIreTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Set life of Duelist_1 to 100.00%
      • Unit - Set mana of Duelist_1 to 100.00%
      • Unit - Make Duelist_1 Vulnerable
      • Unit - Move Duelist_2 instantly to (Center of Team2 Dueler Position <gen>), facing (Center of Duel Visibility <gen>)
      • Selection - Select Duelist_2 for (Owner of Duelist_2)
      • Special Effect - Create a special effect at (Position of Duelist_2) using Abilities\Spells\Items\AIre\AIreTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Set life of Duelist_2 to 100.00%
      • Unit - Set mana of Duelist_2 to 100.00%
      • Unit - Make Duelist_2 Vulnerable
      • Game - Display to (All players) the text: 3...
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: 2...
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: 1...
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: Let the duel begin!
      • Unit - Unpause Duelist_1
      • Unit - Unpause Duelist_2
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in Team2 Dueler Position <gen>)) Equal to 0
        • Then - Actions
          • Game - Display to (All players) the text: The duel was cancel...
          • Trigger - Run Duel Quickend <gen> (ignoring conditions)
        • Else - Actions
          • Trigger - Turn on No leaving Duel <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in Team1 Dueler Position <gen>)) Equal to 0
        • Then - Actions
          • Game - Display to (All players) the text: The duel was cancel...
          • Trigger - Run Duel Quickend <gen> (ignoring conditions)
        • Else - Actions
          • Trigger - Turn on No leaving Duel <gen>
How can I renames those 2 variable so the 2 duelist are the one with the highest score one the leaderboard?
Set VariableSet Duelist_1 = (Random unit from (Units in Team1Duelposition <gen>))
Set VariableSet Duelist_2 = (Random unit from (Units in Team2Duelposition <gen>))
thx
 
Level 12
Joined
Nov 3, 2013
Messages
989
How can I renames those 2 variable so the 2 duelist are the one with the highest score one the leaderboard?
Set VariableSet Duelist_1 = (Random unit from (Units in Team1Duelposition <gen>))
Set VariableSet Duelist_2 = (Random unit from (Units in Team2Duelposition <gen>))

So I'm guessing there's variables for the score for the leaderboard? Just loop through each team and compare those, then you'll get which player has the highest score on each team.

You don't have to do anything with the actual leaderboards, you just need the values.
 
Level 2
Joined
Apr 8, 2020
Messages
14
So I'm guessing there's variables for the score for the leaderboard? Just loop through each team and compare those, then you'll get which player has the highest score on each team.

You don't have to do anything with the actual leaderboards, you just need the values.
yes but I'm not sure which fonction you are telling me to use
 
Level 12
Joined
Nov 3, 2013
Messages
989
yes but I'm not sure which fonction you are telling me to use
Make a player group with all players from one team, take one of the players and their score, compare it to the other players in the group.


Player A, Player A Score, if Player B score isn't higher than player A score, remove Player B from the group. If Player B's score is higher then remove player A from the group.

Compare player A (or B is B was higher)'s score with Player C, etc.

Eventually only one player will be left and you take that player as the representative for team 1.


Then you do the same thing for team 2.
 
Level 2
Joined
Apr 8, 2020
Messages
14
Make a player group with all players from one team, take one of the players and their score, compare it to the other players in the group.


Player A, Player A Score, if Player B score isn't higher than player A score, remove Player B from the group. If Player B's score is higher then remove player A from the group.

Compare player A (or B is B was higher)'s score with Player C, etc.

Eventually only one player will be left and you take that player as the representative for team 1.


Then you do the same thing for team 2.
Sry I keep looking in the triggers and I dont find anything like this you gotta be a little more specific because I dont understand this as much as you lol
 
Level 2
Joined
Apr 8, 2020
Messages
14
Make a player group with all players from one team, take one of the players and their score, compare it to the other players in the group.


Player A, Player A Score, if Player B score isn't higher than player A score, remove Player B from the group. If Player B's score is higher then remove player A from the group.

Compare player A (or B is B was higher)'s score with Player C, etc.

Eventually only one player will be left and you take that player as the representative for team 1.


Then you do the same thing for team 2.
  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in (All allies of Player 1 (Red).) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player_Current_Kills[(Player number of (Picked player))] Less than Player_Current_Kills[(Player number of Player 1 (Red))]
              • Player_Current_Kills[(Player number of (Picked player))] Less than Player_Current_Kills[(Player number of Player 2 (Blue))]
              • Player_Current_Kills[(Player number of (Picked player))] Less than Player_Current_Kills[(Player number of Player 3 (Teal))]
              • Player_Current_Kills[(Player number of (Picked player))] Less than Player_Current_Kills[(Player number of Player 4 (Purple))]
              • Player_Current_Kills[(Player number of (Picked player))] Less than Player_Current_Kills[(Player number of Player 5 (Yellow))]
              • Player_Current_Kills[(Player number of (Picked player))] Less than Player_Current_Kills[(Player number of Player 6 (Orange))]
            • Then - Actions
              • Player Group - Remove LastPickedPlayer from (All allies of Player 1 (Red).).
            • Else - Actions
      • Set VariableSet Player_Current_Kills[(Player number of (Owner of (Killing unit)))] = (Player_Current_Kills[(Player number of (Owner of (Killing unit)))] + 1)
I have this for a start but I dont think that is what you meant but is it a good start
 
Level 12
Joined
Nov 3, 2013
Messages
989
I wasn't able to open your map, I'm guessing the reason would be that you're using reforged (which I don't have)

But now I've put together a map illustrating what I meant (maps from older versions should still be possible to open in Reforged I assume).


But in case it doesn't, here's the main trigger for choosing the player with the highest score:

  • duel time
    • Events
      • Time - timer_duel expires
    • Conditions
    • Actions
      • Trigger - Turn off give score <gen>
      • -------- =================== --------
      • -------- compare score between players of team 1 --------
      • Set tempInt = 0
      • For each (Integer A) from 1 to players_team[1], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (player[(Integer A)] slot status) Equal to Is playing
              • score_player[(Integer A)] Greater than tempInt
            • Then - Actions
              • Set tempInt = score_player[(Integer A)]
            • Else - Actions
      • For each (Integer A) from 1 to players_team[1], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (player[(Integer A)] slot status) Equal to Is playing
              • score_player[(Integer A)] Greater than or equal to tempInt
            • Then - Actions
              • Game - Display to (All players) for 30.00 seconds the text: ((Name of player[(Integer A)]) + had the highest score on team 1!)
              • Set duelist[1] = hero_player[(Integer A)]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (duelist[1] is dead) Equal to True
                • Then - Actions
                  • Hero - Instantly revive duelist[1] at duelPoint_team1, Hide revival graphics
                • Else - Actions
                  • Unit - Move duelist[1] instantly to duelPoint_team1, facing 90.00 degrees
              • Unit - Set life of duelist[1] to 100.00%
              • Unit - Set mana of duelist[1] to 100.00%
              • Custom script: exitwhen true
            • Else - Actions
      • -------- =================== --------
      • -------- compare score between players of team 2 --------
      • Set tempInt = 0
      • For each (Integer A) from (players_team[1] + 1) to maxPlayers, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (player[(Integer A)] slot status) Equal to Is playing
              • score_player[(Integer A)] Greater than tempInt
            • Then - Actions
              • Set tempInt = score_player[(Integer A)]
            • Else - Actions
      • For each (Integer A) from (players_team[1] + 1) to maxPlayers, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (player[(Integer A)] slot status) Equal to Is playing
              • score_player[(Integer A)] Greater than or equal to tempInt
            • Then - Actions
              • Game - Display to (All players) for 30.00 seconds the text: ((Name of player[(Integer A)]) + had the highest score on team 2!)
              • Set duelist[2] = hero_player[(Integer A)]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (duelist[2] is dead) Equal to True
                • Then - Actions
                  • Hero - Instantly revive duelist[2] at duelPoint_team2, Hide revival graphics
                • Else - Actions
                  • Unit - Move duelist[2] instantly to duelPoint_team2, facing 270.00 degrees
              • Unit - Set life of duelist[2] to 100.00%
              • Unit - Set mana of duelist[2] to 100.00%
              • Custom script: exitwhen true
            • Else - Actions
      • Unit - Order duelist[1] to Attack duelist[2]
      • Unit - Order duelist[2] to Attack duelist[1]
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked unit) Not equal to duelist[1]
              • (Picked unit) Not equal to duelist[2]
            • Then - Actions
              • Unit - Pause (Picked unit)
            • Else - Actions
      • Trigger - Turn on duel end <gen>
But basically, the idea is pretty simple.

First compare the scores and keep the highest score as a variable. Then loop through the team to see which player had that score—now you've got the player with the highest score

And then you just do the same thing again for the next team.
 

Attachments

  • arena duel team picker system.w3x
    28.8 KB · Views: 29
Last edited:
Level 2
Joined
Apr 8, 2020
Messages
14
I wasn't able to open your map, I'm guessing the reason would be that you're using reforged (which I don't have)

But now I've put together a map illustrating what I meant (maps from older versions should still be possible to open in Reforged I assume).


But in case it doesn't, here's the main trigger for choosing the player with the highest score:

  • duel time
    • Events
      • Time - timer_duel expires
    • Conditions
    • Actions
      • Trigger - Turn off give score <gen>
      • -------- =================== --------
      • -------- compare score between players of team 1 --------
      • Set tempInt = 0
      • For each (Integer A) from 1 to players_team[1], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (player[(Integer A)] slot status) Equal to Is playing
              • score_player[(Integer A)] Greater than tempInt
            • Then - Actions
              • Set tempInt = score_player[(Integer A)]
            • Else - Actions
      • For each (Integer A) from 1 to players_team[1], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (player[(Integer A)] slot status) Equal to Is playing
              • score_player[(Integer A)] Greater than or equal to tempInt
            • Then - Actions
              • Game - Display to (All players) for 30.00 seconds the text: ((Name of player[(Integer A)]) + had the highest score on team 1!)
              • Set duelist[1] = hero_player[(Integer A)]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (duelist[1] is dead) Equal to True
                • Then - Actions
                  • Hero - Instantly revive duelist[1] at duelPoint_team1, Hide revival graphics
                • Else - Actions
                  • Unit - Move duelist[1] instantly to duelPoint_team1, facing 90.00 degrees
              • Unit - Set life of duelist[1] to 100.00%
              • Unit - Set mana of duelist[1] to 100.00%
              • Custom script: exitwhen true
            • Else - Actions
      • -------- =================== --------
      • -------- compare score between players of team 2 --------
      • Set tempInt = 0
      • For each (Integer A) from (players_team[1] + 1) to maxPlayers, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (player[(Integer A)] slot status) Equal to Is playing
              • score_player[(Integer A)] Greater than tempInt
            • Then - Actions
              • Set tempInt = score_player[(Integer A)]
            • Else - Actions
      • For each (Integer A) from (players_team[1] + 1) to maxPlayers, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (player[(Integer A)] slot status) Equal to Is playing
              • score_player[(Integer A)] Greater than or equal to tempInt
            • Then - Actions
              • Game - Display to (All players) for 30.00 seconds the text: ((Name of player[(Integer A)]) + had the highest score on team 2!)
              • Set duelist[2] = hero_player[(Integer A)]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (duelist[2] is dead) Equal to True
                • Then - Actions
                  • Hero - Instantly revive duelist[2] at duelPoint_team2, Hide revival graphics
                • Else - Actions
                  • Unit - Move duelist[2] instantly to duelPoint_team2, facing 270.00 degrees
              • Unit - Set life of duelist[2] to 100.00%
              • Unit - Set mana of duelist[2] to 100.00%
              • Custom script: exitwhen true
            • Else - Actions
      • Unit - Order duelist[1] to Attack duelist[2]
      • Unit - Order duelist[2] to Attack duelist[1]
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked unit) Not equal to duelist[1]
              • (Picked unit) Not equal to duelist[2]
            • Then - Actions
              • Unit - Pause (Picked unit)
            • Else - Actions
      • Trigger - Turn on duel end <gen>
But basically, the idea is pretty simple.

First compare the scores and keep the highest score as a variable. Then loop through the team to see which player had that score—now you've got the player with the highest score

And then you just do the same thing again for the next team.
Alright thats almost what I want thanx very much. So I tryied to include it with my map but I got 2 problems, team2 are not picking any hero for duel and only the score for Player 1 reset on the leaderboard. Any idea why?
here are the 2 trigger
  • make the teams
    • Events
      • Time - Elapsed game time is 30.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Player Group - Add player[(Integer A)] to tempPlayerGroup
            • Else - Actions
      • Set VariableSet maxPlayers = (Number of players in tempPlayerGroup)
      • Player Group - Pick every player in (All allies of Player 1 (Red).) and do (Player Group - Add (Picked player) to playerGroup_team[1])
      • Player Group - Pick every player in (All allies of Player 7 (Green).) and do (Player Group - Add (Picked player) to playerGroup_team[2])
      • -------- ========================= --------
      • -------- Next give every player a number (player[1], player[2], player[3] etc. --------
      • -------- ========================= --------
      • Set VariableSet tempInt = 0
      • Player Group - Pick every player in playerGroup_team[1] and do (Actions)
        • Loop - Actions
          • Set VariableSet tempInt = (tempInt + 1)
          • Set VariableSet player[tempInt] = (Picked player)
      • Player Group - Pick every player in playerGroup_team[2] and do (Actions)
        • Loop - Actions
          • Set VariableSet tempInt = (tempInt + 1)
          • Set VariableSet player[tempInt] = (Picked player)
      • -------- ======================= --------
      • Set VariableSet players_team[1] = (Number of players in playerGroup_team[1])
      • Set VariableSet players_team[2] = (Number of players in playerGroup_team[2])
      • -------- give every hero a number matching their player --------
      • For each (Integer A) from 1 to maxPlayers, do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units owned by player[(Integer A)] matching (((Matching unit) is A Hero) Equal to True).) and do (Set VariableSet hero_player[(Integer A)] = (Picked unit))
  • Duelist Pick
    • Events
      • Time - Dueltimer expires
    • Conditions
    • Actions
      • Set VariableSet tempInt = 0
      • For each (Integer A) from 1 to players_team[1], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (player[(Integer A)] slot status) Equal to Is playing
              • (player[(Integer A)] is an ally of Player 1 (Red).) Equal to True
              • Player_Current_Kills[(Integer A)] Greater than tempInt
            • Then - Actions
              • Set VariableSet tempInt = Player_Current_Kills[(Integer A)]
            • Else - Actions
      • For each (Integer A) from 1 to players_team[1], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (player[(Integer A)] slot status) Equal to Is playing
              • (player[(Integer A)] is an ally of Player 1 (Red).) Equal to True
              • Player_Current_Kills[(Integer A)] Greater than or equal to tempInt
            • Then - Actions
              • Game - Display to (All players) for 30.00 seconds the text: ((Name of player[(Integer A)]) + had the highest score on team 1!)
              • Set VariableSet duelist[1] = hero_player[(Integer A)]
              • Custom script: exitwhen true
            • Else - Actions
      • Set VariableSet tempInt = 0
      • For each (Integer A) from 1 to players_team[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (player[(Integer A)] slot status) Equal to Is playing
              • (player[(Integer A)] is an ally of Player 7 (Green).) Equal to True
              • Player_Current_Kills[(Integer A)] Greater than tempInt
            • Then - Actions
              • Set VariableSet tempInt = Player_Current_Kills[(Integer A)]
            • Else - Actions
      • For each (Integer A) from 1 to players_team[2], do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (player[(Integer A)] slot status) Equal to Is playing
              • (player[(Integer A)] is an ally of Player 7 (Green).) Equal to True
              • Player_Current_Kills[(Integer A)] Greater than or equal to tempInt
            • Then - Actions
              • Game - Display to (All players) for 30.00 seconds the text: ((Name of player[(Integer A)]) + had the highest score on team 2!)
              • Set VariableSet duelist[2] = hero_player[(Integer A)]
              • Custom script: exitwhen true
            • Else - Actions
      • Unit - Move duelist[1] instantly to (Center of Team1 Dueler Position <gen>), facing (Center of Duel Visibility <gen>)
      • Selection - Select duelist[1] for (Owner of duelist[1])
      • Special Effect - Create a special effect at (Position of duelist[1]) using Abilities\Spells\Items\AIre\AIreTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Set life of duelist[1] to 100.00%
      • Unit - Set mana of duelist[1] to 100.00%
      • Unit - Make duelist[1] Vulnerable
      • Unit - Move duelist[2] instantly to (Center of Team2 Dueler Position <gen>), facing (Center of Duel Visibility <gen>)
      • Selection - Select duelist[2] for (Owner of duelist[2])
      • Special Effect - Create a special effect at (Position of duelist[2]) using Abilities\Spells\Items\AIre\AIreTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Set life of duelist[2] to 100.00%
      • Unit - Set mana of duelist[2] to 100.00%
      • Unit - Make duelist[2] Vulnerable
      • Game - Display to (All players) the text: 3...
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: 2...
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: 1...
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: Let the duel begin!
      • Player Group - Pick every player in playerGroup_team[1] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked player) Not equal to Neutral Victim
              • (Picked player) Not equal to Neutral Extra
              • (Picked player) Not equal to Neutral Passive
            • Then - Actions
              • Set VariableSet Player_Current_Kills[(Player number of (Picked player))] = 0
              • Set VariableSet LastPickedPlayer = (Picked player)
              • Player Group - Pick every player in playerGroup_team[1] and do (Actions)
                • Loop - Actions
                  • Leaderboard - Change the value for LastPickedPlayer in Leaderboard[(Player number of (Picked player))] to Player_Current_Kills[(Player number of LastPickedPlayer)]
            • Else - Actions
      • Player Group - Pick every player in playerGroup_team[2] and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked player) Not equal to Neutral Victim
              • (Picked player) Not equal to Neutral Extra
              • (Picked player) Not equal to Neutral Passive
            • Then - Actions
              • Set VariableSet Player_Current_Kills[(Player number of (Picked player))] = 0
              • Set VariableSet LastPickedPlayer = (Picked player)
              • Player Group - Pick every player in playerGroup_team[2] and do (Actions)
                • Loop - Actions
                  • Leaderboard - Change the value for LastPickedPlayer in Leaderboard[(Player number of (Picked player))] to Player_Current_Kills[(Player number of LastPickedPlayer)]
            • Else - Actions
      • Unit - Unpause duelist[1]
      • Unit - Unpause duelist[2]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in Team2 Dueler Position <gen>)) Equal to 0
        • Then - Actions
          • Game - Display to (All players) the text: The duel was cancel...
          • Trigger - Run Duel Quickend <gen> (ignoring conditions)
        • Else - Actions
          • Trigger - Turn on No leaving Duel <gen>
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in Team1 Dueler Position <gen>)) Equal to 0
        • Then - Actions
          • Game - Display to (All players) the text: The duel was cancel...
          • Trigger - Run Duel Quickend <gen> (ignoring conditions)
        • Else - Actions
          • Trigger - Turn on No leaving Duel <gen>
 
Level 12
Joined
Nov 3, 2013
Messages
989
  • For each (Integer A) from 1 to players_team[2], do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (player[(Integer A)] slot status) Equal to Is playing
          • (player[(Integer A)] is an ally of Player 7 (Green).) Equal to True
          • Player_Current_Kills[(Integer A)] Greater than tempInt
        • Then - Actions
          • Set VariableSet tempInt = Player_Current_Kills[(Integer A)]
        • Else - Actions
          • For each (Integer A) from 1 to players_team[2], do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (player[(Integer A)] slot status) Equal to Is playing
                  • (player[(Integer A)] is an ally of Player 7 (Green).) Equal to True
                  • Player_Current_Kills[(Integer A)] Greater than or equal to tempInt
                • Then - Actions
                  • Game - Display to (All players) for 30.00 seconds the text: ((Name of player[(Integer A)]) + had the highest score on team 2!)
                  • Set VariableSet duelist[2] = hero_player[(Integer A)]
                  • Custom script: exitwhen true
                • Else - Actions
I only looked over it quickly, but the issue should be that you're starting from 1 again on the second team.
  • For each (Integer A) from 1 to players_team[2], do (Actions)
With how I did it I numbered every player from 1 to max, so if we say 12 players is the max, then players 1 to 6 are from team 1 and then players 7 to 12 are from team 2.

But the size of both teams are 6, so when you loop through from 1 to number of players of team 2, it becomes 1 to 6, which are the players on team 1 again.


How I did it was this way:

  • For each (Integer A) from players_team[1] + 1 to players_team[1] + players_team[2], do (Actions)
That way it doesn't matter how many players there are, but you could also just set the numbers manually.
  • For each (Integer A) from 7 to 12, do (Actions)
Also, (player[(Integer A)] is an ally of Player 1 (Red).) Equal to True and (player[(Integer A)] is an ally of Player 7 (Green).) Equal to True are unnecessary since you're already picking from team 1 and team 2
 
Last edited:
Level 2
Joined
Apr 8, 2020
Messages
14
  • How I did it was this way:
  • [LIST]
  • [*][IMG]https://www.hiveworkshop.com/styles/default/ratrigger/if.gif[/IMG]For each (Integer A) from players_team[1] + 1 to players_team[1] + players_team[2], do (Actions)
  • [/LIST]
So I changed the trigger at those 2 spot to the longer one that you wrote. Now I think it works for selecting but there is no hero moved to the arena anymore and therefore the duel cancels. I just cant see why
 
Level 12
Joined
Nov 3, 2013
Messages
989
So I changed the trigger at those 2 spot to the longer one that you wrote. Now I think it works for selecting but there is no hero moved to the arena anymore and therefore the duel cancels. I just cant see why

So
  • Game - Display to (All players) for 30.00 seconds the text: ((Name of player[(Integer A)]) + had the highest score on team 1!)
and
  • Game - Display to (All players) for 30.00 seconds the text: ((Name of player[(Integer A)]) + had the highest score on team 2!)
says which two players had the highest score, but no hero gets teleported into the arena?

That's odd...


I'm not seeing any problems with either of your two triggers (besides the one I mentioned before, but you fixed it)


Maybe try and see what happens if you disable
  • (player[(Integer A)] slot status) Equal to Is playing
It could be that it doesn't work because you're testing the map, and therefore there's only one player, but it will work when played online.
 
Status
Not open for further replies.
Top