I know I got this to work before, a long time ago, and now I can't make it work properly. I tried [if a unit exits a region, then send it back] but it has inaccurate results in that eventually, the units will chase enemies out of the region and not return.
I could've sworn there was a much easier solution to this with a simple tactical command. It's not "hold ground" because the units would never move no matter what. And in a regular passive state, they'll chase enemies all over the map. But there was something that would make them chase enemies, but only a certain range from their "defense" point, after which they would return to their original position.
If the units are protecrting another unit, you can issue a move command with the protected unit as target. As a basic solution with a trigger, i would suggest using the event you mentioned:
Event- unit leaves range of unit/leaves region
Condition- triggering == unit of unitgroup (guards)
Issue order to triggering unit to move to center of region/position protected unit (replace existing orders)
I know I got this to work before, a long time ago, and now I can't make it work properly. I tried [if a unit exits a region, then send it back] but it has inaccurate results in that eventually, the units will chase enemies out of the region and not return.
I could've sworn there was a much easier solution to this with a simple tactical command. It's not "hold ground" because the units would never move no matter what. And in a regular passive state, they'll chase enemies all over the map. But there was something that would make them chase enemies, but only a certain range from their "defense" point, after which they would return to their original position.
If the units are protecrting another unit, you can issue a move command with the protected unit as target. As a basic solution with a trigger, i would suggest using the event you mentioned: Event- unit leaves range of unit/leaves region
Condition- triggering == unit of unitgroup (guards)
Issue order to triggering unit to move to center of region/position protected unit (replace existing orders)
Simple solution and should work properly
There is something like leash range in gameplay data or somewhere. If i'm correct it should act like this - prevent from going too far