Guys,
Last week I've spent a lot of time on studying and fixing the script that I had perceived as a great feat of the SSHIP - unrest in the conquered settlements. I've already worked on it two years ago, and last year Belovese gave it a good overhaul. It still has a great deal of weaknesses stemming perhaps from save-time attitude of the former moders: it's only for 40 settlements, and some 3+ are wrongly coded, the unrest levels are very strange, and the AI suffers, surprisingly, more and more consistently.
In the meanwhile, we've developed two additional scripts:
- change of the names of the settlements,
- player aggression level mechanism.
Building on all these three parts of the code, I'm preparing an new script that will replace the main mechanism and will accomodate the other two. This is going to be massive size-wise (I think it will double the previous size of the script.txt as far as the number of lines is concerned), but rather light on the processing-time (each monitor fires only once in the entire turn - and most of the parts inside if- clauses are omitted unless there's an exceptional situation because tiny bit is for the AI, and most for the player). As a result, it should not make the turns last longer.
I. What the Dynamic Unrest in Settlements is aiming at:
II. Elements of the DUiS:Code:. ; The SSHIP FRAMEWORK FOR THE ADDITIONAL UNREST (turmoil): ; - a faction faces little turmoil in its core regions. ; - after a conquest of a non-core settlement, the faction faces higher or possibility of higher a turmoil for a long time (hundreds of turns); ; - the turmoil can be alleviated by a few factors, in particular the FL having a crown; ; - after owning a province for a long time, it is integrated and the additional turmoil will not appear. This is a dynamic process: this turmoil decreases very gradually. ; - there are special, troublesome regions where the unrest is more pronounced / higher etc.; ; - the AI also faces that special unrest, but much lower. The aim is that the AI faces rebellions in the outlying regions, not in the core. ; Of course, the settlements face also the regular Med2 engine problems related to: religion, distance from capital etc. ; COMMENTS ON CODING THIS SCRIPT: ; - it works for both the player and, to a limited extent, for the AI. ; - "core provinces" are defined by having the counter "XYZ_turns_in_our_realm" equal (or more) than 500. This is achieved in two ways: ; --- at the end of the script for each settlement there's a condition setting those 500 each turn for the historical core provinces ; --- (you may modify for each settlement what "core province mean by adding / deleting a condition); ; --- over time each conquered settl. gathers those points and may then reach and exceed 500 (perhaps after 500 turns, but the speed of the increase can be adjusted for each settl.) ; --- (mind that "core" provinces are code-wise not related to the hidden_resource or other elements from the other files (eg. "descr_region.txt"). ; - for the first 5 turns after a conquest of a settlement, the mechanism is switched-off for this settlement: ; --- the normal Med2 engine evolution occurs (initial turmoil set by the engine, and then 5% decrease a turn). ; --- this is done with the "XYZ_turns_in_our_realm" counter condition right at the beginning of the script (and may be easily adjusted for each settlement separately) ; - then the mechanism kicks-in:it is transmitted by value of the counter "XYZ_civil_unrest": different reasons add those points: ; --- there's a "normal" turmoil in all provinces, lowered only by the crowning of the FL, and, to a lesser extent, his policy "protector". ; --- "core" provinces" have a low level of turmoil but it increases after: ; ----- (1) change on the throne: one-time hit; ; ----- (2) an FL with very low Authority; ; ----- (3) if a weak FL / weak usurper is on the throne; ; ----- (4) aggressive expansion of the player (significant impact!), fading away only if the player does not conquer more settlements; ; ----- (+) this list may be modified (both sources and amounts of points) at the settlement level. ; - for a conquered, non-core province impact of all those sources fade away (the memory of not belonging to faction is being lost) ; -- as said, this is done through the the increase of conter "XYZ_turns_in_our_realm" ; -- however, once the settlement is conquered by anybody (eg. rebels, and is re-taken), the counter is reset and then the integration must be repeated ; - the script fires only in the turn of the faction owning the settlement. This means that the script is NOT VERY HEAVY for the processing-time: each monitor will fire only once during the entire turn. ; TURMOIL IN THE SETTLEMENTS IN MEDIEVAL2 ENGINE: ; - the turmoil ("add_settlement_turmoil ABC X") decreases every turn by 1 (in-game 1 point is 5% of unrest), ; - but if the command is given another time, the new value replaces the former, ; - as a result, this script fully commands the evolution over time of the turmoil: except first 4 turns after conquest, it replaces all sources of turmoil. ; - in particular, it replaces (perhaps, not checked) the following the sources: ; * conquest of the settlement (whatever it happened: extermination, sacking, occupation), ; * turmoil inherited from the previous turn (that one that decreases by 5% a turn). ; * (no idea how it is related to the impact of foreign agents lurking inside the settlement). ; I_SettlementBuildingExists - doesn't make sense to use in if-clauses, so it's not used here..
1.) Player Aggressivity Level mechanism - each conquest of a province increases the level of how much both other factions (through diplomatic standing), and own citizens (through turmoil in all settlements) are anxious about your expansion. It increases exponentially: if the player doesn't wait enough between conquering settlements, the additional points of aggression accrue at a faster rate than before. The player must wait or do other things (building up the settlements, mopping up rebellions, maybe going on a crusade; this is also a perfect time to survive a change on the throne) for the tensions to subside. The punishment in the turmoil in the settlements should be really heavy at the highest levels of aggressivity. The information to the player is provided below in the bit of the script (the rest you can see in the other bits there is code for gathering the points, and for translating those points into unrest in settlement-specific).
Code:;================================================================================================== ;------- Player Agression Level (after capture of settlement) ;================================================================================================== ; This mechanism aims at slowing down the expansion of the player at the VH difficulty. ; How does it work: ; - the increase of the "player_aggressivity" counter is placed in script for each settlement capture: ; -- every time the player conquers a settlement, the counter increases by 3-18 (depending on FL intelligence and crown). ; - the counter decreases every turn by 1 (here below), if the player hasn't active any war that he had started himself ; The impact of the mechanism: ; 1. increased turmoil in settlements (this file script: ;------- Turmoil in settlements) ; 2. deterioration of the player's reputation (in file descr_faction_standing.txt). set_event_counter player_aggressivity 0 ; counter 0-40, used in determining turmoil for each settlement set_event_counter player_aggressivity_feedback 0 ; which info was given to player: 0 - nothing yet, 1 - acceptable neighbour, 2 aggressive, 3 warmonger monitor_event GeneralCaptureSettlement not IsFactionAIControlled ; only for the player log ----- Player Aggressivity Level: first info window for the player if I_EventCounter DifficultyLevel < 4 ; only for VH difficulties terminate_monitor end_if historic_event PLAYER_AGGRESSIVITY_FIRST_INFO ; info window pops-out - should be updated after the changes are made set_event_counter player_aggressivity_feedback 1 ; ("acceptable neighbour") terminate_monitor ; fires only after first settlement conquered end_monitor monitor_event FactionTurnStart not IsFactionAIControlled ; only for player log --- Player Aggressivity Level: info for the player on the current state if I_EventCounter DifficultyLevel < 4 ; only for VH difficulties terminate_monitor end_if if I_EventCounter player_aggressivity > 0 if I_EventCounter aggressor < 1 ; if the player doesn't run any aggressive war inc_event_counter player_aggressivity -1 ; a natural process of forgetting sets in end_if if I_EventCounter player_aggressivity > 40 ; cap set_event_counter player_aggressivity 40 end_if if I_EventCounter player_aggressivity > 24 ; 25+, then player is warmonger: very high turmoil, fast deterioration of diplo standing and I_EventCounter player_aggressivity_feedback < 3 ; fires only on a change from a lower level historic_event PLAYER_AGGRESSIVITY_WARMONGER ; info for the player set_event_counter player_aggressivity_feedback 3 log ------ warmonger end_if if I_EventCounter player_aggressivity > 12 ; 13-24, then player is aggressive: high turmoil, deterioration of diplo standing and I_EventCounter player_aggressivity < 25 and I_EventCounter player_aggressivity_feedback < 2 ; fires only on a change from a lower level historic_event PLAYER_AGGRESSIVITY_AGGRESSIVE set_event_counter player_aggressivity_feedback 2 log ------ aggressive end_if if I_EventCounter player_aggressivity < 13 ; if below 13, then it's acceptable: some turmoil, little change of diplo standing and I_EventCounter player_aggressivity_feedback > 1 ; fires only after a drop from a higher level historic_event PLAYER_AGGRESSIVITY_ACCEPTABLE set_event_counter player_aggressivity_feedback 1 log ------ acceptable neighbour end_if end_if end_monitorSpoiler Alert, click show to read:
2.) a monitor that fires after a capture of each settlement (code-wise it means: each settlement has its own monitor with own counters, own conditions etc. - there are 199 monitors but only a few will fire each turn - depending on how many settlements were captured). This monitor a.) changes the name of the settlement after a capture, b.) can spawn an army for VH difficulty), consisting of local troops - these armies may or may not appear (66%), they may be rebel or loyalt to a faction that traditionally held this province; c.) increases Player Aggressivity Level (VH difficulty), d.) creates counters that are used later on. It also creates modding possibilities in the future. A bit of script for one city is below.
The additional armies should stabilizie the map, eg. as in this case:
Spoiler Alert, click show to read:
3.) a monitor that fires for each settlement every turn (i.e. during the turn of the faction that owns it - 199 monitors that fire always, but only once a turn, and a big(ger) part of script for each monitor is not firing at all). It calculates turmoil points specific for that settlement, based on it's particular situation (how long ago it was conquered, what are certain historical events related) and the situation of the whole faction (aggressivity level, whether the FL has a crown, or whether he's got not-low authority; if the FL has just died, there'll be a one-time hit to stability that may prompt a riot or worse). It then tranlates those points it into a turmoil that appears in-game for the players. A part of script for one city is here:Code:;------------------------------------------------------------------------------ TURKU After Capture declare_counter current_name_Turku ; 0 - Turku, 1 - Abo set_counter current_name_Turku 0 set_event_counter Turku_turns_in_our_realm 500 ; at the beginning: prevents treatment of home provinces as conquered provinces monitor_event GeneralCaptureSettlement SettlementName Turku wait 0.5 log --- Turku AFTER CAPTURE NAME CHANGE ----------------------------- if I_EventCounter faction_turn_catholic = 1 ; Catholic factions but Poland: Abo and not I_EventCounter faction_turn_poland = 1 change_settlement_name Turku Abo if I_EventCounter is_the_player = 1 and I_CompareCounter current_name_Turku < 1 historic_event SETTLEMENT_NAME_CHANGE end_if set_counter current_name_Turku 1 end_if if I_EventCounter faction_turn_poland = 1 ; Poland: Turku change_settlement_name Turku Turku if I_EventCounter is_the_player = 1 and I_CompareCounter current_name_Turku > 0 historic_event SETTLEMENT_NAME_CHANGE end_if set_counter current_name_Turku 0 end_if if I_EventCounter faction_turn_orthodox = 0 ; Orthodox factions: Turku change_settlement_name Turku Turku if I_EventCounter is_the_player = 1 and I_CompareCounter current_name_Turku > 0 historic_event SETTLEMENT_NAME_CHANGE end_if set_counter current_name_Turku 0 end_if log --- Turku AFTER CAPTURE REBEL ARMIES SPAWN -------------------------------------- if I_EventCounter is_the_player > 0 ; only for the player and RandomPercent < 66 ; some randomness is always good and I_EventCounter DifficultyLevel > 2 ; only for H/VH difficulties and I_EventCounter faction_turn_lithuania < 1 ; not for Lithuania (both historically and for the gameplay) and I_EventCounter denmark2_sankt_erik_player < 1 ; legitimate for Denmark after St. Erik crusade historic_event SETTLEMENT_CAPTURE_REBELLION spawn_army faction slave, sub_faction lithuania character Novsade, named character, age 30, x 243, y 280 traits CounterOfBattles 1, NaturalMilitarySkill 1 , GoodCommander 2 , Hardened 2 , StrategyDread 1 , Genocide 3 , Feck 2 , BattleScarred 1 , Paranoia 4 unit Chude Militia exp 7 armour 0 weapon_lvl 0 unit Woodsmen exp 7 armour 0 weapon_lvl 0 unit Woodsmen exp 0 armour 0 weapon_lvl 0 unit Chude Militia exp 4 armour 0 weapon_lvl 0 unit Chude Militia exp 0 armour 0 weapon_lvl 0 unit Hunters exp 7 armour 0 weapon_lvl 0 unit Hunters exp 0 armour 0 weapon_lvl 0 end end_if log --- Turku AFTER CAPTURE COUNTERS & OTHER EFFECTS -------------------------------------- set_event_counter Turku_turns_in_our_realm 0 if I_EventCounter is_the_player > 0 inc_counter number_settlements_conquered_by_player 1 end_if log --- Turku AFTER CAPTURE IMPACT ON PLAYER AGGRESSIVITY REPUTATION ---------------- if I_EventCounter is_the_player > 0 ; only player and I_EventCounter DifficultyLevel > 3 ; VH difficulty and I_EventCounter faction_turn_lithuania < 1 ; expansion in Baltics is legitimate for Lithuania and I_EventCounter denmark2_sankt_erik_player < 1 ; legitimate for Denmark after St. Erik crusade if I_EventCounter FL_is_crowned_ruler > 0 ; crowned FL inc_event_counter player_aggressivity 3 ; +3 if I_FactionLeaderTrait Intelligent < 8 ; +3 Crowned FL average Intelligence inc_event_counter player_aggressivity 3 ; cumulative! if I_FactionLeaderTrait Intelligent < 5 ; +3 Crowned FL low Intelligence inc_event_counter player_aggressivity 3 ; cumulative! end_if end_if end_if if I_EventCounter FL_is_crowned_ruler < 1 ; UN-crowned inc_event_counter player_aggressivity 6 ; +6 if I_FactionLeaderTrait Intelligent < 8 ; +6 UNcrowned FL average Intelligence inc_event_counter player_aggressivity 6 ; cumulative! if I_FactionLeaderTrait Intelligent < 5 ; +6 UNcrowned FL low Intelligence inc_event_counter player_aggressivity 6 ; cumulative! end_if end_if end_if end_if end_monitor
4.) the necessary descriptions in the text file (historic_events.txt). To give the perspecitve: only the "Turmoil Script Text" size is 300k characters, while the previous size of the whole file was 400k, and before I had started to contribute, so in the SSHIP 0.95, it was 140k. For each settlement there's such a text (to be corrected in the future):Code:;============================================================================================================ ;------------------------------------------------------------------------------ Oslo Turmoil Script section monitor_event SettlementTurnStart SettlementName Oslo set_counter Oslo_turmoil_points 0 ; resets turmoil points from the previous turn ; (better to do it now, because they'll stay for the rest of the turn ; so they will be able to be used somehow - no idea yet how) log --- (A) Oslo Turmoil Points (for the Player) ----------------------------------------- if I_EventCounter is_the_player > 0 and I_EventCounter Oslo_turns_in_our_realm > 4 ; for 4 turns after a conquest this monitor doesn't have any impact on turmoil ; (unless the initial number of Oslo_turns_in_our_realm is set in the Capture script) ; if you'd change this value, change also timing of the info pop-out window for the player at the end of this monitor ; remember that "Oslo_turmoil_points" is set to 0 at the end of each turn (see below) ; while "Oslo_turns_in_our_realm" represents integration of the province and changes based on many conditions (also below) ; The situations impacting on the turmoil may easily be augmented with any other counter. ; The turmoil is translated in this script into unrest at rate: 1 to 1%, but in-game it jumps at 5% incrementals (so 4 means no unrest at all). ; Normal situations' values of "turmoil" counter based on the current list of conditions and numbers: ; - range 0-35; ; + change on the throne: + 10-20 ; + player aggressivity: + 4-12-28 ; (floor value) home province at the beginning of game for a handful small factions: 4 ; (floor value) home province at the beginning of game for average SSHIP faction: 8 ; conquered province in an outlying region: 12 ; freshly conquered alien province later in the game without crown: 22 + aggressivity ; freshly conquered alien province later in the game with crown: 17 + aggressivity ; freshly conquered alien province after a bad change on the throne: 36 (first turn: +10) if I_EventCounter FL_policy_protector < 1 ; base unrest value - if no FL policy protector and I_EventCounter DifficultyLevel > 2 ; Hard or Very Hard difficulty and I_EventCounter faction_size_small < 1 ; inc_counter Oslo_turmoil_points 2 ; 2 for factions 4-9 settlements if I_EventCounter faction_size_medium < 1 ; inc_counter Oslo_turmoil_points 2 ; 4 for factions 10-19 settlements if I_EventCounter faction_size_large < 1 ; inc_counter Oslo_turmoil_points 2 ; 6 for factions 20+ settlements end_if end_if end_if if I_EventCounter FL_is_crowned_ruler < 1 ; FL is UNcrowned - it will be true for the most of the factions for a long time inc_counter Oslo_turmoil_points 4 ; 4 for a home province if I_EventCounter Oslo_turns_in_our_realm < 390 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 290 ; many provinces have initial 200, so they will have +2 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 190 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 90 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 30 inc_counter Oslo_turmoil_points 1 ; +5 for a new conquered province end_if end_if end_if end_if end_if end_if if I_EventCounter Oslo_turns_in_our_realm < 480 ; province not yet integrated into our realm: 0-9 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 320 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 160 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 90 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 50 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 25 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 16 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 12 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 8 ; right after capture: 9 inc_counter Oslo_turmoil_points 1 end_if end_if end_if end_if end_if end_if end_if end_if end_if if I_FactionLeaderAttribute Authority < 3 ; FL really lacks Authority and I_EventCounter DifficultyLevel > 3 ; Very Hard difficulty and I_EventCounter faction_size_small < 1 ; doesn't matter for small factions - everybody knows him inc_counter Oslo_turmoil_points 3 ; 3+3 if I_EventCounter Oslo_turns_in_our_realm < 300 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 200 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 100 inc_counter Oslo_turmoil_points 1 end_if end_if end_if end_if if I_EventCounter FL_weak_on_the_throne > 0 ; weak FL (low authority or weak usurper) and I_EventCounter faction_size_small < 1 ; doesn't matter for small factions inc_counter Oslo_turmoil_points 5 ; 5+5 if I_EventCounter Oslo_turns_in_our_realm < 440 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 340 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 240 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 140 inc_counter Oslo_turmoil_points 1 if I_EventCounter Oslo_turns_in_our_realm < 40 inc_counter Oslo_turmoil_points 1 end_if end_if end_if end_if end_if end_if if I_EventCounter FL_player_is_new_this_turn > 0 ; (one-off) shock for the kingdom: FL died and I_EventCounter faction_size_small < 1 ; doesn't matter for small factions inc_counter Oslo_turmoil_points 10 ; 10+10 if I_EventCounter Oslo_turns_in_our_realm < 450 inc_counter Oslo_turmoil_points 2 if I_EventCounter Oslo_turns_in_our_realm < 350 inc_counter Oslo_turmoil_points 2 if I_EventCounter Oslo_turns_in_our_realm < 250 inc_counter Oslo_turmoil_points 2 if I_EventCounter Oslo_turns_in_our_realm < 150 inc_counter Oslo_turmoil_points 2 if I_EventCounter Oslo_turns_in_our_realm < 50 inc_counter Oslo_turmoil_points 2 end_if end_if end_if end_if end_if end_if ; Player Aggressive Expansion impact ; already taken into account in the mechanism of the increase of counter: only VH difficulty, FL_is_crowned_ruler if I_EventCounter player_aggressivity > 6 ; (conquest of 1 settlement adds 3-18 aggressivity pts., usually 12) inc_counter Oslo_turmoil_points 4 if I_EventCounter player_aggressivity > 12 inc_counter Oslo_turmoil_points 8 if I_EventCounter player_aggressivity > 24 inc_counter Oslo_turmoil_points 16 ; cumulative, so levels of turmoi points: 4-12-28 end_if end_if end_if end_if log --- (B) Oslo Turmoil Points (for AI) ----------------------------------------------- if I_EventCounter is_the_player < 1 ; AI if I_EventCounter faction_turn_norway < 1 ; not "creator" of this province and I_EventCounter faction_turn_denmark < 1 and I_EventCounter faction_turn_lithuania < 1 ; pagans have it easier and to make Lithuania life easier and I_EventCounter faction_size_small < 1 ; not for small factions inc_counter Oslo_turmoil_points 20 end_if if I_EventCounter FL_weak_on_the_throne > 0 ; rather unlikely event inc_counter Oslo_turmoil_points 10 end_if end_if log --- (C) Oslo Turmoil Points Translated Into Unrest ----------------------------------------------- ; each one replaces the previous - in this way the turmoil in any settlement is set exclusively in the script (not in the in-game engine) if I_CompareCounter Oslo_turmoil_points > 5 add_settlement_turmoil Oslo 1 if I_CompareCounter Oslo_turmoil_points > 10 add_settlement_turmoil Oslo 2 if I_CompareCounter Oslo_turmoil_points > 15 add_settlement_turmoil Oslo 3 if I_CompareCounter Oslo_turmoil_points > 20 add_settlement_turmoil Oslo 4 if I_CompareCounter Oslo_turmoil_points > 25 add_settlement_turmoil Oslo 5 if I_CompareCounter Oslo_turmoil_points > 30 add_settlement_turmoil Oslo 6 if I_CompareCounter Oslo_turmoil_points > 35 add_settlement_turmoil Oslo 7 if I_CompareCounter Oslo_turmoil_points > 40 add_settlement_turmoil Oslo 8 if I_CompareCounter Oslo_turmoil_points > 45 add_settlement_turmoil Oslo 9 if I_CompareCounter Oslo_turmoil_points > 50 add_settlement_turmoil Oslo 10 if I_CompareCounter Oslo_turmoil_points > 55 add_settlement_turmoil Oslo 11 if I_CompareCounter Oslo_turmoil_points > 60 add_settlement_turmoil Oslo 12 end_if end_if end_if end_if end_if end_if end_if end_if end_if end_if end_if end_if log --- (D) Oslo Integration Process ---------------------------------------- ; in the optimal situation: +1, but in special circumstances even +4/turn (Crowned, not-weak, with policy, region is special for this faciton) ; thus full integration 250 - 50 years, but most negative effects phased out after 50-20 years) if I_EventCounter Oslo_turns_in_our_realm < 500 ; to avoid crash due to amassing too many points if I_EventCounter FL_weak_on_the_throne < 1 ; natural integration process but not with a Usurper (thus not during a civil war either) inc_event_counter Oslo_turns_in_our_realm 1 end_if if I_EventCounter FL_is_crowned_ruler > 0 ; if the owner's faction FL has the crown inc_event_counter Oslo_turns_in_our_realm 1 ; integration is faster end_if if I_EventCounter FL_policy_thinks_of_his_people > 0 ; if FL pursues a conducive policy inc_event_counter Oslo_turns_in_our_realm 1 ; integration is faster end_if if I_EventCounter faction_turn_poland > 0 ; this faction and I_EventCounter poland7_golden_age_player > 0 ; has special circumstances and I_EventCounter FL_weak_on_the_throne < 1 ; inc_event_counter Oslo_turns_in_our_realm 1 ; that allow faster integration end_if if I_EventCounter faction_turn_norway > 0 ; this province is a core province of this factiton and I_EventCounter FL_weak_on_the_throne < 1 ; and the FL is not lacking authority / usurper set_event_counter Oslo_turns_in_our_realm 500 ; no integration is needed end_if if I_EventCounter faction_turn_denmark > 0 ; this province is a core province of this factiton and I_EventCounter FL_weak_on_the_throne < 1 ; and the FL is not lacking authority / usurper set_event_counter Oslo_turns_in_our_realm 500 ; no integration is needed end_if end_if log --- (E) Oslo Infos & Counters for the Player ---------------------------------------- if I_EventCounter is_the_player > 0 set_event_counter FL_player_is_new_this_turn 0 ; after unrest is applied: timing is essential so it must be placed here, in every settlement if I_EventCounter Oslo_turns_in_our_realm > 4 and I_EventCounter Oslo_turns_in_our_realm < 6 historic_event SETTLEMENT_UNREST_NORMAL_RULES_OSLO end_if if I_EventCounter Oslo_turns_in_our_realm > 197 ; info for the player (don't use 200 as there's this threshold in the Capture script) and I_EventCounter Oslo_turns_in_our_realm < 199 historic_event SETTLEMENT_UNREST_INTEGRATED_OSLO end_if if I_EventCounter Oslo_turns_in_our_realm > 487 ; info for the player (actually, no negative results already for a couple of turns) and I_EventCounter Oslo_turns_in_our_realm < 489 historic_event SETTLEMENT_UNREST_INTEGRATED_OSLO end_if end_if end_monitor r
Code:{SETTLEMENT_UNREST_NORMAL_RULES_TURKU_BODY}\n\nIt's been two years your realm has expanded to yet another settlement, that one called Turku by some of its citizens. It became a normal part of your kingdom. From now on, there will be no martial law there, and the unrest of the burghers will swing in the same manner as in the other parts of the realm. Be aware though, that this settlement will stay defiant to your rule for a long time. Indeed, it will take decades for the people to get accustomed to the narratives of your house, and to admit your legitimacy. Of course, with a Crowned king pursuing the Protector policy, it will be easier - but not all faction leaders can have those qualities. So watch out to the turmoil here!\n\nIf you manage to keep control of this settlement long enough, after 100 years you'll get an information that it has been integrated and the unrest is only little higher than in the settlement traditonally belonging to your faction. All traces of being an alien will disappear after 250 year. But if you lose this settlement - even to a rebellion - the whole process of integration will have to begin again from scratch. {SETTLEMENT_UNREST_NORMAL_RULES_TURKU_TITLE}No more martial law! {SETTLEMENT_UNREST_INTEGRATED_TURKU_BODY}\n\nThe settlement the locals have been calling Turku for a millenium, has been part of your realm for a century now! The burghers got accustomed to your rule and the turmoils are going to be less severe. {SETTLEMENT_UNREST_INTEGRATED_TURKU_TITLE}100 years in your realm!
5.) the Civil War script is to be logically integrated within the system. It works for now and is a great addition for situations when a weak FL gets on the throne.
Code:example will be included once necessary