• 🏆 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] Round Problem

Status
Not open for further replies.
Level 14
Joined
Nov 30, 2013
Messages
926
I been having a problem from my trigger.
I try to make a trigger that if the player's base destroyed.
It will respawn again and again until it reach the final round.
Here's the trigger.
  • Base Kill First
    • Events
      • Unit - A unit Dies
    • 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
              • (Dying unit) Equal to UnitBase[(Integer A)]
              • FirstPlayerDefeat Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CurrentRound[(Player number of (Owner of (Dying unit)))] Not equal to RoundMaximun
                  • CurrentRound[(Player number of (Owner of (Killing unit)))] Not equal to RoundMaximun
                • Then - Actions
                  • Game - Display to (All players) the text: ((Name of (Owner of (Killing unit))) + ( has defeated + ((Name of (Owner of (Dying unit))) + in a first place.)))
                  • Sound - Play Hint <gen>
                  • Trigger - Turn on Base Kill <gen>
                  • Wait 0.50 seconds
                  • Set FirstPlayerDefeat = True
                  • Wait 1.50 seconds
                  • Set CurrentRound[(Player number of (Owner of (Dying unit)))] = (CurrentRound[(Player number of (Owner of (Dying unit)))] + 1)
                  • Set CurrentRound[(Player number of (Owner of (Killing unit)))] = (CurrentRound[(Player number of (Owner of (Killing unit)))] + 1)
                  • Game - Display to (Player group((Owner of (Dying unit)))) the text: (|cFFFF8040Round|r + (String(CurrentRound[(Player number of (Owner of (Dying unit)))])))
                  • Game - Display to (Player group((Owner of (Killing unit)))) the text: (|cFFFF8040Round|r + (String(CurrentRound[(Player number of (Owner of (Killing unit)))])))
                  • Unit - Create 1 Empty Base for (Owner of (Dying unit)) at ((Owner of (Dying unit)) start location) facing Default building facing degrees
                  • Set UnitBase[(Player number of (Owner of (Dying unit)))] = (Last created unit)
                  • Unit - Create 1 Empty Base for (Owner of (Killing unit)) at ((Owner of (Killing unit)) start location) facing Default building facing degrees
                  • Set UnitBase[(Player number of (Owner of (Killing unit)))] = (Last created unit)
                  • Player - Set (Owner of (Dying unit)) Current gold to 100
                  • Player - Set (Owner of (Killing unit)) Current gold to 100
                  • Player - Set (Owner of (Dying unit)) Current lumber to 0
                  • Player - Set (Owner of (Killing unit)) Current lumber to 0
                • Else - Actions
                  • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit))) and do (Actions)
                    • Loop - Actions
                      • Unit - Remove (Picked unit) from the game
                  • Unit Group - Pick every unit in (Units owned by (Owner of (Killing unit))) and do (Actions)
                    • Loop - Actions
                      • Unit - Remove (Picked unit) from the game
                  • Game - Display to (Player group((Owner of (Dying unit)))) the text: |cFFFF0000You have ...
                  • Game - Display to (Player group((Owner of (Killing unit)))) the text: |cFF00FF00You have ...
                  • Set PlayerFinishedGame[(Player number of (Owner of (Dying unit)))] = True
                  • Set PlayerFinishedGame[(Player number of (Owner of (Killing unit)))] = True
            • Else - Actions
2nd one.
  • Base Kill
    • Events
      • Unit - A unit Dies
    • 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
              • (Dying unit) Equal to UnitBase[(Integer A)]
              • FirstPlayerDefeat Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • CurrentRound[(Player number of (Owner of (Dying unit)))] Less than RoundMaximun
                  • CurrentRound[(Player number of (Owner of (Killing unit)))] Less than RoundMaximun
                • Then - Actions
                  • Game - Display to (All players) the text: ((Name of (Owner of (Killing unit))) + ( has defeated + (Name of (Owner of (Dying unit)))))
                  • Sound - Play Hint <gen>
                  • Wait 2.00 seconds
                  • Set CurrentRound[(Player number of (Owner of (Dying unit)))] = (CurrentRound[(Player number of (Owner of (Dying unit)))] + 1)
                  • Set CurrentRound[(Player number of (Owner of (Killing unit)))] = (CurrentRound[(Player number of (Owner of (Killing unit)))] + 1)
                  • Game - Display to (Player group((Owner of (Dying unit)))) the text: (|cFFFF8040Round|r + (String(CurrentRound[(Player number of (Owner of (Dying unit)))])))
                  • Game - Display to (Player group((Owner of (Killing unit)))) the text: (|cFFFF8040Round|r + (String(CurrentRound[(Player number of (Owner of (Killing unit)))])))
                  • Unit - Create 1 Empty Base for (Owner of (Dying unit)) at ((Owner of (Dying unit)) start location) facing Default building facing degrees
                  • Set UnitBase[(Player number of (Owner of (Dying unit)))] = (Last created unit)
                  • Unit - Create 1 Empty Base for (Owner of (Killing unit)) at ((Owner of (Killing unit)) start location) facing Default building facing degrees
                  • Set UnitBase[(Player number of (Owner of (Killing unit)))] = (Last created unit)
                  • Player - Set (Owner of (Dying unit)) Current gold to 100
                  • Player - Set (Owner of (Killing unit)) Current gold to 100
                  • Player - Set (Owner of (Dying unit)) Current lumber to 0
                  • Player - Set (Owner of (Killing unit)) Current lumber to 0
                • Else - Actions
                  • Unit Group - Pick every unit in (Units owned by (Owner of (Dying unit))) and do (Actions)
                    • Loop - Actions
                      • Unit - Remove (Picked unit) from the game
                  • Unit Group - Pick every unit in (Units owned by (Owner of (Killing unit))) and do (Actions)
                    • Loop - Actions
                      • Unit - Remove (Picked unit) from the game
                  • Game - Display to (Player group((Owner of (Dying unit)))) the text: |cFFFF0000You have ...
                  • Game - Display to (Player group((Owner of (Killing unit)))) the text: |cFF00FF00You have ...
                  • Set PlayerFinishedGame[(Player number of (Owner of (Dying unit)))] = True
                  • Set PlayerFinishedGame[(Player number of (Owner of (Killing unit)))] = True
            • Else - Actions
The problem of this trigger was it can't spawn player base.
Only the gametext appear as "(Owner of Dying unit) has defeated (Owner of Killing Unit)"
 
Status
Not open for further replies.
Top