As some readers may know, one of the problems with garrison scripts has been that the garrison can walk off if it survives and join the rest of the faction army.
Now that the destroy_units + unit attribute ability has been worked out and shown to work, we can now do a garrison script for every location, with the simple format
If settlement under siege, check size of garrison, if garrison less than x amount create a few generic garrison units. These units will need to be recruitable by all factions to avoid over-complicating the script, but we can different units in different locations.
The problem is that any units given the attribute garrison_unit for the purposes will have to be destroyed at the end of the turn when the settlement isn't under siege. So the units will have to be removed from the EDB, they won't be able to be recruited in barracks.
Ideas for groups of factions / areas of map and time scales - (ie start to 1300 / 1300 to 1450 / 1450 to end)
Note the more units chosen, the fewer that can be recruited in the EDB.