Nameless One
Veteran

I want to have regional troops in my mod. I made a script to replace regular troops with regional where I need it. I placed the call of this script at the end of the game_start script in order to replace 10 knights in the starting garrison, like this:
The script works correctly. It reports the number of knights it found for replacement, and it reports different numbers on different tests, as expected. However, when I start the game and check the target town, the number of knights in it is much higher than reported by the script. For example, in my first test, the script found 7 knights and replaced them all, but when I checked there were 7 special knights and 22 regular knights. The number of knights the script reports is between 5 and 15, but when I check the city in the game, it contains more than 20 knights.
Is there some other way the game adds troops to the garrisons outside the game_start script? Is it modable? I don't mind having more than 20 regular knights in the city, but I'd like to guarantee 10 of special ones even when the game_start script ends with less than 10 in the city in question.
插入代码块:
(call_script, "script_replace_regular_troops_with_regional", "trp_regular_knight", "trp_special_knight", "p_town_6", 10),
The script works correctly. It reports the number of knights it found for replacement, and it reports different numbers on different tests, as expected. However, when I start the game and check the target town, the number of knights in it is much higher than reported by the script. For example, in my first test, the script found 7 knights and replaced them all, but when I checked there were 7 special knights and 22 regular knights. The number of knights the script reports is between 5 and 15, but when I check the city in the game, it contains more than 20 knights.
Is there some other way the game adds troops to the garrisons outside the game_start script? Is it modable? I don't mind having more than 20 regular knights in the city, but I'd like to guarantee 10 of special ones even when the game_start script ends with less than 10 in the city in question.
