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

An item or a unit within range

Status
Not open for further replies.
Level 9
Joined
Dec 31, 2016
Messages
320
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 30
Joined
Feb 18, 2014
Messages
3,623
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