How to make a Settlement "Power Centre" for recruiting certain units
Well this was something i found in the crusades campaign_script.txt and thought it would be useful to some of the guys who want to put this cool trigger in the script of their mods.
Lets us suppose there is a unit like Greek firethrower which you guys want to train only when you have a ownership of a particular settlement in this case lets take Constantinople for the Byzantium.
Firstly open the campaign_script.txt for your mod which can found in this path:-
your mod\data\world\maps\campaign\imperial_campaign folder.
Open the file and paste this entry given below:
;Increment
Code:
monitor_conditions I_SettlementOwner Constantinople = byzantium
and I_EventCounter holds_constantinople == 0
add_events
event counter holds_constantinople
date 0
end_add_events
end_monitor
;Decrement
Code:
monitor_conditions not I_SettlementOwner Constantinople = byzantium
and I_EventCounter holds_constantinople == 1
and I_NumberOfSettlements byzantium > 0
set_event_counter holds_constantinople 0
end_monitor
Save the script and now open the EDB(export_descr_buildings.txt) file in the data folder of your mod.
Now add this line with a space after the recruit pool of your unit
Code:
and event_counter holds_constantinople 1
The complete line should look like this now:-
Code:
recruit_pool "Greek Firethrower" 1 0.7 2 0 requires factions { byzantium, } and event_counter holds_constantinople 1
Remember to add this event counter to every line of Greek firethrower recruitment entry present in the EDB file.
And that's it we are done here.
Now the Byzantium can train Greek firethrower's only when it has the ownership of Constantinople. So in this way we can add more units attached to ownership of Constantinople or any other city.
This method is better than the Hidden resource one coz with that we can only recruit that in that settlement only but with this script the recruitment is global(that is u can train them any settlement having the necessary building but u need to hold that Power centre city to make it recruitable Global throughout your kingdom.