• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

units go back after an order

Status
Not open for further replies.
Level 21
Joined
Mar 29, 2020
Messages
1,237
units that belong to neutral (and possibly not only) have a built in periodic command to go back to their spawn position. you can detect and override this command.

something like:

Unit - A unit Is issued an order targeting a point

conditions:

-> specified unit.
-> the point is in region x. (make region x at spawn location of that unit)


action -> order unit z to do y.



this should override the built in order to go home. however, I remember that when I did this there was still some funny behavior that I had to play around with since i'm not sure exactly what the conditions for the go home command are and how it works under the hood. so it might not be 100% foolproof.

another way to overide this that is worse in a lot of ways is to have a periodic trigger that reinforces the behavior of the unit you want, so that whenever the hardcoded command tells it to go home, you just tell it to keep doing what it was doing. since the hardcoded "go home" command only happens once every few seconds - your commands will win out. the only reason i state this even though it is a much uglier solution, is because this gave me an end result with no caveats. but this is much more resource heavy, and creates clashing commands that will give your unit some schizophrenic behavior instead of just replacing the original command. so, much less smooth - but was less prone to whims of the hidden hardcoded stuff.
 
Level 8
Joined
May 19, 2016
Messages
146
This is a question i wanted to ask too so i hop in if its okay?
What does ''AI - Ignore (Your unit)'s guard position'' actually do ? my Units still run back to their Old positions if the Guard Position Timer expires ( or did you all just made this timer to 100000+ in Gameplayconstants) ?
 
AFAIK the AI command AI - Ignore Guard Position has no effect on unit behaviour, it instead affects whether the AI will replace unit or use it to form attack groups. For example in campaign maps where you have scattered groups of enemy units, if you were to delete that action those units would run back to the base to be used for either attack or defence groups.
 
Status
Not open for further replies.
Top