Animal movement
2 replies



30.05.22 03:18:56 pm
I've noticed that every animal in the game is moving around near its place of spawning.
My question is...
Is there any script in the map editor which makes each animal moving ALL OVER THE ISLAND, in random directions?
My question is...
Is there any script in the map editor which makes each animal moving ALL OVER THE ISLAND, in random directions?
That's true. The spawn location is stored with each animal and the animal returns into the direction of the spawn if the distance gets too high (higher than "range" in its definition).
You can easily set that spawn center position to the CURRENT position with
ai_center:
Doing so like every few seconds will ensure that the animal can go wherever it wants to go without having to return because the center point will always be close enough to the current position.
You could also use
unitpath to let the animal go along a predefined path. I think the center/spawn logic is ignored while following a path (I'm not 100% sure though). Also it's not random then so probably not what you want.
Another way would be to just increase the "range" value of the animals to something very high. That's only a solution for a custom mod though and not for a single map.
You can easily set that spawn center position to the CURRENT position with

Code:
1
ai_center UnitID
Doing so like every few seconds will ensure that the animal can go wherever it wants to go without having to return because the center point will always be close enough to the current position.
You could also use

Another way would be to just increase the "range" value of the animals to something very high. That's only a solution for a custom mod though and not for a single map.
OK, I got it.
I did it with ai_center command, and it works.
Thanks for your help.
I did it with ai_center command, and it works.
Thanks for your help.
edited 2×, last 04.06.22 02:54:00 pm



