Page 2 of 4 FirstFirst 1234 LastLast
Results 21 to 40 of 73

Thread: Problem with "add_settlement_turmoil" command

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Re: Problem with "add_settlement_turmoil" command

    You mean this bug, no?

    Code:
    Galatia
    	Ancyra
    	gauls
    	Galatians
    	17 165 202
    	slaves, textiles, dogs
    	5
    	8
    Things of "Total Wars"...

  2. #2
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Problem with "add_settlement_turmoil" command

    Quote Originally Posted by Miguel_80 View Post
    You mean this bug, no?

    Code:
    Galatia
        Ancyra
        gauls
        Galatians
        17 165 202
        slaves, textiles, dogs
        5
        8
    Things of "Total Wars"...
    Yes, that's the one - but it isn't a bug, Gallic tribes actually settled in the region during that time as I found out later, but they did so under the authority of local leaders if I am not mistaken.
    Last edited by Gigantus; February 27, 2016 at 10:55 PM.










  3. #3

    Default Re: Problem with "add_settlement_turmoil" command

    looks like a very good script,can use it for the cathars,so you can not see the building if it is built?do you have too put text into the export_buildings text?
    Last edited by stevietheconquer; February 26, 2016 at 10:46 AM.

  4. #4

    Default Re: Problem with "add_settlement_turmoil" command

    Quote Originally Posted by stevietheconquer View Post
    looks like a very good script,can use it for the cathars,so you can not see the building if it is built?do you have too put text into the export_buildings text?
    Yes, the text is required.

    Code:
    {revolution_name}Revolution
    {revolution}Revolution
    {revolution_desc}Revolution of citizens
    {revolution_desc_short}Revolution of citizens

    Quote Originally Posted by bitterhowl View Post
    It seems to me this way can be a shorter alternative to Region Switch Mod, right?
    Perhaps, but I think that the "capture_settlement" command, should be able to also be used for AI. The programming language of scripts is poor.

  5. #5
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,568

    Default Re: Problem with "add_settlement_turmoil" command

    It seems to me this way can be a shorter alternative to Region Switch Mod, right?

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  6. #6

    Default Re: Problem with "add_settlement_turmoil" command

    Maby you could just raise the max turmoil in the descr_settlement_mechanics?
    </factor>
    <factor name="SOF_TURMOIL">
    <pip_modifier value="1.0"/>
    <castle_modifier value="0.5"/>
    <pip_min value="0"/>
    <pip_max value="16"/>
    </factor>

  7. #7

    Default Re: Problem with "add_settlement_turmoil" command

    Quote Originally Posted by Gebilde View Post
    Maby you could just raise the max turmoil in the descr_settlement_mechanics?
    </factor>
    <factor name="SOF_TURMOIL">
    <pip_modifier value="1.0"/>
    <castle_modifier value="0.5"/>
    <pip_min value="0"/>
    <pip_max value="16"/>
    </factor>
    Yes, but it would be in general terms for all factions and cities. What I want is a punctual rebellion in one city.

  8. #8

    Default Re: Problem with "add_settlement_turmoil" command

    I think I've found a more effective way to provoke a rebellion and that a city changes of owner to "slave" faction in only one turn.

    Code:
    	monitor_event SettlementTurnStart SettlementName Cordoba
    		and I_SettlementOwner Cordoba = moors
    
    		set_religion moors heretic
    
    		set_owner_founding_conversion_rate Cordoba 0.5
    		add_settlement_turmoil Cordoba 50
    		provoke_rebellion Cordoba
    		
    		wait 2.0
    
    		set_religion moors islam
    		set_owner_founding_conversion_rate Cordoba 0.001
    
    		terminate_monitor
    	end_monitor
    Images:
    Spoiler Alert, click show to read: 



    And this, to make it a little more "apocalyptic"...

    Code:
    	monitor_conditions I_SettlementOwner Cordoba = slave
    
    		add_events
    			event	fire
    			date	0
    			position	71, 80
    		end_add_events
    
    		console_command add_population Cordoba -1200 
    
    		terminate_monitor
    	end_monitor
    Last edited by Miguel_80; April 02, 2016 at 08:43 AM.

  9. #9
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Problem with "add_settlement_turmoil" command

    Nice one.

  10. #10

    Default Re: Problem with "add_settlement_turmoil" command

    Thanks Withwnar! For me it's much more comfortable and direct than to use buildings to alter the religion and help to work the "proboke_rebellion" command.

  11. #11
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Problem with "add_settlement_turmoil" command

    Nice stuff - may I suggest to use a counter in the first monitor that gets referenced in the second monitor to avoid an unplanned apocalypse?










  12. #12

    Default Re: Problem with "add_settlement_turmoil" command

    True Gigantus, it's better organize it with counters. Even retouch other details. This was the main idea. The rest already depends on the needs of the script.

  13. #13
    bitterhowl's Avatar Campidoctor
    Join Date
    Feb 2011
    Location
    Russian Feodality
    Posts
    1,568

    Default Re: Problem with "add_settlement_turmoil" command

    That's great! I only want to ask - when the settlement becomes rebel, at the end of first turn or at the start of second?

    My sister, do you still recall the blue Hasan and Khalkhin-Gol?
    Russian warship is winning. Proofs needed? Go find yourself!

  14. #14

    Default Re: Problem with "add_settlement_turmoil" command

    Hello bitterhowl. In this case, at the start of the second turn. I haven't put any trigger that causes the rebellion. It was simply a test to verify that it works.

    Code:
    	declare_counter cordoba_rebel
    
    	monitor_event SettlementTurnStart SettlementName Cordoba
    		and I_SettlementOwner Cordoba = moors
    		and I_CompareCounter cordoba_rebel = 0
    
    		set_religion moors heretic
    
    		set_owner_founding_conversion_rate Cordoba 0.5
    		add_settlement_turmoil Cordoba 50
    		provoke_rebellion Cordoba
    		set_counter cordoba_rebel 1
    
    		wait 2.0
    		set_religion moors islam
    		set_owner_founding_conversion_rate Cordoba 0.001
    
    		terminate_monitor
    	end_monitor
    
    	monitor_conditions I_SettlementOwner Cordoba = slave
    		and I_CompareCounter cordoba_rebel = 1
    
    		add_events
    			event	fire
    			date	0
    			position	71, 80
    		end_add_events
    
    		console_command add_population Cordoba -1200 
    
    		terminate_monitor
    	end_monitor
    Last edited by Miguel_80; April 03, 2016 at 08:56 AM.

  15. #15

    Default Re: Problem with "add_settlement_turmoil" command

    Did anyone ever figure out a way for buildings to have negative public order effects? You can add negative happiness and law bonuses but these will only subtract from existing bonuses down to 0. If none of the building's order factors come from happiness or law, then negative bonuses for these from EDB won't do anything to settlement order.

  16. #16
    Gigantus's Avatar I am not special - I am a limited edition.
    Moderator Emeritus Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,682
    Blog Entries
    35

    Default Re: Problem with "add_settlement_turmoil" command

    Correct, you can't negative bonuses. I suppose reducing order related bonuses down to zero will help making the turmoil command more effective, eg it may actually cause a rebellion\riot whereas it would otherwise simply fizzle out.










  17. #17

    Default Re: Problem with "add_settlement_turmoil" command

    I guess if you used 199 monitors you could check if a building exists in every settlement and add turmoil every turn start. Reissuing the command every turn should bypass the problem with turmoil diminishing -5% per turn until it's gone. If the building is destroyed the turmoil would remain until it diminishes to 0. That might be the best way to simulate a building causing unrest rather than just reducing positive order bonuses. Just rename "turmoil" to something else and there you go.

    The obvious problem is that it's a lot of monitors for testing the presence of one building. Would be a good script for EOP.

  18. #18
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    7,494

    Default Re: Problem with "add_settlement_turmoil" command

    This may be a solution, but it may get in the way of other scripts that use the additional turmoil. You know about my script in the SSHIP - it already adds turmoil and any other mechanism using this command would have to be intergrated.
    As far as 199 monitors are concerned, it may be not so overwhelming, as the monitors for a settlement fire only once a whole turn.

    fyi, currrently I've got for each settlement a capture script (perhaps 2-3 firings a turn, who knows):
    Code:
    	;====================================================================================================	;------------------------------------------------------------------------------  BERGEN After Capture
    
    
        declare_counter current_name_Bergen						; 0 - Bergvin
        set_counter current_name_Bergen 0
    	set_event_counter Bergen_turns_in_our_realm 500
    
    
        monitor_event GeneralCaptureSettlement SettlementName Bergen
    
    
    		wait 0.5
    		log --- Bergen AFTER CAPTURE NAME CHANGE ----------------------------------------
    
    
    
    
    		log --- Bergen AFTER CAPTURE REBEL ARMIES SPAWN --------------------------------------
    		
            if I_NumberOfSettlements norway > 0						; faction exists
    		and I_EventCounter faction_size_small < 1				; not for small faction
    		and RandomPercent < 66									; some randomness is always good, also for armies spawned
    		and I_EventCounter DifficultyLevel > 2					; only for H/VH difficulties
    		and I_EventCounter faction_turn_norway < 1				; not in core Scandinavian region		
    		and I_EventCounter faction_turn_denmark < 1				; not in core Scandinavian region
    
    
    			historic_event SETTLEMENT_CAPTURE_REBELLION
    
    
    			spawn_army
    				faction norway
    					character random_name, named character, age 38, x 123, y 274
                        traits CounterOfBattles 5, NaturalMilitarySkill 3 , GoodCommander 1 , Hardened 3 , StrategyDread 2 , Bloodthirsty 2 , Berserker 3 , Paranoia 4
    					unit	NE Bodyguard 			exp 1 armour 0 weapon_lvl 0
    					unit	Scouts					exp 0 armour 0 weapon_lvl 0
    					unit	Viking Raiders			exp 0 armour 0 weapon_lvl 0					
    					unit	Woodsmen				exp 7 armour 0 weapon_lvl 0
    					unit	Woodsmen				exp 0 armour 0 weapon_lvl 0	
    					unit	Bondir					exp 7 armour 0 weapon_lvl 0
    					unit	Bondir					exp 1 armour 0 weapon_lvl 0
    					unit	Bondir					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 --- Bergen AFTER CAPTURE COUNTERS & OTHER EFFECTS --------------------------------
    	
    		set_event_counter Bergen_turns_in_our_realm 0					; core Scandinavia, so in the Settlement Unrest script there's 500 pts for both Norway and Denmark
    
    
            if I_EventCounter faction_turn_norway > 0	
    			set_event_counter Bergen_turns_in_our_realm 20				; but if FL is weak, then that trigger for 500 pts. won't fire
            end_if
    
    
            if I_EventCounter faction_turn_denmark > 0	
    			set_event_counter Bergen_turns_in_our_realm 20
            end_if
    		
            if I_EventCounter is_the_player > 0	
    			inc_counter number_settlements_conquered_by_player 1
            end_if
    
    
    
    
    		log --- Bergen AFTER CAPTURE IMPACT ON PLAYER AGGRESSIVITY REPUTATION ----------------
    		; (no need to use small faction condition as each of small factions will expand in its legitimate territories)
    		
            if I_EventCounter is_the_player > 0								; only player 
    		and I_EventCounter DifficultyLevel > 3							; VH difficulty	
    		and I_EventCounter faction_turn_norway < 1						; expansion in Scandinavia is legitimate for Norway		
    		and I_EventCounter faction_turn_denmark < 1						; expansion in Scandinavia is legitimate for Denmark
    
    
    			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
    and also the turmoil situation firing every turn (so 199 firings)
    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

  19. #19

    Default Re: Problem with "add_settlement_turmoil" command

    My idea was just to do something like:

    Code:
    monitor_event SettlementTurnStart SettlementName <settlement_name>
    and SettlementBuildingExists <building_level_name>
       add_settlement_turmoil <settlement_name> 1
    end_monitor
    
    ;duplicate monitor for all other settlements
    This puts turmoil in the settlement as a result of the building and if the building is destroyed then the turmoil gradually decreases to 0. Assuming no other causes of turmoil, we could rename it and change the pip to whatever we want and call it a day. The problem is that this tests the presents of only one building level in each settlement. Multiply the number of buildings you want to test by the number of settlements and you quickly end up with thousands of monitors. In my experience, it's the sheer number of active (non-terminated) monitors that impacts AI turn times, it doesn't matter which events you're actually monitoring or if they're firing or not.

    I looked into writing this as an EOP script but there is currently no support for script commands in EOP. There are a few functions which are similar to script commands and a few of the console commands work, but add_settlement_turmoil is not among them.

  20. #20
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    7,494

    Default Re: Problem with "add_settlement_turmoil" command

    Quote Originally Posted by Callistonian View Post
    In my experience, it's the sheer number of active (non-terminated) monitors that impacts AI turn times, it doesn't matter which events you're actually monitoring or if they're firing or not.
    This is something I've recall being discussed in the past, and the conclusion was that it does matter (for the turn times) if a monitor fires or not, and how fast is being ended (I mean: not terminated, but meets a condition that't not fullfilled). Thus it's better to put the most unlikely conditions at the beginning, and to hide many issues in the if- clauses.

    On your building: the EBII has a buildind Statsis that adds constant turmoil but they do it with negative law, and perhaps do not go below 0:
    Code:
    building hinterland_uniques4{
    	levels fourone fourtwo fourthree fourfour fourfive foursix fourseven foureight
    	{
    		fourone requires factions { all, } and event_counter does_not_exist 1
    ;		 1 Worth 1,500 each for destroying
    ;		 fourone cul_5 barbarian = Senon Cloceron (Callanish Stones) - KALEDONON Dunopalator
    ;		 fourone cul_7 semitic_african = Border Resource - DIAMAT Axum & HADRAMAWT Shabwat
    ;		 fourone cul_1 greek = Hellenic Stasis - 18 Hellenic provinces in Hellas, Ionia, Sicily and Black Sea
    ;		 fourone cul_3 east_greek = Pharos Alexandreias - DELTA NEILOU Alexandreia
    ;		 fourone cul_6 nomad
    ;		 fourone cul_4 eastern = Ustyurt Sanctuaries - KHWARAZM Khwarazm
    ;		 fourone cul_2 roman
    		{
    			capability
    			{
    ;			  Hellenic Stasis bonus (penalty):
    				law_bonus bonus -4 requires factions { cul_1, cul_3, } and not building_present govallied and hidden_resource greek1 or hidden_resource greek2 or hidden_resource lydian
    				law_bonus bonus 4 requires factions { f_kh, } and building_present_min_level govkh kh7 and hidden_resource greek1 or hidden_resource greek2 or hidden_resource lydian
    				law_bonus bonus -4 requires factions { f_rome, } and not building_present govallied and hidden_resource hr_island and hidden_resource royal_core and not region_religion rel_g 50 ; Syrakousai
    				law_bonus bonus -4 requires factions { f_carthage, } and not building_present govallied and hidden_resource hr_island and hidden_resource royal_core ; Syrakousai
    				law_bonus bonus 2 requires factions { f_carthage, } and building_present govallied and hidden_resource hr_island and hidden_resource royal_core ; Syrakousai
    ;			 Senon Cloceron bonus:
    				law_bonus bonus 1 requires factions { f_casse, } and hidden_resource briton and hidden_resource eastcelt
    ;			 Ustyurt Sanctuaries bonus:
    			  happiness_bonus bonus 1 requires factions { f_parthia, f_saka, f_sauromatae, } and hidden_resource daha
    ;			 Border Resource for Diamat & Himyarum:
    				recruits_morale_bonus bonus 1 requires factions { all, } and hidden_resource saba_core ; No effect other than to provide the visible text for the Trade Good bonus
    				trade_base_income_bonus bonus 1 requires factions { all, } and hidden_resource saba_core
    ;			 Pharos Alexandreias bonuses:
    				navy_bonus 1 requires factions { cul_1, cul_3, } and hidden_resource egypt and hidden_resource hellen1
    				recruits_morale_bonus bonus 1 requires factions { all, } and hidden_resource egypt and hidden_resource hellen1 ; No effect other than to provide the visible text for the Trade Good bonus
    				trade_base_income_bonus bonus 1 requires factions { all, } and hidden_resource egypt and hidden_resource hellen1
    			}
    			material stone
    			construction  1
    			cost  4500
    			settlement_min town
    			upgrades
    			{
    				fourtwo
    			}
    		}

Page 2 of 4 FirstFirst 1234 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •