Results 1 to 12 of 12

Thread: Administrative Policy Script

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Administrative Policy Script

    This thread is for developing the Administrative Policy script.

    Here is the current version as of today:

    Code:
    ;--------------------------------------------
    ;-- Sub-Section 1B - Administrative Policy --
    ;--------------------------------------------
    ;**********Script 1B-1 - Prompt, Exhaustion and Timer**********
    ;|Author| Augustus Lucifer
    ;|Purpose| Prompt the player to choose policy, set policy, and start timer until policy change.
    ;|Changelog|
    ; o Script Created 3-07-09
    ; o 3-07-09
    ;		Commented out part that sets military exhaustion until national tendencies determined
    ;		
    
    declare_counter policy_timer
    declare_counter military_policy
    declare_counter economic_policy
    declare_counter cultural_policy
    declare_counter recovery_policy
    declare_counter current_policy
    declare_counter last_policy
    declare_counter last_policy_delay
    declare_counter policy_change
    declare_counter military_exhaustion_compiler
    declare_counter military_exhaustion
    declare_counter exhaustion_timer
    declare_counter exhaustion_history
    declare_counter exhaustion_kills_faction
    
    ;Prompt player for Military(Accept) or choice of Economic/Cultural(Decline)
    monitor_event FactionTurnStart FactionIsLocal
    		and I_CompareCounter policy_timer == 0
    		and I_CompareCounter military_exhaustion == 0
    		
    	add_events
       		event counter policy1_accepted
       		event counter policy1_declined
       		date 0
      	end_add_events
      	historic_event policy1 true
    end_monitor
    
    ;If Accepted, set to Military policy
    monitor_conditions I_EventCounter policy1_accepted == 1
    	set_counter policy_timer 20
    	set_counter military_policy 1
    	set_counter economic_policy 0
    	set_counter cultural_policy 0
    	set_counter recovery_policy 0
    	set_counter current_policy 1
    	set_counter policy_change 1
    	inc_counter military_exhaustion_compiler 1
    	set_counter last_policy_delay 3
    	set_event_counter policy1_accepted 0
    	historic_event military_policy
    end_monitor
    
    ;If Declined, prompt for Economic(Accept) or Cultural(Decline)
    monitor_conditions I_EventCounter policy1_declined == 1
    	add_events
       		event counter policy2_accepted
       		event counter policy2_declined
       		date 0
      	end_add_events
      	historic_event policy2 true
    	set_event_counter policy1_declined 0
    end_monitor
    
    ;If player chooses Accept, set to Economic
    monitor_conditions I_EventCounter policy2_accepted == 1
    	set_counter policy_timer 20
    	set_counter military_policy 0
    	set_counter economic_policy 1
    	set_counter cultural_policy 0
    	set_counter recovery_policy 0
    	set_counter current_policy 2
    	set_counter policy_change 1
    	inc_counter military_exhaustion_compiler -1
    	set_counter last_policy_delay 3
    	set_event_counter policy2_accepted 0
    	historic_event economic_policy
    end_monitor
    
    ;If player chooses Decline, set to Cultural
    monitor_conditions I_EventCounter policy2_declined == 1
    	set_counter policy_timer 20
    	set_counter military_policy 0
    	set_counter economic_policy 0
    	set_counter cultural_policy 1
    	set_counter recovery_policy 0
    	set_counter current_policy 3
    	set_counter policy_change 1
    	inc_counter military_exhaustion_compiler -1
    	set_counter last_policy_delay 3
    	set_event_counter policy2_declined 0
    	historic_event cultural_policy
    end_monitor
    
    ;Set delay between last policy and current policy so processing can occur
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_change == 1
    	inc_counter last_policy_delay -1
    end_monitor
    
    ;End delay so last policy can be reset
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter last_policy_delay == 0
    		and I_CompareCounter policy_change == 1
    	set_counter policy_change 2
    end_monitor
    
    ;Set last policy counter
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_change == 2
    	if I_CompareCounter current_policy == 1
    		set_counter last_policy 1
    	end_if
    	if I_CompareCounter current_policy == 2
    		set_counter last_policy 2
    	end_if
    	if I_CompareCounter current_policy == 3
    		set_counter last_policy 3
    	end_if
    	if I_CompareCounter current_policy == 4
    		set_counter last_policy 4
    	end_if
    	set_counter policy_change 0
    end_monitor
    	
    ;Decrease the policy timer each turn
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_timer > 0
    	inc_counter policy_timer -1
    end_monitor
    
    ;Set policy to recovery if military exhaustion accrued, severity based on history
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_timer == 0
    		and I_CompareCounter military_exhaustion == 1
    		and I_CompareCounter recovery_policy == 0
    	set_counter military_policy 0
    	set_counter economic_policy 0
    	set_counter cultural_policy 0
    	set_counter recovery_policy 1
    	set_counter current_policy 4
    	set_counter policy_change 1
    	set_counter last_policy_delay 3
    	historic_event recovery_policy
    	
    	if I_CompareCounter exhaustion_history == 0
    		set_counter exhaustion_timer 12
    	end_if
    	if I_CompareCounter exhaustion_history == 1
    		set_counter exhaustion_timer 24
    	end_if
    	if I_CompareCounter exhaustion_history == 2
    		set_counter exhaustion_timer 40
    	end_if
    	if I_CompareCounter exhaustion_history == 3
    		set_counter exhaustion_kills_faction 1
    	end_if
    end_monitor
    
    ;Decrease exhaustion timer each turn
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter exhaustion_timer > 0
    		and I_CompareCounter military_exhaustion == 1
    	inc_counter exhaustion_timer -1
    end_monitor
    	
    ;Once the exhaustion timer expires, set exhaustion back to 0 so policy choosing continues as normal
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter exhaustion_timer == 0
    		and I_CompareCounter military_exhaustion == 1
    		and I_CompareCounter recovery_policy == 1
    	set_counter military_exhaustion 0
    	set_counter military_exhaustion_compiler 0
    	inc_counter exhaustion_history 1
    end_monitor
    
    ;If faction is militarily exhausted far to long, the faction succumbs to internal strife and is destroyed
    monitor_event FactionTurnStart FactionIsLocal
    		and FactionType song
    		and I_CompareCounter exhaustion_kills_faction == 1
    	give_everything_to_faction song slave true
    end_monitor
    monitor_event FactionTurnStart FactionIsLocal
    		and FactionType jin
    		and I_CompareCounter exhaustion_kills_faction == 1
    	give_everything_to_faction jin slave true
    end_monitor
    monitor_event FactionTurnStart FactionIsLocal
    		and FactionType goryeo
    		and I_CompareCounter exhaustion_kills_faction == 1
    	give_everything_to_faction goryeo slave true
    end_monitor
    monitor_event FactionTurnStart FactionIsLocal
    		and FactionType taira
    		and I_CompareCounter exhaustion_kills_faction == 1
    	give_everything_to_faction taira slave true
    end_monitor
    monitor_event FactionTurnStart FactionIsLocal
    		and FactionType minamoto
    		and I_CompareCounter exhaustion_kills_faction == 1
    	give_everything_to_faction minamoto slave true
    end_monitor
    monitor_event FactionTurnStart FactionIsLocal
    		and FactionType daiviet
    		and I_CompareCounter exhaustion_kills_faction == 1
    	give_everything_to_faction daiviet slave true
    end_monitor
    monitor_event FactionTurnStart FactionIsLocal
    		and FactionType champa
    		and I_CompareCounter exhaustion_kills_faction == 1
    	give_everything_to_faction champa slave true
    end_monitor
    monitor_event FactionTurnStart FactionIsLocal
    		and FactionType khmer
    		and I_CompareCounter exhaustion_kills_faction == 1
    	give_everything_to_faction khmer slave true
    end_monitor
    monitor_event FactionTurnStart FactionIsLocal
    		and FactionType dali
    		and I_CompareCounter exhaustion_kills_faction == 1
    	give_everything_to_faction dali slave true
    end_monitor
    monitor_event FactionTurnStart FactionIsLocal
    		and FactionType pagan
    		and I_CompareCounter exhaustion_kills_faction == 1
    	give_everything_to_faction pagan slave true
    end_monitor
    monitor_event FactionTurnStart FactionIsLocal
    		and FactionType tibet
    		and I_CompareCounter exhaustion_kills_faction == 1
    	give_everything_to_faction tibet slave true
    end_monitor
    monitor_event FactionTurnStart FactionIsLocal
    		and FactionType xixia
    		and I_CompareCounter exhaustion_kills_faction == 1
    	give_everything_to_faction xixia slave true
    end_monitor
    monitor_event FactionTurnStart FactionIsLocal
    		and FactionType khitans
    		and I_CompareCounter exhaustion_kills_faction == 1
    	give_everything_to_faction khitans slave true
    end_monitor
    monitor_event FactionTurnStart FactionIsLocal
    		and FactionType mongols
    		and I_CompareCounter exhaustion_kills_faction == 1
    	give_everything_to_faction mongols slave true
    end_monitor
    monitor_event FactionTurnStart FactionIsLocal
    		and FactionType ghurid
    		and I_CompareCounter exhaustion_kills_faction == 1
    	give_everything_to_faction song ghurid true
    end_monitor
    
    ;Faction tolerance to exhaustion determines how many levels of compiler makes exhausted
    ;This is commented out because national tendencies have not yet been decided
    ;monitor_event FactionTurnEnd FactionIsLocal
    ;		and FactionType song
    ;		and I_CompareCounter military_exhaustion_compiler == 2
    ;	set_counter military_exhaustion 1
    ;end_monitor
    
    ;**********Script 1B-2 - Military Policy**********
    ;|Author| Augustus Lucifer
    ;|Purpose| Scripted effects during Military Policy.
    ;|Changelog|
    ; o Script Created 3-07-09
    
    ;;Garrison Script Elsewhere
    
    ;;Script to create/destroy hinterland_building that gives negative growth and happiness here
    
    ;**********Script 1B-3 - Economic Policy**********
    ;|Author| Augustus Lucifer
    ;|Purpose| Scripted effects during Economic Policy.
    ;|Changelog|
    ; o Script Created 3-07-09
    
    ;;Yearly stipend script here
    
    ;;Randomize corruption building that grants 100% corruption trait to governors
    
    ;**********Script 1B-4 - Cultural Policy**********
    ;|Author| Augustus Lucifer
    ;|Purpose| Scripted effects during Cultural Policy.
    ;|Changelog|
    ; o Script Created 3-07-09
    
    ;;Script to create/destroy hinterland_building that gives positive happiness and growth.
    
    ;;Randomize humanitarian building that grants 100% humanitarian traits to governors
    
    ;;Garrison to population ratio massive unrest building
    
    ;**********Script 1B-5 - Recovery Policy**********
    ;|Author| Augustus Lucifer
    ;|Purpose| Scripted effects during Recovery Policy.
    ;|Changelog|
    ; o Script Created 3-07-09
    I haven't done most of the sub-scripts because they are heavily region-dependent, and some region names are still up in the air(this really REALLY needs to get resolved).

    At current there is a problem with the script. Initially it was spawning an infinite number of Cultural Policy Chosen events and re-spawning the accept/decline indefinitely. That was fixed when I forgot to add the d to the end of declined on one of the event counters. However as you can see from the below log, it is still setting Cultural policy something like 3 times, before any answer is ever given to the first Accept/Decline scroll. I can't quite find what the issue is, since the event counter 'policy2_declined' should not be setting itself to 1 before I click decline, so logically speaking that monitor_conditions should not be firing, but it is...

    The relevant section of the log:
    Code:
    08:55:39.015 [game.script.exec] [trace] exec <add_events> at line 160 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:39.015 [game.script.exec] [trace] exec <historic_event> at line 164 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:39.046 [game.script.exec] [trace] exec <add_events> at line 185 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:39.046 [game.script.exec] [trace] exec <historic_event> at line 189 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:39.046 [game.script.exec] [trace] exec <set_event_counter> at line 190 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:39.046 [game.script.exec] [trace] exec <set_counter> at line 210 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:39.046 [game.script.counter] [trace] counter <policy_timer> = 20
    08:55:39.046 [game.script.exec] [trace] exec <set_counter> at line 211 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:39.046 [game.script.counter] [trace] counter <military_policy> = 0
    08:55:39.046 [game.script.exec] [trace] exec <set_counter> at line 212 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:39.046 [game.script.counter] [trace] counter <economic_policy> = 0
    08:55:39.046 [game.script.exec] [trace] exec <set_counter> at line 213 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:39.046 [game.script.counter] [trace] counter <cultural_policy> = 1
    08:55:39.046 [game.script.exec] [trace] exec <set_counter> at line 214 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:39.046 [game.script.counter] [trace] counter <recovery_policy> = 0
    08:55:39.046 [game.script.exec] [trace] exec <set_counter> at line 215 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:39.046 [game.script.counter] [trace] counter <current_policy> = 3
    08:55:39.046 [game.script.exec] [trace] exec <set_counter> at line 216 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:39.046 [game.script.counter] [trace] counter <policy_change> = 1
    08:55:39.046 [game.script.exec] [trace] exec <inc_counter> at line 217 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:39.046 [game.script.counter] [trace] counter <military_exhaustion_compiler> = -1
    08:55:39.046 [game.script.exec] [trace] exec <set_counter> at line 218 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:39.046 [game.script.counter] [trace] counter <last_policy_delay> = 3
    08:55:39.046 [game.script.exec] [trace] exec <set_event_counter> at line 219 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:39.046 [game.script.exec] [trace] exec <historic_event> at line 220 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:51.187 [game.script.exec] [trace] exec <add_events> at line 185 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:51.187 [game.script.exec] [trace] exec <historic_event> at line 189 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:51.187 [game.script.exec] [trace] exec <set_event_counter> at line 190 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:51.187 [game.script.exec] [trace] exec <set_counter> at line 210 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:51.187 [game.script.counter] [trace] counter <policy_timer> = 20
    08:55:51.187 [game.script.exec] [trace] exec <set_counter> at line 211 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:51.187 [game.script.counter] [trace] counter <military_policy> = 0
    08:55:51.187 [game.script.exec] [trace] exec <set_counter> at line 212 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:51.187 [game.script.counter] [trace] counter <economic_policy> = 0
    08:55:51.187 [game.script.exec] [trace] exec <set_counter> at line 213 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:51.187 [game.script.counter] [trace] counter <cultural_policy> = 1
    08:55:51.187 [game.script.exec] [trace] exec <set_counter> at line 214 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:51.187 [game.script.counter] [trace] counter <recovery_policy> = 0
    08:55:51.187 [game.script.exec] [trace] exec <set_counter> at line 215 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:51.187 [game.script.counter] [trace] counter <current_policy> = 3
    08:55:51.187 [game.script.exec] [trace] exec <set_counter> at line 216 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:51.187 [game.script.counter] [trace] counter <policy_change> = 1
    08:55:51.187 [game.script.exec] [trace] exec <inc_counter> at line 217 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:51.187 [game.script.counter] [trace] counter <military_exhaustion_compiler> = -2
    08:55:51.187 [game.script.exec] [trace] exec <set_counter> at line 218 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:51.187 [game.script.counter] [trace] counter <last_policy_delay> = 3
    08:55:51.187 [game.script.exec] [trace] exec <set_event_counter> at line 219 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:51.187 [game.script.exec] [trace] exec <historic_event> at line 220 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:57.687 [game.script.exec] [trace] exec <set_counter> at line 210 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:57.687 [game.script.counter] [trace] counter <policy_timer> = 20
    08:55:57.687 [game.script.exec] [trace] exec <set_counter> at line 211 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:57.687 [game.script.counter] [trace] counter <military_policy> = 0
    08:55:57.687 [game.script.exec] [trace] exec <set_counter> at line 212 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:57.687 [game.script.counter] [trace] counter <economic_policy> = 0
    08:55:57.687 [game.script.exec] [trace] exec <set_counter> at line 213 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:57.687 [game.script.counter] [trace] counter <cultural_policy> = 1
    08:55:57.687 [game.script.exec] [trace] exec <set_counter> at line 214 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:57.687 [game.script.counter] [trace] counter <recovery_policy> = 0
    08:55:57.687 [game.script.exec] [trace] exec <set_counter> at line 215 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:57.687 [game.script.counter] [trace] counter <current_policy> = 3
    08:55:57.687 [game.script.exec] [trace] exec <set_counter> at line 216 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:57.687 [game.script.counter] [trace] counter <policy_change> = 1
    08:55:57.687 [game.script.exec] [trace] exec <inc_counter> at line 217 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:57.687 [game.script.counter] [trace] counter <military_exhaustion_compiler> = -3
    08:55:57.687 [game.script.exec] [trace] exec <set_counter> at line 218 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:57.687 [game.script.counter] [trace] counter <last_policy_delay> = 3
    08:55:57.687 [game.script.exec] [trace] exec <set_event_counter> at line 219 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:55:57.687 [game.script.exec] [trace] exec <historic_event> at line 220 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:56:05.718 [game.script.exec] [trace] exec <set_counter> at line 210 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:56:05.718 [game.script.counter] [trace] counter <policy_timer> = 20
    08:56:05.718 [game.script.exec] [trace] exec <set_counter> at line 211 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:56:05.718 [game.script.counter] [trace] counter <military_policy> = 0
    08:56:05.718 [game.script.exec] [trace] exec <set_counter> at line 212 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:56:05.718 [game.script.counter] [trace] counter <economic_policy> = 0
    08:56:05.718 [game.script.exec] [trace] exec <set_counter> at line 213 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:56:05.718 [game.script.counter] [trace] counter <cultural_policy> = 1
    08:56:05.718 [game.script.exec] [trace] exec <set_counter> at line 214 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:56:05.718 [game.script.counter] [trace] counter <recovery_policy> = 0
    08:56:05.718 [game.script.exec] [trace] exec <set_counter> at line 215 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:56:05.718 [game.script.counter] [trace] counter <current_policy> = 3
    08:56:05.718 [game.script.exec] [trace] exec <set_counter> at line 216 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:56:05.718 [game.script.counter] [trace] counter <policy_change> = 1
    08:56:05.718 [game.script.exec] [trace] exec <inc_counter> at line 217 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:56:05.718 [game.script.counter] [trace] counter <military_exhaustion_compiler> = -4
    08:56:05.718 [game.script.exec] [trace] exec <set_counter> at line 218 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:56:05.718 [game.script.counter] [trace] counter <last_policy_delay> = 3
    08:56:05.718 [game.script.exec] [trace] exec <set_event_counter> at line 219 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    08:56:05.718 [game.script.exec] [trace] exec <historic_event> at line 220 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    09:00:17.078 [game.script.exec] [trace] exec <inc_counter> at line 226 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    09:00:17.078 [game.script.counter] [trace] counter <last_policy_delay> = 2
    09:00:17.078 [game.script.exec] [trace] exec <inc_counter> at line 257 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    09:00:17.078 [game.script.counter] [trace] counter <policy_timer> = 19
    Last edited by Augustus Lucifer; March 08, 2009 at 03:36 AM.

  2. #2
    S-te-Fan's Avatar Primicerius
    Join Date
    Jun 2008
    Location
    Diessen, The Netherlands, Near the belgium border.
    Posts
    3,905

    Default Re: Administrative Policy Script

    So.... what does it do .

  3. #3
    Wundai's Avatar Artifex
    Join Date
    Mar 2006
    Location
    Eindhoven
    Posts
    5,332

    Default Re: Administrative Policy Script

    Sigh... Stefan, what the ***** are you doing annoying all the coders

  4. #4
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Administrative Policy Script

    Quote Originally Posted by Wundai View Post
    Sigh... Stefan, what the ***** are you doing annoying all the coders
    We have more than one coder?

    Quote Originally Posted by stefaneke View Post
    So.... what does it do .
    It sets up the scripting environment for the policy system with some basic parameters and counters. If you're asking what the policy system is, this should explain it:

    Administrative Policy

    Our Administrative Policy system is our personal take on differentiating production paths with an underlying system in order to add more weight and impact to the developmental paths chosen by the players. The system is an underlying one which will act upon a lot of other features of the mod, and force the player to consider the route she needs to take her nation in at the time. Every 5 years the player will be prompted to choose a new policy for her administration. This policy can be either Military, Economic, or Cultural. Depending on which policy the player chooses, certain benefits and penalties will come along with it. The final system will likely feature many sweeping effects, but here's a look at the system in its current form.

    Military Policy

    Military policy focuses on strengthening the army and the pursuit of things that allow a nation to both defend themselves from aggressors and persecute wars to expand their territory. A nation that focuses primarily on the military will not have access to some of the features of an economic or cultural focus.

    Benefits
    • Can build military buildings of higher tiers. This includes Stables, Ranges, Barracks, Blacksmiths, Officer Academies, Policing Agencies, and other miscellaneous military buildings.
    • All new troops trained will receive bonuses to their initial stats thanks to the increased funding for recruit training.
    • Elite troops will be recruited much quicker and replenish much faster than in other policies.
    • Increased scholarship for military officer education means that new officers in your empire will have greater command abilities.
    • Readiness of the populace for wartime means that a number of militia will rise to defend a settlement if it is under siege.


    Downsides
    • Can not build advanced economic and cultural structures while maintaining a military policy.
    • Population growth is severely hindered as the young adult population is sent to war.
    • Happiness across the empire will decrease, especially in settlements where the population is not traditionally warlike.
    • War exhaustion can set in. If military policy is the policy of two consecutive administrations, chance of riots are increased exponentially. Three or more and you might be using all your elite troops to suppress revolts.


    Economic Policy

    Economic policy focuses on the generation of wealth and the strengthening of the market structure. A nation that focuses primarily on the economy will not have access to some of the features of an military or cultural focus.

    Benefits
    • Can build higher tier buildings of economic advancement such as Markets, Ports, Roads, Farms, Government, and Businesses.
    • Will receive a yearly stipend of additional generated wealth.
    • Merchants will receive bonuses to their trade abilities.
    • Financial institutions will educate governors on good administration practices.


    Downsides
    • Can not build advanced military or cultural structures while maintaining an economic policy.
    • Mercenaries will expect more in return for their services since they know your military isn't strong but your purse is.
    • Generals and Governors are likely to grow fat on their wealth and develop negative and greedy tendencies.
    • Increased cash flow means that scandals and corruption are more rampant.


    Cultural Policy

    Cultural policy focuses on such things as literature, art, architecture, religion, science, and society. A nation that focuses primarily on the society will not have access to some of the features of an economic or military focus.

    Benefits
    • Can build higher tier buildings of cultural advancement such as Inns, Universities, Studios, Public Services, Statues, and Temples.
    • The happiness and population growth across the nation is raised tremendously.
    • Technology is researched at a much faster rate.
    • Unique and powerful ancillaries become available as a result of the cultural revolution.
    • Governors and Generals are more likely to develop humanitarian tendencies.


    Downsides
    • Can not build advanced military or economic structures while maintaining an cultural policy.
    • The population is appalled by the notion of war, and enemy units near cities, or garrisons that rival the population in a city can cause mass rioting.
    • Social outcasts can form into groups and sow discontent that governors and generals can get caught up in for harsh consequences.


    National Tendencies

    All nations have a key focus, a tendency that their populous is used to in their administrations. In Exploration Age Europe, the Dutch had a strong Economic policy which allowed them to establish the West and East Indies companies, and were generally non-aggressive on their home soil. Italy during the Renaissance had a very strong cultural policy which enabled important figures of science to advance human knowledge very far. America in the Modern Age has a very strong military policy, spending as much as all the other nations of the world combined on defense allocation, enabling them to be a superpower.

    This is no different in Medieval Asia. The Song Dynasty is the epitome of civil administration, the facets of economic policy come very easy to them, and they are used to a focus on increasing their enormous wealth to further their other interests. The Kingdom of Dali is confined between the large powers of Indochina and the powerful Chinese dynasties to the north, so their policy of complacence lends way to cultural advancements. The Mongol Khanate is bred from conflict, baptized on the field of battle, and has all the makings of a war machine, so their population is amply prepared to practice a strong military policy.

    When a national policy matches that of the policy that their nation has a tendency towards, they experience lessened negative effects from that policy. The Mongol war machine can go decades without any real sense of war exhaustion, enabling them to further their goals by way of conquest. Similar examples apply to the other nations of the eastern Asia subcontinent. Practicing the preferred policy of your nation will often be in your best interests for this reason.
    And the fourth one, Recovery Policy, should be pretty self-explanatory. All of the money is spent trying to regain equilibrium and contentedness of the populace after prolonged war, so you can't advance either of the three during that time, which means no high tier buildings or bonuses are available, and some small penalties are incurred.

  5. #5
    Wundai's Avatar Artifex
    Join Date
    Mar 2006
    Location
    Eindhoven
    Posts
    5,332

    Default Re: Administrative Policy Script

    Oh sorry, I meant annoy all the people watching his post and the One and Only Coder

  6. #6
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Administrative Policy Script

    Just an update to what the problem is, don't know if I adequately explained exactly what happened above. When you load the campaign, three things happen:

    1) The first Accept/Decline scroll shows up
    2) The second Accept/Decline scroll shows up(without waiting for the first to process)
    3) A cultural policy is instituted(without waiting for the second to process)

    What 2 and 3 seem to have in common, are working off the Declined parameter. I postulate that the problem has something intrinsic to do with the declined function of the accept/decline scrolls. Perhaps all events of this nature, weird as it may seem, start off with Declined as 1. If we assume that to be true, that explains why it fires the second one before the player inputs, and the Cultural Policy again, as both the events are contained within the sections.

    Assuming this is the case, we run into a problem. I could make it so that the two running on decline require a counter that is set in the first event, but this doesn't remedy the problem, because that counter will be set when the event is processed, which is before the player inputs just the same. There's no condition I'm aware of to gauge whether the player has input on the scroll or not, excepting direct association with either accept or decline.

    On the other hand, I could possibly set Declined to 0 right after calling the event.

    EDIT: And it works. Wow. That was unexpected to say the least. What I did is add "set_event_counter policy1_declined 0" and the same for policy2 right after the event was added in the monitor, which processes before it can move on to another monitor. This confirms almost beyond a shadow of a doubt that the game sets the declined option to 1 when the event is called.
    Last edited by Augustus Lucifer; March 12, 2009 at 04:50 PM.

  7. #7
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Administrative Policy Script

    A new section has been added to the main part of the script. I'd forgotten to add the event counters bit. In the script, I use counters everywhere because they are only applicable within the script, which means that as long as all the monitors that check for them use FactionIsLocal, the AI won't be adversely affected by the player's decision. In the EDB however, which is where the main other function is considered, event counters are necessary. With this in mind, before the faction turn start, the three counters which impact the EDB(military_policy, economic_policy, and cultural_policy) are checked for values of 0 or 1 and their event counter is set accordingly. So this does not affect the AI, all three are set to 1 when the player clicks end turn, thus allowing the AI to not be restricted by player policy.

    Code:
    ;Set the event counters that correspond to the counters
    monitor_event PreFactionTurnStart FactionIsLocal
    
    	if I_CompareCounter military_policy == 1
    		set_event_counter military_policy 1
    	end_if
    	if I_CompareCounter military_policy == 0
    		set_event_counter military_policy 0
    	end_if
    	if I_CompareCounter economic_policy == 1
    		set_event_counter economic_policy 1
    	end_if
    	if I_CompareCounter economic_policy == 0
    		set_event_counter economic_policy 0
    	end_if
    	if I_CompareCounter cultural_policy == 1
    		set_event_counter cultural_policy 1
    	end_if
    	if I_CompareCounter cultural_policy == 0
    		set_event_counter cultural_policy 0
    	end_if
    
    end_monitor
    
    ;Set all to 1 for the AI so their building paths are not restricted
    monitor_event ButtonPressed ButtonPressed end_turn
    	set_event_counter military_policy 1
    	set_event_counter economic_policy 1
    	set_event_counter cultural_policy 1
    end_monitor

  8. #8
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Administrative Policy Script

    Okay here's another bit of the script. This is relevant to the creation and destruction of the buildings that will govern the bonuses and penalties in the script for each policy. I think the sections are pretty self-explanatory. The last monitor is obviously far from complete, I will replicate it once it works for one city. The current problem is the if statements don't seem to want to grab the exports from the events used in the main monitor.

    Script
    Code:
    ;**********Script 1B-2 - Policy Buildings**********
    ;|Author| Augustus Lucifer
    ;|Purpose| Policy Buildings built to simulate related effects.
    ;|Changelog|
    ; o Script Created 3-14-09
    
    ;Remove policy effect buildings for AI faction
    monitor_event FactionTurnEnd FactionIsLocal
    	
    	if FactionType song
    		destroy_buildings jin hinterland_policy_effects true
    		destroy_buildings goryeo hinterland_policy_effects true
    		destroy_buildings khitans hinterland_policy_effects true
    		destroy_buildings dali hinterland_policy_effects true
    		destroy_buildings mongols hinterland_policy_effects true
    		destroy_buildings khmer hinterland_policy_effects true
    		destroy_buildings tibet hinterland_policy_effects true
    		destroy_buildings daiviet hinterland_policy_effects true
    		destroy_buildings xixia hinterland_policy_effects true
    		destroy_buildings taira hinterland_policy_effects true
    		destroy_buildings minamoto hinterland_policy_effects true
    		destroy_buildings champa hinterland_policy_effects true
    		destroy_buildings pagan hinterland_policy_effects true
    		destroy_buildings ghurid hinterland_policy_effects true
    		destroy_buildings challenge hinterland_policy_effects true
    		destroy_buildings scripting hinterland_policy_effects true
    		destroy_buildings slave hinterland_policy_effects true
    	end_if
    	if FactionType jin
    		destroy_buildings song hinterland_policy_effects true
    		destroy_buildings goryeo hinterland_policy_effects true
    		destroy_buildings khitans hinterland_policy_effects true
    		destroy_buildings dali hinterland_policy_effects true
    		destroy_buildings mongols hinterland_policy_effects true
    		destroy_buildings khmer hinterland_policy_effects true
    		destroy_buildings tibet hinterland_policy_effects true
    		destroy_buildings daiviet hinterland_policy_effects true
    		destroy_buildings xixia hinterland_policy_effects true
    		destroy_buildings taira hinterland_policy_effects true
    		destroy_buildings minamoto hinterland_policy_effects true
    		destroy_buildings champa hinterland_policy_effects true
    		destroy_buildings pagan hinterland_policy_effects true
    		destroy_buildings ghurid hinterland_policy_effects true
    		destroy_buildings challenge hinterland_policy_effects true
    		destroy_buildings scripting hinterland_policy_effects true
    		destroy_buildings slave hinterland_policy_effects true
    	end_if
    	if FactionType goryeo
    		destroy_buildings jin hinterland_policy_effects true
    		destroy_buildings song hinterland_policy_effects true
    		destroy_buildings khitans hinterland_policy_effects true
    		destroy_buildings dali hinterland_policy_effects true
    		destroy_buildings mongols hinterland_policy_effects true
    		destroy_buildings khmer hinterland_policy_effects true
    		destroy_buildings tibet hinterland_policy_effects true
    		destroy_buildings daiviet hinterland_policy_effects true
    		destroy_buildings xixia hinterland_policy_effects true
    		destroy_buildings taira hinterland_policy_effects true
    		destroy_buildings minamoto hinterland_policy_effects true
    		destroy_buildings champa hinterland_policy_effects true
    		destroy_buildings pagan hinterland_policy_effects true
    		destroy_buildings ghurid hinterland_policy_effects true
    		destroy_buildings challenge hinterland_policy_effects true
    		destroy_buildings scripting hinterland_policy_effects true
    		destroy_buildings slave hinterland_policy_effects true
    	end_if
    	if FactionType khitans
    		destroy_buildings jin hinterland_policy_effects true
    		destroy_buildings goryeo hinterland_policy_effects true
    		destroy_buildings song hinterland_policy_effects true
    		destroy_buildings dali hinterland_policy_effects true
    		destroy_buildings mongols hinterland_policy_effects true
    		destroy_buildings khmer hinterland_policy_effects true
    		destroy_buildings tibet hinterland_policy_effects true
    		destroy_buildings daiviet hinterland_policy_effects true
    		destroy_buildings xixia hinterland_policy_effects true
    		destroy_buildings taira hinterland_policy_effects true
    		destroy_buildings minamoto hinterland_policy_effects true
    		destroy_buildings champa hinterland_policy_effects true
    		destroy_buildings pagan hinterland_policy_effects true
    		destroy_buildings ghurid hinterland_policy_effects true
    		destroy_buildings challenge hinterland_policy_effects true
    		destroy_buildings scripting hinterland_policy_effects true
    		destroy_buildings slave hinterland_policy_effects true
    	end_if
    	if FactionType dali
    		destroy_buildings jin hinterland_policy_effects true
    		destroy_buildings goryeo hinterland_policy_effects true
    		destroy_buildings khitans hinterland_policy_effects true
    		destroy_buildings song hinterland_policy_effects true
    		destroy_buildings mongols hinterland_policy_effects true
    		destroy_buildings khmer hinterland_policy_effects true
    		destroy_buildings tibet hinterland_policy_effects true
    		destroy_buildings daiviet hinterland_policy_effects true
    		destroy_buildings xixia hinterland_policy_effects true
    		destroy_buildings taira hinterland_policy_effects true
    		destroy_buildings minamoto hinterland_policy_effects true
    		destroy_buildings champa hinterland_policy_effects true
    		destroy_buildings pagan hinterland_policy_effects true
    		destroy_buildings ghurid hinterland_policy_effects true
    		destroy_buildings challenge hinterland_policy_effects true
    		destroy_buildings scripting hinterland_policy_effects true
    		destroy_buildings slave hinterland_policy_effects true
    	end_if
    	if FactionType mongols
    		destroy_buildings jin hinterland_policy_effects true
    		destroy_buildings goryeo hinterland_policy_effects true
    		destroy_buildings khitans hinterland_policy_effects true
    		destroy_buildings dali hinterland_policy_effects true
    		destroy_buildings song hinterland_policy_effects true
    		destroy_buildings khmer hinterland_policy_effects true
    		destroy_buildings tibet hinterland_policy_effects true
    		destroy_buildings daiviet hinterland_policy_effects true
    		destroy_buildings xixia hinterland_policy_effects true
    		destroy_buildings taira hinterland_policy_effects true
    		destroy_buildings minamoto hinterland_policy_effects true
    		destroy_buildings champa hinterland_policy_effects true
    		destroy_buildings pagan hinterland_policy_effects true
    		destroy_buildings ghurid hinterland_policy_effects true
    		destroy_buildings challenge hinterland_policy_effects true
    		destroy_buildings scripting hinterland_policy_effects true
    		destroy_buildings slave hinterland_policy_effects true
    	end_if
    	if FactionType khmer
    		destroy_buildings jin hinterland_policy_effects true
    		destroy_buildings goryeo hinterland_policy_effects true
    		destroy_buildings khitans hinterland_policy_effects true
    		destroy_buildings dali hinterland_policy_effects true
    		destroy_buildings mongols hinterland_policy_effects true
    		destroy_buildings song hinterland_policy_effects true
    		destroy_buildings tibet hinterland_policy_effects true
    		destroy_buildings daiviet hinterland_policy_effects true
    		destroy_buildings xixia hinterland_policy_effects true
    		destroy_buildings taira hinterland_policy_effects true
    		destroy_buildings minamoto hinterland_policy_effects true
    		destroy_buildings champa hinterland_policy_effects true
    		destroy_buildings pagan hinterland_policy_effects true
    		destroy_buildings ghurid hinterland_policy_effects true
    		destroy_buildings challenge hinterland_policy_effects true
    		destroy_buildings scripting hinterland_policy_effects true
    		destroy_buildings slave hinterland_policy_effects true
    	end_if
    	if FactionType tibet
    		destroy_buildings jin hinterland_policy_effects true
    		destroy_buildings goryeo hinterland_policy_effects true
    		destroy_buildings khitans hinterland_policy_effects true
    		destroy_buildings dali hinterland_policy_effects true
    		destroy_buildings mongols hinterland_policy_effects true
    		destroy_buildings khmer hinterland_policy_effects true
    		destroy_buildings song hinterland_policy_effects true
    		destroy_buildings daiviet hinterland_policy_effects true
    		destroy_buildings xixia hinterland_policy_effects true
    		destroy_buildings taira hinterland_policy_effects true
    		destroy_buildings minamoto hinterland_policy_effects true
    		destroy_buildings champa hinterland_policy_effects true
    		destroy_buildings pagan hinterland_policy_effects true
    		destroy_buildings ghurid hinterland_policy_effects true
    		destroy_buildings challenge hinterland_policy_effects true
    		destroy_buildings scripting hinterland_policy_effects true
    		destroy_buildings slave hinterland_policy_effects true
    	end_if
    	if FactionType daiviet
    		destroy_buildings jin hinterland_policy_effects true
    		destroy_buildings goryeo hinterland_policy_effects true
    		destroy_buildings khitans hinterland_policy_effects true
    		destroy_buildings dali hinterland_policy_effects true
    		destroy_buildings mongols hinterland_policy_effects true
    		destroy_buildings khmer hinterland_policy_effects true
    		destroy_buildings tibet hinterland_policy_effects true
    		destroy_buildings song hinterland_policy_effects true
    		destroy_buildings xixia hinterland_policy_effects true
    		destroy_buildings taira hinterland_policy_effects true
    		destroy_buildings minamoto hinterland_policy_effects true
    		destroy_buildings champa hinterland_policy_effects true
    		destroy_buildings pagan hinterland_policy_effects true
    		destroy_buildings ghurid hinterland_policy_effects true
    		destroy_buildings challenge hinterland_policy_effects true
    		destroy_buildings scripting hinterland_policy_effects true
    		destroy_buildings slave hinterland_policy_effects true
    	end_if
    	if FactionType xixia
    		destroy_buildings jin hinterland_policy_effects true
    		destroy_buildings goryeo hinterland_policy_effects true
    		destroy_buildings khitans hinterland_policy_effects true
    		destroy_buildings dali hinterland_policy_effects true
    		destroy_buildings mongols hinterland_policy_effects true
    		destroy_buildings khmer hinterland_policy_effects true
    		destroy_buildings tibet hinterland_policy_effects true
    		destroy_buildings daiviet hinterland_policy_effects true
    		destroy_buildings song hinterland_policy_effects true
    		destroy_buildings taira hinterland_policy_effects true
    		destroy_buildings minamoto hinterland_policy_effects true
    		destroy_buildings champa hinterland_policy_effects true
    		destroy_buildings pagan hinterland_policy_effects true
    		destroy_buildings ghurid hinterland_policy_effects true
    		destroy_buildings challenge hinterland_policy_effects true
    		destroy_buildings scripting hinterland_policy_effects true
    		destroy_buildings slave hinterland_policy_effects true
    	end_if
    	if FactionType taira
    		destroy_buildings jin hinterland_policy_effects true
    		destroy_buildings goryeo hinterland_policy_effects true
    		destroy_buildings khitans hinterland_policy_effects true
    		destroy_buildings dali hinterland_policy_effects true
    		destroy_buildings mongols hinterland_policy_effects true
    		destroy_buildings khmer hinterland_policy_effects true
    		destroy_buildings tibet hinterland_policy_effects true
    		destroy_buildings daiviet hinterland_policy_effects true
    		destroy_buildings xixia hinterland_policy_effects true
    		destroy_buildings song hinterland_policy_effects true
    		destroy_buildings minamoto hinterland_policy_effects true
    		destroy_buildings champa hinterland_policy_effects true
    		destroy_buildings pagan hinterland_policy_effects true
    		destroy_buildings ghurid hinterland_policy_effects true
    		destroy_buildings challenge hinterland_policy_effects true
    		destroy_buildings scripting hinterland_policy_effects true
    		destroy_buildings slave hinterland_policy_effects true
    	end_if
    	if FactionType minamoto
    		destroy_buildings jin hinterland_policy_effects true
    		destroy_buildings goryeo hinterland_policy_effects true
    		destroy_buildings khitans hinterland_policy_effects true
    		destroy_buildings dali hinterland_policy_effects true
    		destroy_buildings mongols hinterland_policy_effects true
    		destroy_buildings khmer hinterland_policy_effects true
    		destroy_buildings tibet hinterland_policy_effects true
    		destroy_buildings daiviet hinterland_policy_effects true
    		destroy_buildings xixia hinterland_policy_effects true
    		destroy_buildings taira hinterland_policy_effects true
    		destroy_buildings song hinterland_policy_effects true
    		destroy_buildings champa hinterland_policy_effects true
    		destroy_buildings pagan hinterland_policy_effects true
    		destroy_buildings ghurid hinterland_policy_effects true
    		destroy_buildings challenge hinterland_policy_effects true
    		destroy_buildings scripting hinterland_policy_effects true
    		destroy_buildings slave hinterland_policy_effects true
    	end_if
    	if FactionType champa
    		destroy_buildings jin hinterland_policy_effects true
    		destroy_buildings goryeo hinterland_policy_effects true
    		destroy_buildings khitans hinterland_policy_effects true
    		destroy_buildings dali hinterland_policy_effects true
    		destroy_buildings mongols hinterland_policy_effects true
    		destroy_buildings khmer hinterland_policy_effects true
    		destroy_buildings tibet hinterland_policy_effects true
    		destroy_buildings daiviet hinterland_policy_effects true
    		destroy_buildings xixia hinterland_policy_effects true
    		destroy_buildings taira hinterland_policy_effects true
    		destroy_buildings minamoto hinterland_policy_effects true
    		destroy_buildings song hinterland_policy_effects true
    		destroy_buildings pagan hinterland_policy_effects true
    		destroy_buildings ghurid hinterland_policy_effects true
    		destroy_buildings challenge hinterland_policy_effects true
    		destroy_buildings scripting hinterland_policy_effects true
    		destroy_buildings slave hinterland_policy_effects true
    	end_if
    	if FactionType pagan
    		destroy_buildings jin hinterland_policy_effects true
    		destroy_buildings goryeo hinterland_policy_effects true
    		destroy_buildings khitans hinterland_policy_effects true
    		destroy_buildings dali hinterland_policy_effects true
    		destroy_buildings mongols hinterland_policy_effects true
    		destroy_buildings khmer hinterland_policy_effects true
    		destroy_buildings tibet hinterland_policy_effects true
    		destroy_buildings daiviet hinterland_policy_effects true
    		destroy_buildings xixia hinterland_policy_effects true
    		destroy_buildings taira hinterland_policy_effects true
    		destroy_buildings minamoto hinterland_policy_effects true
    		destroy_buildings champa hinterland_policy_effects true
    		destroy_buildings song hinterland_policy_effects true
    		destroy_buildings ghurid hinterland_policy_effects true
    		destroy_buildings challenge hinterland_policy_effects true
    		destroy_buildings scripting hinterland_policy_effects true
    		destroy_buildings slave hinterland_policy_effects true
    	end_if
    	if FactionType ghurid
    		destroy_buildings jin hinterland_policy_effects true
    		destroy_buildings goryeo hinterland_policy_effects true
    		destroy_buildings khitans hinterland_policy_effects true
    		destroy_buildings dali hinterland_policy_effects true
    		destroy_buildings mongols hinterland_policy_effects true
    		destroy_buildings khmer hinterland_policy_effects true
    		destroy_buildings tibet hinterland_policy_effects true
    		destroy_buildings daiviet hinterland_policy_effects true
    		destroy_buildings xixia hinterland_policy_effects true
    		destroy_buildings taira hinterland_policy_effects true
    		destroy_buildings minamoto hinterland_policy_effects true
    		destroy_buildings champa hinterland_policy_effects true
    		destroy_buildings pagan hinterland_policy_effects true
    		destroy_buildings song hinterland_policy_effects true
    		destroy_buildings challenge hinterland_policy_effects true
    		destroy_buildings scripting hinterland_policy_effects true
    		destroy_buildings slave hinterland_policy_effects true
    	end_if
    	
    end_monitor
    
    ;Wipe all buildings for policy effects after new policy is decided upon
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0
    	
    	if FactionType song
    		destroy_buildings song hinterland_policy_effects false
    	end_if
    	if FactionType jin
    		destroy_buildings jin hinterland_policy_effects false
    	end_if
    	if FactionType goryeo
    		destroy_buildings goryeo hinterland_policy_effects false
    	end_if
    	if FactionType khitans
    		destroy_buildings khitans hinterland_policy_effects false
    	end_if
    	if FactionType dali
    		destroy_buildings dali hinterland_policy_effects false
    	end_if
    	if FactionType mongols
    		destroy_buildings mongols hinterland_policy_effects false
    	end_if
    	if FactionType khmer
    		destroy_buildings khmer hinterland_policy_effects false
    	end_if
    	if FactionType tibet
    		destroy_buildings tibet hinterland_policy_effects false
    	end_if
    	if FactionType daiviet
    		destroy_buildings daiviet hinterland_policy_effects false
    	end_if
    	if FactionType xixia
    		destroy_buildings xixia hinterland_policy_effects false
    	end_if
    	if FactionType taira
    		destroy_buildings taira hinterland_policy_effects false
    	end_if
    	if FactionType minamoto
    		destroy_buildings minamoto hinterland_policy_effects false
    	end_if
    	if FactionType champa
    		destroy_buildings champa hinterland_policy_effects false
    	end_if
    	if FactionType pagan
    		destroy_buildings pagan hinterland_policy_effects false
    	end_if
    	if FactionType ghurid
    		destroy_buildings ghurid hinterland_policy_effects false
    	end_if
    	set_counter policy_buildings_reset 1
    end_monitor
    
    ;Create Buildings based on settlement and policy, processed at turn end
    monitor_event SettlementTurnEnd SettlementIsLocal
    		and I_CompareCounter policy_buildings_reset == 1
    		and not SettlementBuildingExists == military_policy
    		and not SettlementBuildingExists == economic_policy
    		and not SettlementBuildingExists == cultural_policy
    		and not SettlementBuildingExists == recovery_policy
    		
    	if SettlementName Pingjiang
    		if I_CompareCounter military_policy == 1
    			console_command create_building Pingjiang military_policy
    		end_if
    		if I_CompareCounter economic_policy == 1
    			console_command create_building Pingjiang economic_policy
    		end_if
    		if I_CompareCounter cultural_policy == 1
    			console_command create_building Pingjiang cultural_policy
    		end_if
    		if I_CompareCounter recovery_policy == 1
    			console_command create_building Pingjiang recovery_policy
    		end_if
    	end_if
    
    end_monitor
    Error Log
    Code:
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 437 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 437, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 456 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 456, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 475 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 475, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 494 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 494, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 513 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 513, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 532 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 532, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 551 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 551, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 570 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 570, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 589 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 589, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 608 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 608, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 627 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 627, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 646 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 646, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 665 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 665, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 684 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 684, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 703 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 703, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 729 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 729, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 732 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 732, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 735 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 735, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 738 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 738, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 741 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 741, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 744 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 744, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 747 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 747, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 750 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 750, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 753 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 753, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 756 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 756, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 759 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 759, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 762 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 762, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 765 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 765, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 768 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 768, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:01:48.296 [game.script.exec] [trace] exec <if> at line 771 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:01:48.296 [game.script] [error] Script execution error for <if>, at line 771, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <faction> is unavailable from event <>
    when testing <FactionType> condition
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script] [error] Script execution error for <if>, at line 785, in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt: 
    <settlement> is unavailable from event <>
    when testing <SettlementName> condition
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:07.984 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:08.000 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:08.000 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:08.000 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:08.000 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:08.000 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:08.000 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:08.000 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:08.000 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    16:02:08.000 [game.script.exec] [trace] exec <if> at line 785 in auh/data/world/maps/campaign/imperial_campaign/campaign_script.txt
    If it isn't obvious, the errors correspond to all the if statements that ask for FactionType, and the if statements that ask for SettlementName. These conditions should be exported from the event used in the monitor, but for whatever reason they aren't carrying over to if statements. Maybe this is just a fundamental misunderstanding of how CA has the if statements set up on my part, and they are in fact, like everything else, severely limited.

  9. #9
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Administrative Policy Script

    Problem solved, as I expected you can't use conditions that require a trigger export in 'if' statements. Converted them all to monitors and it works swimmingly now. Obviously getting errors with the destroy_buildings command when applied to challenge and ghurid since they don't own cities, but it isn't a script-ending error so I'm inclined to let it be, should resolve itself later when they are added or just stay dormant until they emerge.

    Currently there's a 2-turn delay between policy set and buildings appearing, 1-turn delay before buildings are destroyed. Even if I wanted to make the destroying buildings instantaneous I don't see any real point, though I might do so later with a command to check which faction is local at the start and base it within the policy sets on counters. The second turn delay is because both use End, switching the settlement monitor to SettlementTurnStart will most probably lessen that delay to just the 1 turn. I have no desire to replicate the commands for CapturesSettlement commands, the small time differential isn't worth the extra code, it can just be noted in the manual.

    The new working script for buildings:
    Code:
    ;**********Script 1B-2 - Policy Buildings**********
    ;|Author| Augustus Lucifer
    ;|Purpose| Policy Buildings built to simulate related effects.
    ;|Changelog|
    ; o Script Created 3-14-09
    ; o 3-15-09
    ;		Switched from if statements to monitors since trigger was not being read
    
    ;Remove policy effect buildings for AI faction
    monitor_event FactionTurnEnd FactionIsLocal
    		and FactionType song
    	destroy_buildings jin hinterland_policy_effects true
    	destroy_buildings goryeo hinterland_policy_effects true
    	destroy_buildings khitans hinterland_policy_effects true
    	destroy_buildings dali hinterland_policy_effects true
    	destroy_buildings mongols hinterland_policy_effects true
    	destroy_buildings khmer hinterland_policy_effects true
    	destroy_buildings tibet hinterland_policy_effects true
    	destroy_buildings daiviet hinterland_policy_effects true
    	destroy_buildings xixia hinterland_policy_effects true
    	destroy_buildings taira hinterland_policy_effects true
    	destroy_buildings minamoto hinterland_policy_effects true
    	destroy_buildings champa hinterland_policy_effects true
    	destroy_buildings pagan hinterland_policy_effects true
    	destroy_buildings ghurid hinterland_policy_effects true
    	destroy_buildings challenge hinterland_policy_effects true
    	destroy_buildings scripting hinterland_policy_effects true
    	destroy_buildings slave hinterland_policy_effects true
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and FactionType jin
    	destroy_buildings song hinterland_policy_effects true
    	destroy_buildings goryeo hinterland_policy_effects true
    	destroy_buildings khitans hinterland_policy_effects true
    	destroy_buildings dali hinterland_policy_effects true
    	destroy_buildings mongols hinterland_policy_effects true
    	destroy_buildings khmer hinterland_policy_effects true
    	destroy_buildings tibet hinterland_policy_effects true
    	destroy_buildings daiviet hinterland_policy_effects true
    	destroy_buildings xixia hinterland_policy_effects true
    	destroy_buildings taira hinterland_policy_effects true
    	destroy_buildings minamoto hinterland_policy_effects true
    	destroy_buildings champa hinterland_policy_effects true
    	destroy_buildings pagan hinterland_policy_effects true
    	destroy_buildings ghurid hinterland_policy_effects true
    	destroy_buildings challenge hinterland_policy_effects true
    	destroy_buildings scripting hinterland_policy_effects true
    	destroy_buildings slave hinterland_policy_effects true
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and FactionType goryeo
    	destroy_buildings jin hinterland_policy_effects true
    	destroy_buildings song hinterland_policy_effects true
    	destroy_buildings khitans hinterland_policy_effects true
    	destroy_buildings dali hinterland_policy_effects true
    	destroy_buildings mongols hinterland_policy_effects true
    	destroy_buildings khmer hinterland_policy_effects true
    	destroy_buildings tibet hinterland_policy_effects true
    	destroy_buildings daiviet hinterland_policy_effects true
    	destroy_buildings xixia hinterland_policy_effects true
    	destroy_buildings taira hinterland_policy_effects true
    	destroy_buildings minamoto hinterland_policy_effects true
    	destroy_buildings champa hinterland_policy_effects true
    	destroy_buildings pagan hinterland_policy_effects true
    	destroy_buildings ghurid hinterland_policy_effects true
    	destroy_buildings challenge hinterland_policy_effects true
    	destroy_buildings scripting hinterland_policy_effects true
    	destroy_buildings slave hinterland_policy_effects true
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and FactionType khitans
    	destroy_buildings jin hinterland_policy_effects true
    	destroy_buildings goryeo hinterland_policy_effects true
    	destroy_buildings song hinterland_policy_effects true
    	destroy_buildings dali hinterland_policy_effects true
    	destroy_buildings mongols hinterland_policy_effects true
    	destroy_buildings khmer hinterland_policy_effects true
    	destroy_buildings tibet hinterland_policy_effects true
    	destroy_buildings daiviet hinterland_policy_effects true
    	destroy_buildings xixia hinterland_policy_effects true
    	destroy_buildings taira hinterland_policy_effects true
    	destroy_buildings minamoto hinterland_policy_effects true
    	destroy_buildings champa hinterland_policy_effects true
    	destroy_buildings pagan hinterland_policy_effects true
    	destroy_buildings ghurid hinterland_policy_effects true
    	destroy_buildings challenge hinterland_policy_effects true
    	destroy_buildings scripting hinterland_policy_effects true
    	destroy_buildings slave hinterland_policy_effects true
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and FactionType dali
    	destroy_buildings jin hinterland_policy_effects true
    	destroy_buildings goryeo hinterland_policy_effects true
    	destroy_buildings khitans hinterland_policy_effects true
    	destroy_buildings song hinterland_policy_effects true
    	destroy_buildings mongols hinterland_policy_effects true
    	destroy_buildings khmer hinterland_policy_effects true
    	destroy_buildings tibet hinterland_policy_effects true
    	destroy_buildings daiviet hinterland_policy_effects true
    	destroy_buildings xixia hinterland_policy_effects true
    	destroy_buildings taira hinterland_policy_effects true
    	destroy_buildings minamoto hinterland_policy_effects true
    	destroy_buildings champa hinterland_policy_effects true
    	destroy_buildings pagan hinterland_policy_effects true
    	destroy_buildings ghurid hinterland_policy_effects true
    	destroy_buildings challenge hinterland_policy_effects true
    	destroy_buildings scripting hinterland_policy_effects true
    	destroy_buildings slave hinterland_policy_effects true
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and FactionType mongols
    	destroy_buildings jin hinterland_policy_effects true
    	destroy_buildings goryeo hinterland_policy_effects true
    	destroy_buildings khitans hinterland_policy_effects true
    	destroy_buildings dali hinterland_policy_effects true
    	destroy_buildings song hinterland_policy_effects true
    	destroy_buildings khmer hinterland_policy_effects true
    	destroy_buildings tibet hinterland_policy_effects true
    	destroy_buildings daiviet hinterland_policy_effects true
    	destroy_buildings xixia hinterland_policy_effects true
    	destroy_buildings taira hinterland_policy_effects true
    	destroy_buildings minamoto hinterland_policy_effects true
    	destroy_buildings champa hinterland_policy_effects true
    	destroy_buildings pagan hinterland_policy_effects true
    	destroy_buildings ghurid hinterland_policy_effects true
    	destroy_buildings challenge hinterland_policy_effects true
    	destroy_buildings scripting hinterland_policy_effects true
    	destroy_buildings slave hinterland_policy_effects true
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and FactionType khmer
    	destroy_buildings jin hinterland_policy_effects true
    	destroy_buildings goryeo hinterland_policy_effects true
    	destroy_buildings khitans hinterland_policy_effects true
    	destroy_buildings dali hinterland_policy_effects true
    	destroy_buildings mongols hinterland_policy_effects true
    	destroy_buildings song hinterland_policy_effects true
    	destroy_buildings tibet hinterland_policy_effects true
    	destroy_buildings daiviet hinterland_policy_effects true
    	destroy_buildings xixia hinterland_policy_effects true
    	destroy_buildings taira hinterland_policy_effects true
    	destroy_buildings minamoto hinterland_policy_effects true
    	destroy_buildings champa hinterland_policy_effects true
    	destroy_buildings pagan hinterland_policy_effects true
    	destroy_buildings ghurid hinterland_policy_effects true
    	destroy_buildings challenge hinterland_policy_effects true
    	destroy_buildings scripting hinterland_policy_effects true
    	destroy_buildings slave hinterland_policy_effects true
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and FactionType tibet
    	destroy_buildings jin hinterland_policy_effects true
    	destroy_buildings goryeo hinterland_policy_effects true
    	destroy_buildings khitans hinterland_policy_effects true
    	destroy_buildings dali hinterland_policy_effects true
    	destroy_buildings mongols hinterland_policy_effects true
    	destroy_buildings khmer hinterland_policy_effects true
    	destroy_buildings song hinterland_policy_effects true
    	destroy_buildings daiviet hinterland_policy_effects true
    	destroy_buildings xixia hinterland_policy_effects true
    	destroy_buildings taira hinterland_policy_effects true
    	destroy_buildings minamoto hinterland_policy_effects true
    	destroy_buildings champa hinterland_policy_effects true
    	destroy_buildings pagan hinterland_policy_effects true
    	destroy_buildings ghurid hinterland_policy_effects true
    	destroy_buildings challenge hinterland_policy_effects true
    	destroy_buildings scripting hinterland_policy_effects true
    	destroy_buildings slave hinterland_policy_effects true
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and FactionType daiviet
    	destroy_buildings jin hinterland_policy_effects true
    	destroy_buildings goryeo hinterland_policy_effects true
    	destroy_buildings khitans hinterland_policy_effects true
    	destroy_buildings dali hinterland_policy_effects true
    	destroy_buildings mongols hinterland_policy_effects true
    	destroy_buildings khmer hinterland_policy_effects true
    	destroy_buildings tibet hinterland_policy_effects true
    	destroy_buildings song hinterland_policy_effects true
    	destroy_buildings xixia hinterland_policy_effects true
    	destroy_buildings taira hinterland_policy_effects true
    	destroy_buildings minamoto hinterland_policy_effects true
    	destroy_buildings champa hinterland_policy_effects true
    	destroy_buildings pagan hinterland_policy_effects true
    	destroy_buildings ghurid hinterland_policy_effects true
    	destroy_buildings challenge hinterland_policy_effects true
    	destroy_buildings scripting hinterland_policy_effects true
    	destroy_buildings slave hinterland_policy_effects true
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and FactionType xixia
    	destroy_buildings jin hinterland_policy_effects true
    	destroy_buildings goryeo hinterland_policy_effects true
    	destroy_buildings khitans hinterland_policy_effects true
    	destroy_buildings dali hinterland_policy_effects true
    	destroy_buildings mongols hinterland_policy_effects true
    	destroy_buildings khmer hinterland_policy_effects true
    	destroy_buildings tibet hinterland_policy_effects true
    	destroy_buildings daiviet hinterland_policy_effects true
    	destroy_buildings song hinterland_policy_effects true
    	destroy_buildings taira hinterland_policy_effects true
    	destroy_buildings minamoto hinterland_policy_effects true
    	destroy_buildings champa hinterland_policy_effects true
    	destroy_buildings pagan hinterland_policy_effects true
    	destroy_buildings ghurid hinterland_policy_effects true
    	destroy_buildings challenge hinterland_policy_effects true
    	destroy_buildings scripting hinterland_policy_effects true
    	destroy_buildings slave hinterland_policy_effects true
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and FactionType taira
    	destroy_buildings jin hinterland_policy_effects true
    	destroy_buildings goryeo hinterland_policy_effects true
    	destroy_buildings khitans hinterland_policy_effects true
    	destroy_buildings dali hinterland_policy_effects true
    	destroy_buildings mongols hinterland_policy_effects true
    	destroy_buildings khmer hinterland_policy_effects true
    	destroy_buildings tibet hinterland_policy_effects true
    	destroy_buildings daiviet hinterland_policy_effects true
    	destroy_buildings xixia hinterland_policy_effects true
    	destroy_buildings song hinterland_policy_effects true
    	destroy_buildings minamoto hinterland_policy_effects true
    	destroy_buildings champa hinterland_policy_effects true
    	destroy_buildings pagan hinterland_policy_effects true
    	destroy_buildings ghurid hinterland_policy_effects true
    	destroy_buildings challenge hinterland_policy_effects true
    	destroy_buildings scripting hinterland_policy_effects true
    	destroy_buildings slave hinterland_policy_effects true
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and FactionType minamoto
    	destroy_buildings jin hinterland_policy_effects true
    	destroy_buildings goryeo hinterland_policy_effects true
    	destroy_buildings khitans hinterland_policy_effects true
    	destroy_buildings dali hinterland_policy_effects true
    	destroy_buildings mongols hinterland_policy_effects true
    	destroy_buildings khmer hinterland_policy_effects true
    	destroy_buildings tibet hinterland_policy_effects true
    	destroy_buildings daiviet hinterland_policy_effects true
    	destroy_buildings xixia hinterland_policy_effects true
    	destroy_buildings taira hinterland_policy_effects true
    	destroy_buildings song hinterland_policy_effects true
    	destroy_buildings champa hinterland_policy_effects true
    	destroy_buildings pagan hinterland_policy_effects true
    	destroy_buildings ghurid hinterland_policy_effects true
    	destroy_buildings challenge hinterland_policy_effects true
    	destroy_buildings scripting hinterland_policy_effects true
    	destroy_buildings slave hinterland_policy_effects true
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and FactionType champa
    	destroy_buildings jin hinterland_policy_effects true
    	destroy_buildings goryeo hinterland_policy_effects true
    	destroy_buildings khitans hinterland_policy_effects true
    	destroy_buildings dali hinterland_policy_effects true
    	destroy_buildings mongols hinterland_policy_effects true
    	destroy_buildings khmer hinterland_policy_effects true
    	destroy_buildings tibet hinterland_policy_effects true
    	destroy_buildings daiviet hinterland_policy_effects true
    	destroy_buildings xixia hinterland_policy_effects true
    	destroy_buildings taira hinterland_policy_effects true
    	destroy_buildings minamoto hinterland_policy_effects true
    	destroy_buildings song hinterland_policy_effects true
    	destroy_buildings pagan hinterland_policy_effects true
    	destroy_buildings ghurid hinterland_policy_effects true
    	destroy_buildings challenge hinterland_policy_effects true
    	destroy_buildings scripting hinterland_policy_effects true
    	destroy_buildings slave hinterland_policy_effects true
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and FactionType pagan
    	destroy_buildings jin hinterland_policy_effects true
    	destroy_buildings goryeo hinterland_policy_effects true
    	destroy_buildings khitans hinterland_policy_effects true
    	destroy_buildings dali hinterland_policy_effects true
    	destroy_buildings mongols hinterland_policy_effects true
    	destroy_buildings khmer hinterland_policy_effects true
    	destroy_buildings tibet hinterland_policy_effects true
    	destroy_buildings daiviet hinterland_policy_effects true
    	destroy_buildings xixia hinterland_policy_effects true
    	destroy_buildings taira hinterland_policy_effects true
    	destroy_buildings minamoto hinterland_policy_effects true
    	destroy_buildings champa hinterland_policy_effects true
    	destroy_buildings song hinterland_policy_effects true
    	destroy_buildings ghurid hinterland_policy_effects true
    	destroy_buildings challenge hinterland_policy_effects true
    	destroy_buildings scripting hinterland_policy_effects true
    	destroy_buildings slave hinterland_policy_effects true
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and FactionType ghurid
    	destroy_buildings jin hinterland_policy_effects true
    	destroy_buildings goryeo hinterland_policy_effects true
    	destroy_buildings khitans hinterland_policy_effects true
    	destroy_buildings dali hinterland_policy_effects true
    	destroy_buildings mongols hinterland_policy_effects true
    	destroy_buildings khmer hinterland_policy_effects true
    	destroy_buildings tibet hinterland_policy_effects true
    	destroy_buildings daiviet hinterland_policy_effects true
    	destroy_buildings xixia hinterland_policy_effects true
    	destroy_buildings taira hinterland_policy_effects true
    	destroy_buildings minamoto hinterland_policy_effects true
    	destroy_buildings champa hinterland_policy_effects true
    	destroy_buildings pagan hinterland_policy_effects true
    	destroy_buildings song hinterland_policy_effects true
    	destroy_buildings challenge hinterland_policy_effects true
    	destroy_buildings scripting hinterland_policy_effects true
    	destroy_buildings slave hinterland_policy_effects true
    end_monitor
    
    ;Wipe all buildings for policy effects after new policy is decided upon
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0	
    		and FactionType song
    	destroy_buildings song hinterland_policy_effects false
    	set_counter policy_buildings_reset 1
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0
    		and FactionType jin
    	destroy_buildings jin hinterland_policy_effects false
    	set_counter policy_buildings_reset 1
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0
    		and FactionType goryeo
    	destroy_buildings goryeo hinterland_policy_effects false
    	set_counter policy_buildings_reset 1
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0
    		and FactionType khitans
    	destroy_buildings khitans hinterland_policy_effects false
    	set_counter policy_buildings_reset 1
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0
    		and FactionType dali
    	destroy_buildings dali hinterland_policy_effects false
    	set_counter policy_buildings_reset 1
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0
    		and FactionType mongols
    	destroy_buildings mongols hinterland_policy_effects false
    	set_counter policy_buildings_reset 1
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0
    		and FactionType khmer
    	destroy_buildings khmer hinterland_policy_effects false
    	set_counter policy_buildings_reset 1
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0
    		and FactionType tibet
    	destroy_buildings tibet hinterland_policy_effects false
    	set_counter policy_buildings_reset 1
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0
    		and FactionType daiviet
    	destroy_buildings daiviet hinterland_policy_effects false
    	set_counter policy_buildings_reset 1
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0
    		and FactionType xixia
    	destroy_buildings xixia hinterland_policy_effects false
    	set_counter policy_buildings_reset 1
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0
    		and FactionType taira
    	destroy_buildings taira hinterland_policy_effects false
    	set_counter policy_buildings_reset 1
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0
    		and FactionType minamoto
    	destroy_buildings minamoto hinterland_policy_effects false
    	set_counter policy_buildings_reset 1
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0
    		and FactionType champa
    	destroy_buildings champa hinterland_policy_effects false
    	set_counter policy_buildings_reset 1
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0
    		and FactionType pagan
    	destroy_buildings pagan hinterland_policy_effects false
    	set_counter policy_buildings_reset 1
    end_monitor
    monitor_event FactionTurnEnd FactionIsLocal
    		and I_CompareCounter policy_buildings_reset == 0
    		and FactionType ghurid
    	destroy_buildings ghurid hinterland_policy_effects false
    	set_counter policy_buildings_reset 1
    end_monitor
    
    ;Create Buildings based on settlement and policy, processed at turn end
    monitor_event SettlementTurnEnd SettlementIsLocal
    		and I_CompareCounter policy_buildings_reset == 1
    		and SettlementName Pingjiang
    		and not SettlementBuildingExists == military_policy
    		and not SettlementBuildingExists == economic_policy
    		and not SettlementBuildingExists == cultural_policy
    		and not SettlementBuildingExists == recovery_policy
    		
    	if I_CompareCounter military_policy == 1
    		console_command create_building Pingjiang military_policy
    	end_if
    	if I_CompareCounter economic_policy == 1
    		console_command create_building Pingjiang economic_policy
    	end_if
    	if I_CompareCounter cultural_policy == 1
    		console_command create_building Pingjiang cultural_policy
    	end_if
    	if I_CompareCounter recovery_policy == 1
    		console_command create_building Pingjiang recovery_policy
    	end_if
    end_monitor
    I'll replicate it for all the other settlements later today, and see if the End-Start fix works, otherwise will experiment with the counters method to get it down to a 1-turn delay. Will also get to work on the other building scripts (roving for humanitarian/corruption; random for garrison-population ratio) and a stipend script.

    If anyone has any ideas about how the stipend should be calculated, like if it should just be a fixed amount, based on cities owned, based on economic building levels, etc. and the amounts, feel free to input since I'm making this up as I go. Same goes for any other scripted effects that you think could be applied to one of the policies to make them even more impacting.

  10. #10
    Wundai's Avatar Artifex
    Join Date
    Mar 2006
    Location
    Eindhoven
    Posts
    5,332

    Default Re: Administrative Policy Script

    Augustus, you don't want anyone to help you with this stuff?
    You could send out a recruitment call for a coder perhaps?

  11. #11
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Administrative Policy Script

    Quote Originally Posted by Wundai View Post
    Augustus, you don't want anyone to help you with this stuff?
    You could send out a recruitment call for a coder perhaps?
    Not really in need of a coder at this point, like it states in the recruitment topic, if someone who I can talk to like GED wants to sign on so we can bounce back and forth things, I'd welcome them. Being spurred on by an impatient coder or having to babysit a new coder would just hinder development though. What I need for my end is the research, as the less making it up as I go that I need to do for any given system or building or unit or w/e, the more just the pure code can be input. Right now for example, we don't have any real song-specific things, I have a list of about 10 things I want to do for the preview, some of them may work some may not, some may be way off base others closer to the truth, but my only real option at this point is to go through with them from my standpoint since the systems aren't being devised and presented from a research standpoint.

    If we have someone with the abilities to edit the battle_models.modeldb file on the team, that would be helpful, don't want to grab someone just for that, but I am having a bunch of trouble with things that should be working in that file, and so having to bypass it in my setup.

    Nearer to release than conception I will send out a call for a balancer(since I'm terrible at balancing, units especially) and see if xeryx has the time to help fine tune whatever AI I am able to build off XAI.

  12. #12
    Augustus Lucifer's Avatar Life = Like a beanstalk
    Patrician Citizen

    Join Date
    Aug 2006
    Location
    Mote of Dust
    Posts
    10,725

    Default Re: Administrative Policy Script

    The settlement portion of the building creation has been duplicated for all settlements, and works as advertised. Also, I've set up monitors to detect the local faction of the player and set a counter, which is used inside the policy decision monitors so that the previous buildings can be destroyed before the turn end. This has cut the delay down to one turn as expected.

Posting Permissions

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