Hi! First of all i want to say that you have done a great work guys. It is one of the best mods I have ever play. So, I have the following question. The garisson script works for Player vs AI only or for AI vs AI too?
Hi! First of all i want to say that you have done a great work guys. It is one of the best mods I have ever play. So, I have the following question. The garisson script works for Player vs AI only or for AI vs AI too?
AI vs AI too. The AI will always get a garrison script if there is one available in the city. However, the player wont recieve a garrison script for the same city if they are playing as the same faction.
+ ...or have conquered the garrison scripted city.
Clarification here: 1) if a player conquers a city with a garrison script, and the city is re-conquered by the AI, will the AI receives garrison script for that city or is the garrison script a "one shot" thing? 2) do players ever benefit from a garrison script (eg. in cities that the player starts out with)?
players do not get the garrison script it is to help the Ai defend itself from the player and other ai factions.
Only the original faction will get a garrison script for that city and it works every 10 rounds that script will fire again if sieged so if you attack a city with garrison then you have 10 turns to capture it before it will fire again on siege.
If a garrison city is captured it will not have a garrison again either for a player or other AI faction but if the original faction re captures the city then it will again have the garrison as it will fit the paremters of the script such an example as this
monitor_conditions I_SettlementUnderSiege London
and I_CompareCounter London_siege < 1
if I_SettlementOwner London = england
and I_IsFactionAIControlled england
and I_CompareCounter england_start 0
create_unit London, Armored Swordsmen, num 3, exp 1, arm 1, wep 0
create_unit London, Spear Militia, num 5, exp 1, arm 1, wep 0
create_unit London, Feudal Knights, num 1, exp 0, arm 1, wep 0
create_unit London, Longbowmen, num 3, exp 0, arm 1, wep 0
create_unit London, Town Militia, num 2, exp 0, arm 1, wep 0
end_if
set_counter London_siege 10
end_monitor
as you see if london is sieged and the counter for seiege is less than 1 and the owner is england and england is being run by the AI the command will fire which is the create units part
A script is made up of 4 basic parts a monitor (which can be event or condition) a condition or multiple conditions , and a comand or multiple commands and an end to the monitor thats a script
this script also uses a counter as part of its conditions a counter is just a simple well counter every round the counter will go down (so it will go below 0 ) thus when firing the last command is to set counter to 10 thus thats why it is 10 rounds before the city will again get a garrison