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

[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