• 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.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Giving negative regen to a unit when it goes too far away from a specific building

Status
Not open for further replies.
Level 3
Joined
Dec 7, 2017
Messages
13
Hi,
Im working on a map where Im creating a type of unit that need to stay close to a specific type of building that workers can build otherwise it will slowly lose HP over time.
I am struggling on the 'Event' part of the trigger, how can I detect this event ?
In the trigger editor I have 'Units leave a region within range of units' but it has to be a precise unit and not a variable.
Thx for help !
 
Level 3
Joined
Dec 7, 2017
Messages
13
Thanks for your reply DaneTheBeast but if I put a regen aura to the building all the units will benefit from it ? Do you know to make it that the aura only work on a specific unit ? In the allowed target field of aura I have 'buildings, flying units, mechanical, etc...' but I don't see how to choose a specific unit.
Thx
 
Level 12
Joined
Dec 11, 2014
Messages
666
Ah right, you can make the unit an ancient and then make the aura only target ancients (This won't work for you if you're using the ancient classification for other units too). Keep in mind that there are a number of solutions to your problem, this aura one may not be the best, but it should work
 
Level 11
Joined
Nov 23, 2013
Messages
665
Using a periodic timer, you may pick every unit from player, and then check the unit type + check the distance (real value) between the building and the unit of that type:
'Every X seconds, pick every unit of type Footman owned by player 1
if distance between Barracks and picked unit >= Y,
then picked unit takes Z damage'.
Something in that area maybe? It probably won't be that simple, especially if you have several buildings that the unit is not supposed to get away from, but this is how I'd start.
 
Status
Not open for further replies.
Top