• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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

Status
Not open for further replies.
Level 11
Joined
May 31, 2019
Messages
150
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?
 
Level 11
Joined
May 31, 2019
Messages
150
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 73
Joined
Aug 10, 2018
Messages
7,878
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 11
Joined
May 31, 2019
Messages
150
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