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

Simple trigger does not work

Status
Not open for further replies.
Level 6
Joined
Mar 17, 2012
Messages
105
  • Unit Group - Pick every unit in (Units in CZ Farmland <gen> matching (((Unit-type of (Picked unit)) Not equal to Defender Rally) or ((Unit-type of (Picked unit)) Not equal to Offender Rally))) and do (Actions)
    • Loop - Actions
      • Unit - Remove (Picked unit) from the game
This trigger should be removing every unit in the region except the Defender Rally and the Offender Rally, right? However, it does not work. I don't think the remainder of the trigger is relevant, but here it is, just in case:

  • EndBattleOffenderVictory
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Defender Rally
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • OngoingBattle[1] Equal to 1
        • Then - Actions
          • Unit - Unhide TravelerUnit[(Player number of (Owner of (Killing unit)))]
          • Unit - Unhide TravelerUnit[(Player number of (Owner of (Dying unit)))]
          • Unit - Create 1 Defender Rally for Neutral Passive at (Position of (Dying unit)) facing Default building facing degrees
          • Unit - Set the custom value of (Last created unit) to 1
          • Unit Group - Pick every unit in (Units of type Offender Rally) and do (If ((Custom value of (Picked unit)) Equal to 1) then do (Unit - Change ownership of (Picked unit) to Neutral Passive and Change color) else do (Do nothing))
          • Game - Display to (Player group((Owner of (Killing unit)))) the text: You have won this b...
          • Game - Display to (Player group((Owner of (Dying unit)))) the text: You have lost this ...
          • Set ArmySize[(Player number of (Owner of (Killing unit)))] = (Number of units in (Units in CZ Farmland <gen> owned by (Owner of TravelerUnit[(Player number of (Owner of (Killing unit)))])))
          • Set ArmySize[(Player number of (Owner of (Dying unit)))] = (Number of units in (Units in CZ Farmland <gen> owned by (Owner of TravelerUnit[(Player number of (Owner of (Dying unit)))])))
          • Set VillagerCount[(Player number of (Owner of (Killing unit)))] = (Number of units in (Units owned by (Owner of (Killing unit)) of type Villager))
          • Set MenAtArms_Count[(Player number of (Owner of (Killing unit)))] = (Number of units in (Units owned by (Owner of (Killing unit)) of type Man at Arms))
          • Set VillagerCount[(Player number of (Owner of (Dying unit)))] = (Number of units in (Units owned by (Owner of (Dying unit)) of type Villager))
          • Set MenAtArms_Count[(Player number of (Owner of (Dying unit)))] = (Number of units in (Units owned by (Owner of (Dying unit)) of type Man at Arms))
          • Player - Set (Owner of (Killing unit)) Food used to ArmySize[(Player number of (Owner of (Killing unit)))]
          • Player - Set (Owner of (Dying unit)) Food used to ArmySize[(Player number of (Owner of (Dying unit)))]
          • Wait 0.01 seconds
          • Unit Group - Pick every unit in (Units in CZ Farmland <gen> matching ((Custom value of (Picked unit)) Equal to 0)) and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
          • Player Group - Add (Owner of (Killing unit)) to PlayersNotInBattle
          • Player Group - Add (Owner of (Dying unit)) to PlayersNotInBattle
          • Set OngoingBattle[1] = 0
        • Else - Actions
          • Do nothing
 
Status
Not open for further replies.
Top