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

Make Units Stop Fleeing, when at health threshholds.

Status
Not open for further replies.
Level 1
Joined
Jun 4, 2016
Messages
3
I have a map, in which I have one section that is like a tower defense. As such, I have a maze, from where units spawn in Region A, and walk to Region B.

Obviously, along this path, they will take damage from towers.

Upon reaching around 55% health, I would estimate, these units begin walking backwards, towards the last region that they were in, in this example being Region A.

After reaching Region A, they begin marching forward in the maze once more, towards Region B, only to take any amount of additional damage, and run backwards again.

This is bad, as I would like the units to run forward indefinitely, through my maze.

I currently have:
Object Editor>Unit In Question>Stats - Can Flee: False
Advanced>Gameplay Constants>Creeps - Guard Distance: 100000.00

I initially had these units moving to the center of a region. Now they are attack-moving there. This seems to make no difference. They do not have attacks enabled.

Their race is also creep. I have tried setting a different unit's race to something different, and this also seems to have no effect.

I have also tried to make units ignore their guard positions, via Tigger Editor. This either results in nothing better (I.E. The exact same issue), or said units will just never move once they are ignoring their guard position.

Any help would be appreciated, if you would like for me to post anything more specific, let me know :).

P.S. I have seen folks on here post things like their triggers, as if it was from Trigger Editor. I am unaware of how to do this, unless you are just uploading screenshots.
 
Level 12
Joined
Jan 30, 2020
Messages
875
Yes we definitely would need to see your triggers to know what is happening, as usually this is solved with the object editor field you used, and the function to ignore guard positions.

to post triggers, use the "trigger" tag (between brackets - and remember the closing tag)

for exemple :
  • Events
    • Map initialization
  • Conditions
  • Actions
    • AI - Ignore the guard positions of all Neutral Hostile units
What I do in my TD as the path to the final destination is quite long, is use waypoints to make the "creeps" follow an itinerary, (when a unit enters a waypoint , I order it to move to the next waypoint).

Anyways, waiting for your triggers to try to help you find out what went wrong.
 
Level 1
Joined
Jun 4, 2016
Messages
3
  • Tower Wave 1
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit - Create 5 Ghools Wave 1 for Neutral Hostile at (Center of Z Maze Beginning <gen>) facing 180.00 degrees
      • Unit Group - Pick every unit in (Units of type Ghools Wave 1) and do (Unit - Order (Picked unit) to Attack-Move To (Random point in Z Maze 1 <gen>))
      • Wait 10.00 game-time seconds
      • AI - Ignore the guard positions of all Neutral Hostile units
  • End Maze
    • Events
      • Unit - A unit enters Z Maze 1 <gen>
    • Conditions
    • Actions
      • Unit - Order (Triggering unit) to Attack-Move To (Center of Z Maze End <gen>)
As stated above, I have also had the first trigger without making the AI ignore guard positions before, I get the same result either way.
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Have you already checked the gameplay constants? There are fields in there concerning about the unit's guard distance and range.

EDIT:

Also try to remove the waits here (it's not needed), set the 'attack-move to' order into 'move to' only, make sure the path to another region is clear and walkable, make sure there are no triggers other than this that runs. You can set the owner of those units to a player other than neutrals so we can denote that the problem is only for neutral players' thing and ensure that your script is working properly.
 
Last edited:
Level 12
Joined
Jan 30, 2020
Messages
875
@Shima Yamagoto :
First of all, use the move order as your creeps don't have an attack, no need to give them an order they can not completely fulfill, even if thats not the cause of your guard position issues.

Then, why do you order the creeps at map initialization ? And moreover, why do you disable the guard position 1 second after ordering your creeps ???

Not sure that is the sole reason, but if I were you, I would go back to the gameplay constants where you set Creeps - Guard Distance: 100000.00 and change the value to 0.
Next I would leave the ignore guard position call at Map Init, and move your ordering trigger to another one that would start like 1 or 2 seconds after map init (you might want to change it in the future if you add anything just after Map Init like a difficulty Dialog or anything else.

Lastly, two things come into my mind if this does not solve your problem :
- Try changing the owner of the creeps (as jakeZinc suggested) to a computer player that is not Neutral and change the ignore guard positions call to this player just to see if the result is still the same.
- Make sure all players have full visibility of the map, no fog of war.
 
Level 1
Joined
Jun 4, 2016
Messages
3
Alright, for the time being, changing them to a different player has worked. I apologize that I did not think of this before. Thank you for your help!

As for why I had them spawn right away, it is just for testing purposes, as I am in the very early stages of making this map.
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
Ignoring units' guard positions only works for non-neutral player slots, most likely because they're hardcoded.
Attack-move order issued by triggers is known to make units return to their last guarding position, the position when the order was given. The action above nullifies this behavior.
But the most nonsensical mistake was you ordering them to attack-move when they have no attacks enabled nor there are enemy units for them to attack in sight. The order is still given, it will appear as you ordered them to only "move", but the behavior is the same as attack-move.
 
Status
Not open for further replies.
Top