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

[Trigger] Need a help here.

Status
Not open for further replies.
Level 14
Joined
Nov 30, 2013
Messages
926
I'm getting tired fixing my duel trigger. :goblin_cry:
The duel suppose to choose a random player from each teams. (except player 11 and 12.)

  • Duel Sets
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in (Player group((Random player from (All allies of Player 6 (Orange))))) 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 Player 12 (Brown)
            • Then - Actions
              • Set DuelPlayerPicked[DuelPlayerT[2]] = (Picked player)
            • Else - Actions
      • Player Group - Pick every player in (Player group((Random player from (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
              • (Picked player) Not equal to Player 11 (Dark Green)
            • Then - Actions
              • Set DuelPlayerPicked[DuelPlayerT[1]] = (Picked player)
            • Else - Actions
      • -------- Transporting --------
      • Player Group - Pick every player in (All allies of Player 6 (Orange)) 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 DuelPlayerPicked[DuelPlayerT[2]]
              • (Picked player) Not equal to Neutral Hostile
              • (Picked player) Not equal to Neutral Passive
              • (Picked player) Not equal to Neutral Victim
              • (Picked player) Not equal to Neutral Extra
            • Then - Actions
              • Unit Group - Pick every unit in (Units in (Playable map area) owned by (Picked player)) and do (Actions)
                • Loop - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Team 2 Spawn <gen>)
            • Else - 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
              • (Picked player) Not equal to DuelPlayerPicked[DuelPlayerT[1]]
              • (Picked player) Not equal to Neutral Hostile
              • (Picked player) Not equal to Neutral Passive
              • (Picked player) Not equal to Neutral Victim
              • (Picked player) Not equal to Neutral Extra
            • Then - Actions
              • Unit Group - Pick every unit in (Units in (Playable map area) owned by (Picked player)) and do (Actions)
                • Loop - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Team 1 Spawn <gen>)
            • Else - Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units in (Playable map area) 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 in PlayerInTrap) Equal to True
                • Then - Actions
                  • Unit Group - Remove (Picked unit) from PlayerInTrap
                • Else - Actions
          • Camera - Pan camera for (Picked player) to (Center of Hero Arena <gen>) over 1.50 seconds
      • Unit Group - Pick every unit in (Units owned by DuelPlayerPicked[DuelPlayerT[1]]) 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
              • Set DuelUnit[1] = (Picked unit)
              • Unit - Set life of (Picked unit) to 100.00%
              • Unit - Set mana of (Picked unit) to 100.00%
              • Unit - Move (Picked unit) instantly to (Center of Team 1 Arena Spawn <gen>), facing (Center of Team 2 Arena Spawn <gen>)
            • Else - Actions
      • Unit Group - Pick every unit in (Units owned by DuelPlayerPicked[DuelPlayerT[2]]) 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
              • Set DuelUnit[2] = (Picked unit)
              • Unit - Set life of (Picked unit) to 100.00%
              • Unit - Set mana of (Picked unit) to 100.00%
              • Unit - Move (Picked unit) instantly to (Center of Team 2 Arena Spawn <gen>), facing (Center of Team 1 Arena Spawn <gen>)
            • Else - Actions
      • Game - Display to (All players) the text: ((Name of DuelPlayerPicked[DuelPlayerT[1]]) + ( VS + (Name of DuelPlayerPicked[DuelPlayerT[2]])))
      • Trigger - Run Revival Hero <gen> (checking conditions)
      • Wait 3.00 seconds
      • Game - Display to (All players) the text: 3
      • Sound - Play BattleNetTick <gen>
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: 2
      • Sound - Play BattleNetTick <gen>
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: 1
      • Sound - Play BattleNetTick <gen>
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: Go!
      • Trigger - Run Duel Start <gen> (checking conditions)
      • Sound - Play ArrangedTeamInvitation <gen>


The problem was that the gametext showed like this "(Player's name) VS (none)" or "(none) VS (none)"
Another was if the trigger run like this for example "bear_369 VS Computer", my hero, computer's hero, or both haven't teleported to the arena.

And last, all units in the map was being teleported to the Team 1's Base.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Store each player in a player group variable based on the team they are in.
Don't add player 11 or 12 to the groups.
Never destroy this player group. Don't remove any players unless they leave game.

When this trigger starts choose a random player from teamPlayers1 and random player from teamPlayers2. Then make them fight.

It will then be fixed.
 
Level 14
Joined
Nov 30, 2013
Messages
926
Changed the trigger but there's still a problem.

  • Duel Sets
    • Events
    • Conditions
    • Actions
      • Set DuelPlayerPicked[1] = (Random player from TeamPlayer[1])
      • Set DuelPlayerPicked[2] = (Random player from TeamPlayer[2])
      • -------- Transporting --------
      • Player Group - Pick every player in (All allies of Player 6 (Orange)) 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 DuelPlayerPicked[2]
              • (Picked player) Not equal to Neutral Hostile
              • (Picked player) Not equal to Neutral Passive
              • (Picked player) Not equal to Neutral Victim
              • (Picked player) Not equal to Neutral Extra
            • Then - Actions
              • Unit Group - Pick every unit in (Units in (Playable map area) owned by (Picked player)) and do (Actions)
                • Loop - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Team 2 Spawn <gen>)
            • Else - 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
              • (Picked player) Not equal to DuelPlayerPicked[1]
              • (Picked player) Not equal to Neutral Hostile
              • (Picked player) Not equal to Neutral Passive
              • (Picked player) Not equal to Neutral Victim
              • (Picked player) Not equal to Neutral Extra
            • Then - Actions
              • Unit Group - Pick every unit in (Units in (Playable map area) owned by (Picked player)) and do (Actions)
                • Loop - Actions
                  • Unit - Move (Picked unit) instantly to (Center of Team 1 Spawn <gen>)
            • Else - Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Unit Group - Pick every unit in (Units in (Playable map area) 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 in PlayerInTrap) Equal to True
                • Then - Actions
                  • Unit Group - Remove (Picked unit) from PlayerInTrap
                • Else - Actions
          • Camera - Pan camera for (Picked player) to (Center of Hero Arena <gen>) over 1.50 seconds
      • Unit Group - Pick every unit in (Units owned by DuelPlayerPicked[1]) 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
              • Set DuelUnit[1] = (Picked unit)
              • Unit - Set life of (Picked unit) to 100.00%
              • Unit - Set mana of (Picked unit) to 100.00%
              • Unit - Move DuelUnit[1] instantly to (Center of Team 1 Arena Spawn <gen>), facing (Center of Team 2 Arena Spawn <gen>)
            • Else - Actions
      • Unit Group - Pick every unit in (Units owned by DuelPlayerPicked[2]) 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
              • Set DuelUnit[2] = (Picked unit)
              • Unit - Set life of (Picked unit) to 100.00%
              • Unit - Set mana of (Picked unit) to 100.00%
              • Unit - Move DuelUnit[2] instantly to (Center of Team 2 Arena Spawn <gen>), facing (Center of Team 1 Arena Spawn <gen>)
            • Else - Actions
      • Game - Display to (All players) the text: ((Name of DuelPlayerPicked[1]) + ( VS + (Name of DuelPlayerPicked[2])))
      • Trigger - Run Revival Hero <gen> (checking conditions)
      • Wait 3.00 seconds
      • Game - Display to (All players) the text: 3
      • Sound - Play BattleNetTick <gen>
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: 2
      • Sound - Play BattleNetTick <gen>
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: 1
      • Sound - Play BattleNetTick <gen>
      • Wait 1.00 seconds
      • Game - Display to (All players) the text: Go!
      • Trigger - Run Duel Start <gen> (checking conditions)
      • Sound - Play ArrangedTeamInvitation <gen>


The problem was that the gametext said "(Me) VS (None)"
How can I fix it?
 
Level 14
Joined
Nov 30, 2013
Messages
926
Here you go.
  • Player
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All allies of Player 6 (Orange)) 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 Player 12 (Brown)
            • Then - Actions
              • Player Group - Add (Picked player) to TeamPlayer[2]
            • Else - 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
              • (Picked player) Not equal to Player 11 (Dark Green)
            • Then - Actions
              • Player Group - Add (Picked player) to TeamPlayer[1]
            • Else - Actions
 
Status
Not open for further replies.
Top