• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Solved] Unit group including air units even when excluded by condition? (1.28)

Status
Not open for further replies.
Level 10
Joined
May 31, 2019
Messages
139
I have a trigger that damages enemy/neutral units in an area. It uses this variable to get the units that are to be damaged.

JASS:
Set tmpUnitGroup = (Units within 80.00 of tmpPoint matching ((((Matching unit) is A flying unit) Equal to False) and ((((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True) or ((Owner of (Matching unit)) Equal to Neutral Passive))))

This mostly works, the units in the group get damaged, but for some reason air units appear to be included, even though i thought the condition would exclude them. I made sure I had nothing else around that could cause damage to air units. Anyone know what the issue might be?
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,895
"(Matching unit) is A flying unit) Equal to False)" excludes air units, whether neutral or not, doesn't matter, the condition is clear.
What might be happening is your flying units not being considered flying ones, need to check object data.
 
Level 10
Joined
May 31, 2019
Messages
139
Not using damage circle.
Here's the trigger. The unit dying is a dummy timer unit created when the 'real' unit attacks.
For full context, see here.

  • LurkerSpineDamage
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Lurker_SpineDmgUnitType
    • Actions
      • Set tmpPoint3 = (Position of (Triggering unit))
      • Set tmpUnitGroupLurkerSpine = (Units within Lurker_SpineArea of tmpPoint3 matching ((((Matching unit) is A flying unit) Equal to False) and ((((Owner of (Matching unit)) is an enemy of (Owner of (Triggering unit))) Equal to True) or ((Owner of (Matching unit)) Equal to Neutral Passive))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in tmpUnitGroupLurkerSpine) Greater than 0
        • Then - Actions
          • Unit - Create 1 Lurker Spine Hit (Sound Dummy) for (Owner of (Triggering unit)) at tmpPoint3 facing Default building facing degrees
          • Animation - Play (Last created unit)'s birth animation
          • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
          • Unit - Add a 0.35 second Generic expiration timer to (Last created unit)
          • Animation - Change LurkerUnit[(Custom value of (Triggering unit))]'s size to (300.00%, 300.00%, 300.00%) of its original size
          • Set DamageBuffComputedDamage = (Real(Lurker_PlayerDamage[(Player number of (Triggering player))]))
          • Set DamageBuffUnitToCheck = LurkerUnit[(Custom value of (Triggering unit))]
          • Trigger - Run Apply Buff <gen> (ignoring conditions)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LurkerUnit[(Custom value of (Triggering unit))] Equal to No unit
            • Then - Actions
              • Game - Display to (All players) the text: ((ERROR: Lurker + (String((Custom value of (Triggering unit))))) + not found!)
            • Else - Actions
          • Unit Group - Pick every unit in tmpUnitGroupLurkerSpine and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) is A flying unit) Equal to False
                • Then - Actions
                  • Unit - Cause (Triggering unit) to damage (Picked unit), dealing DamageBuffComputedDamage damage of attack type Lurker_AttackType and damage type Lurker_DamageType
                • Else - Actions
        • Else - Actions
      • Custom script: call DestroyGroup(udg_tmpUnitGroupLurkerSpine)
      • Custom script: call RemoveLocation(udg_tmpPoint3)
the extra redundant 'Picked Unit is a flying unit equal to false' was added later out of desperation, but ultimately didn't solve anything.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
Looks like the only possible explanation would be that the units in question aren't actually Flying. That or whatever patch you're on is bugged.

If all else fails you can create a new Flying classification using a hidden passive ability.
Add this ability to each of your flying units and then in your Conditions do:
If Level of Flying Classification for Picked unit Equal to 1...
 
Level 10
Joined
May 31, 2019
Messages
139
So I figured out what the issue was. It turns out there was nothing wrong with my trigger after all, but rather with the unit itself.
Its Attack had no targets allowed specified, which I realize now meant it was auto-acquiring EVERYTHING, even air units. So the damage to air units was coming from this, not the trigger. Derp. Well after correctly setting the unit's targets allowed, air units are no longer being mistakenly damaged.
 
Status
Not open for further replies.
Top