• 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.

[Trigger] How to refference this unit???

Status
Not open for further replies.
Level 13
Joined
Mar 24, 2010
Messages
950
  • trigger
  • trigger
    • Events
      • Unit - A unit comes within 600.00 of a unit <gen>
      • Unit - A unit comes within 600.00 of another unit <gen>
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) belongs to an ally of (Owner of (??????????????????????? unit))) Equal to True
        • Then - Actions
        • Else - Actions
i need to know how to tell which unit the triggering unit is getting near (keep in mind it could be any unit type, and i use another trigger to add the unit to this trigger so the unit is also not statically assigned)
 
Issues:

1. The checker happens once every 0.1 seconds
2. You need a trigger + hash (or O(N) search) for every unit you want to check the range for
3. You would probably need another system which also detects when the unit leaves range, which requires a "all units in range" check.
4. Due to this, you should just do the entire thing with a periodic trigger that picks all units in range.
 
Level 13
Joined
Mar 24, 2010
Messages
950
well i do have this as another trigger adding units as they come to that first trigger to do something

  • Learn Skill
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Spell Damage Reduction aura
      • (Level of Spell Damage Reduction Aura for (Triggering unit)) Equal to 1
    • Actions
      • Trigger - Add to Add Aura <gen> the event (Unit - A unit comes within 800.00 of (Triggering unit))
      • Set AuraHero[(Player number of (Triggering player))] = (Triggering unit)

but still ran into the prob that i cant even address this: AuraHero[(Player number of (????)) in the other trigger.. so im screwed all around.. i just cant believe theres no way to address that unit, seems dumb they put that unit event in there and cant even do anything with it in another trigger..
 
Status
Not open for further replies.
Top