• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

An item or a unit within range

Status
Not open for further replies.
Level 9
Joined
Dec 31, 2016
Messages
315
I need to do something quite complicated I can't figure out on my own. The thing is, a unit is moving and I need to check whether an item or a unit, whichever is possible or easier (item would be better though), comes within a range of the unit. The action "A unit comes within a range" is for specific unit only and I need it in general.

Thanks for any help.
 
Level 28
Joined
Feb 18, 2014
Messages
3,580
For units use :
  • Trigger 1
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Footman = Footman 0001 <gen>
      • Trigger - Add to Trigger 2 <gen> the event (Unit - A unit comes within 256.00 of Footman)
  • Trigger 2
    • Events
    • Conditions
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- Do your stuff here--------
As for items :
  • Trigger 3
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
      • (Distance between (Position of YourUnit) and (Position of YourItem) Equal to 256.00
    • Actions
      • Trigger - Turn off (This trigger)
      • -------- Do your stuff here--------
 
Status
Not open for further replies.
Top