• 🏆 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] Serious bug related to not picking a race in my game. SOLVED

Level 8
Joined
Mar 15, 2007
Messages
230
So in my map, after 1 second has elapsed, each player will receive a dialog to pick his or her race. The dialog functions properly, as does each dialog button. What's supposed to happen is that if one does not pick his race after 10 seconds, a race will randomly be assigned to him, and THEN melee victory conditions will be applied. What actually happens is that is that if a race isn't chosen after 10 seconds, no units are generated and that player loses. I have no idea what is wrong with my trigger. This is a very serious and embarrassing bug. Please help!

  • No Pick Race
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • IntRace[(Integer A)] Equal to 0
            • Then - Actions
              • Set VariableSet IntRace[(Integer A)] = (Random integer number between 1 and 6)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • IntRace[(Integer A)] Equal to 1
                • Then - Actions
                  • Unit - Create 1 Castle (Norsemen) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                  • Unit - Create 3 Peasant (Norsemen) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                  • Unit - Create 1 Hero's Soul (Norsemen) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                  • Dialog - Hide PickRace for (Triggering player)
                  • Selection - Select (Last created unit) for (Triggering player)
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • IntRace[(Integer A)] Equal to 2
                    • Then - Actions
                      • Unit - Create 1 Necropolis (Empire) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                      • Unit - Create 3 Slave (Empire) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                      • Unit - Create 1 Hero's Soul (Empire) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                      • Dialog - Hide PickRace for (Triggering player)
                      • Selection - Select (Last created unit) for (Triggering player)
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • IntRace[(Integer A)] Equal to 3
                        • Then - Actions
                          • Unit - Create 1 Stronghold (Orc) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                          • Unit - Create 3 Peon (Orc) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                          • Unit - Create 1 Hero's Soul (Orc) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                          • Dialog - Hide PickRace for (Triggering player)
                          • Selection - Select (Last created unit) for (Triggering player)
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • IntRace[(Integer A)] Equal to 4
                            • Then - Actions
                              • Unit - Create 1 Fortress (Drow) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                              • Unit - Create 3 Serf (Drow) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                              • Unit - Create 1 Hero's Soul (Drow) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                              • Dialog - Hide PickRace for (Triggering player)
                              • Selection - Select (Last created unit) for (Triggering player)
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • IntRace[(Integer A)] Equal to 5
                                • Then - Actions
                                  • Unit - Create 1 Castle (Templar) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                                  • Unit - Create 3 Artisan (Templar) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                                  • Unit - Create 1 Hero's Soul (Templar) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                                  • Dialog - Hide PickRace for (Triggering player)
                                  • Selection - Select (Last created unit) for (Triggering player)
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • IntRace[(Integer A)] Equal to 6
                                    • Then - Actions
                                      • Unit - Create 1 Lair (Lizard) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                                      • Unit - Create 3 Drudge (Lizard) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                                      • Unit - Create 1 Hero's Soul (Lizard) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                                      • Dialog - Hide PickRace for (Triggering player)
                                      • Selection - Select (Last created unit) for (Triggering player)
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • IntRace[(Integer A)] Equal to 7
                                        • Then - Actions
                                          • Unit - Create 1 Castle (Black Legion) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                                          • Unit - Create 3 Laborer (Black Legion) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                                          • Unit - Create 1 Hero's Soul (Black Legion) for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
                                          • Dialog - Hide PickRace for (Triggering player)
                                          • Selection - Select (Last created unit) for (Triggering player)
                                        • Else - Actions
            • Else - Actions
      • Wait 1.00 game-time seconds
      • Melee Game - Enforce victory/defeat conditions (for all players)
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
Let me guess, you noticed that you used "Triggering Player" instead of "Player(Integer A)".

PD: You can make the trigger shorter by putting the hide dialog and select the hero outside and after those if/then/else; and I noticed that the variable IntRace has actions if the value is 7, but is a ramdon number between 1 and 6.
 
Last edited:
Top