Page 1 of 1

UNIT Script Spawned Garrisons bug.

Posted: Wed May 13, 2026 3:20 pm
by Ason
It seems like garrisons spawned during the game via Unit script gets ignored by the AI.

5 of these garrisons spawned 15 turns ago, and another 5 spawned a couple of turns ago, the AI dont seem to move them.
There is no guard script there etc.
Image

Re: UNIT Script Spawned Garrisons bug.

Posted: Fri May 15, 2026 2:16 pm
by Hubert Cater
Thanks for the report, could you tell me for which campaign exactly and if this is a modified campaign or not?

The map position as well and the current year and general situation on the map, e.g. is the Axis ascendant and nowhere really for these Garrisons to go, or are there positions they could go to?

Re: UNIT Script Spawned Garrisons bug.

Posted: Fri May 15, 2026 7:17 pm
by Ason
Custom campaign,1945/01/15, Map position 5,57, axis were in a bad spot, a lot of positions they could have gone to.

Re: UNIT Script Spawned Garrisons bug.

Posted: Sun May 17, 2026 4:04 pm
by Ason
same thing is happening with allied garrisons. I made many unit scripts with other units and these are the only ones that dont move (these have only garrisons if that matters for narrowing down the problem)
New units even spawned at the same place and they immediately move away, but the garrisons stay.
Image

Re: UNIT Script Spawned Garrisons bug.

Posted: Tue May 19, 2026 12:29 am
by Hubert Cater
Custom makes some sense then as Garrison units, as used by the AI, will only want to go to positions that need to be garrisioned, and if set to be looking for weaker units like Garrisons in the GUARD script.

If there are not enough positions in your script for them to try and cover, e.g. the ones that are scripted are already covered, then there is no where for them to go, or at least as far as the AI is concerned with about sending them somewhere.

If the UNIT script is spawning too many, then this could also be a UNIT script issue, e.g. to spawn less, or just as many as needed, or a possible PURCHASE script issue where too many are being purchased. You could also set some conditions there to limit the number of garrison units to appear there if there are already too many etc.

This is pretty much what I would be looking for and tweaking for the default campaigns if the same kind of thing started happening in testing.