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!
Why do buildings (towers) attack the hero if he's low on hp and is there a way to stop that? I wan't the towers on my map to attack the hero last or only when he has attacked another hero in the tower range.
I think you want to go into object editor and set each of the heroes priority lower than the other units.
Then you need to make a trigger like this for making the towers attack heroes defensively.
Tower Attack
Events
Unit - A unit Is attacked
Conditions
((Attacking unit) is A Hero) Equal to True
((Attacked unit) is A Hero) Equal to True
Actions
Unit Group - Pick every unit in (Units within 512.00 of (Position of (Attacking unit)) matching (((matching unit) is A structure) Equal to True)) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
((Picked unit) belongs to an ally of (Owner of (Attacked unit))) Equal to True
((Attacking unit) is in (Units within 512.00 of (Position of (Picked unit)))) Equal to True
Then - Actions
Unit - Order (Picked unit) to Attack (Attacking unit)
Else - Actions
Do nothing
This trigger would make any structure in 512 range attack your hero if you attacked an enemy hero on their team if you aren't on their team.
It is now leak free and also I ensure that it doesn't detect dead towers.
Tower Attack
Events
Unit - A unit Is attacked
Conditions
((Attacking unit) is A Hero) Equal to True
((Attacked unit) is A Hero) Equal to True
Actions
Set temp_loc1= Position of Attacking Unit
Set temp_group = Units within 600 distance of temp_loc1 matching (((matching unit) is A structure) Equal to True)) and (matching unit) is alive) Equal to True))
Unit Group - Pick every unit in temp_group and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) belongs to an enemy of (Owner of (Attacking unit))) Equal to True
((Picked unit) belongs to an ally of (Owner of (Attacked unit))) Equal to True
Then - Actions
Unit - Order (Picked unit) to Attack (Attacking unit)
Actually all towers/units attack no matter a unit or hero that has low hp or when trying to kill a hero, I think it's a code script like AI order. I usualy backup the targeted unit but to prevent this from happening you'll need to trigger like these guys said ^^
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.