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

No flying units in region

Status
Not open for further replies.
Level 6
Joined
Apr 15, 2012
Messages
205
How do I make a trigger that triggers when there are no flying units in a certain region?

I have tried this trigger:

  • Viking Transform
    • Events
      • Unit - Any Unit dies
    • Local Variables
      • Viking Group = (Empty unit group) <Unit Group>
      • Total Units = (Empty unit group) <Unit Group>
    • Conditions
    • Actions
      • Variable - Set Viking Group = (Viking (Fighter Mode) units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)
      • Variable - Set Total Units = (Any units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)
      • Unit Group - Remove all units in Viking Group from Total Units
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • Total Units == (Any units in (Entire map) owned by player Any Player matching Required: Ground; Excluded: Missile, Dead, Hidden, with at most Any Amount)
        • Then
          • Unit - Order all units in Viking Group to (Viking - Assault Mode) (Replace Existing Orders)
        • Else
          • UI - Display "dddddddddd" for (All players) to Subtitle area
It's not working. I have tried to use it and it always does the "Else" action.
 
Last edited:
Level 6
Joined
Apr 15, 2012
Messages
205
It's a rectangular region, is there no other way to do it? with validators maybe?

When I
  • Unit Group - Remove all units in Viking Group from Total Units
Does it put a new value in the 'Total Units' variable or does it even change?
 
Level 6
Joined
Apr 15, 2012
Messages
205
  • Vikings
    • Events
      • Unit - Any Unit dies
    • Local Variables
      • Vikings = (Empty unit group) <Unit Group>
      • Air Units = (Empty unit group) <Unit Group>
    • Conditions
    • Actions
      • Variable - Set Vikings = (Viking (Fighter Mode) units in (Entire map) owned by player Any Player matching Excluded: Missile, Dead, Hidden, with at most Any Amount)
      • Variable - Set Air Units = (Any units in (Entire map) owned by player Any Player matching Required: Air; Excluded: Missile, Dead, Hidden, with at most Any Amount)
      • General - If (Conditions) then do (Actions) else do (Actions)
        • If
          • (Number of Living units in Vikings) == (Number of Living units in Air Units)
        • Then
          • UI - Display "IT WORKS" for (All players) to Subtitle area
        • Else
          • UI - Display ":(((" for (All players) to Subtitle area
          • UI - Display (Text((Number of Living units in Vikings))) for (All players) to Subtitle area
          • UI - Display (Text((Number of Living units in Air Units))) for (All players) to Subtitle area
it works!
 
Status
Not open for further replies.
Top