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

[General] How do I check if a point is within range of a unit with a certain unit type?

Status
Not open for further replies.
Level 2
Joined
Oct 29, 2013
Messages
6
I have a trigger that requires checking whether a certain point is within X range of any unit of a specific unit type. More specifically I want to detect some kind of collision.

I've looked for an appropriate condition but I haven't been able to find anything. I tried playing around with the "Region - Region contains point" condition, but I haven't been able to figure anything out.

If possible a GUI solution would be ideal, but I'm open for JASS if it's required. Thanks in advance <3
 
Last edited:
Level 12
Joined
Mar 24, 2011
Messages
1,082
This:
  • Set POINT = Centre of (Map Area)
  • Unit Group - Pick every unit in (Units within 512.00 of POINT) and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Unit-type of Picked unit is equal to Footman
        • Then - Actions
          • Stuff
          • End loop
        • Else - Actions
Hope this helps!
-Ned
 
Status
Not open for further replies.
Top