Results 1 to 3 of 3

Thread: Unique Victory Conditions 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 Unique Victory Conditions Script

    This thread is for the development of the Unique Victory Conditions Script.

    The current script:

    Code:
    declare_counter unique_victory_conditions
    declare_counter can_win
    declare_counter victory_countdown
    declare_counter victory_points_1
    declare_counter victory_points_2
    declare_counter victory_points_3
    declare_counter victory_points_risk
    
    set_counter unique_victory_conditions 1 ;initialize unique victory conditions
    
    ;------------------------------------------------
    ;-- Sub-Section 1D - Unique Victory Conditions --
    ;------------------------------------------------
    
    ;**********Script 1D-1 - Victory Conditions Setup**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;Sets faction-based counter for usage in other commands
    monitor_event FactionTurnStart FactionIsLocal
    	and I_CompareCounter unique_victory_conditions == 1
    	and FactionType song
    	
    	set_event_counter unique_vc_song 1
    
    ;	if FactionType song
    ;		set_event_counter unique_vc_song 1
    ;	end_if
    ;	if FactionType jin
    ;		set_event_counter unique_vc_jin 1
    ;	end_if
    ;	if FactionType goryeo
    ;		set_event_counter unique_vc_goryeo 1
    ;	end_if
    ;	if FactionType dali
    ;		set_event_counter unique_vc_dali 1
    ;	end_if
    ;	if FactionType xixia
    ;		set_event_counter unique_vc_xixia 1
    ;	end_if
    ;	if FactionType tibet
    ;		set_event_counter unique_vc_tibet 1
    ;	end_if
    ;	if FactionType khitans
    ;		set_event_counter unique_vc_khitans 1
    ;	end_if
    ;	if FactionType mongols
    ;		set_event_counter unique_vc_mongols 1
    ;	end_if
    ;	if FactionType pagan
    ;		set_event_counter unique_vc_pagan 1
    ;	end_if
    ;	if FactionType khmer
    ;		set_event_counter unique_vc_khmer 1
    ;	end_if
    ;	if FactionType minamoto
    ;		set_event_counter unique_vc_minamoto 1
    ;	end_if
    ;	if FactionType taira
    ;		set_event_counter unique_vc_taira 1
    ;	end_if
    ;	if FactionType daiviet
    ;		set_event_counter unique_vc_daiviet 1
    ;	end_if
    ;	if FactionType champa
    ;		set_event_counter unique_vc_champa 1
    ;	end_if
    ;	if FactionType ghurid
    ;		set_event_counter unique_vc_ghurid 1
    ;	end_if
    
    	inc_counter unique_victory_conditions 1
    end_monitor
    
    ;Shows user ways to win with their faction
    monitor_event FactionTurnStart FactionIsLocal
    	and I_CompareCounter unique_victory_conditions == 2
    
    	if I_EventCounter unique_vc_song == 1
      		historic_event unique_vc_song_prompt
    		inc_event_counter unique_vc_song 1
    	end_if
    	if I_EventCounter unique_vc_jin == 1
      		historic_event unique_vc_jin_prompt
    		inc_event_counter unique_vc_jin 1
    	end_if
    	if I_EventCounter unique_vc_goryeo == 1
      		historic_event unique_vc_goryeo_prompt
    		inc_event_counter unique_vc_goryeo 1
    	end_if
    	if I_EventCounter unique_vc_dali == 1
      		historic_event unique_vc_dali_prompt
    		inc_event_counter unique_vc_dali 1
    	end_if
    	if I_EventCounter unique_vc_xixia == 1
      		historic_event unique_vc_xixia_prompt
    		inc_event_counter unique_vc_xixia 1
    	end_if
    	if I_EventCounter unique_vc_tibet == 1
      		historic_event unique_vc_tibet_prompt
    		inc_event_counter unique_vc_tibet 1
    	end_if
    	if I_EventCounter unique_vc_khitans == 1
      		historic_event unique_vc_khitans_prompt
    		inc_event_counter unique_vc_khitans 1
    	end_if
    	if I_EventCounter unique_vc_mongols == 1
      		historic_event unique_vc_mongols_prompt
    		inc_event_counter unique_vc_mongols 1
    	end_if
    	if I_EventCounter unique_vc_pagan == 1
      		historic_event unique_vc_pagan_prompt
    		inc_event_counter unique_vc_pagan 1
    	end_if
    	if I_EventCounter unique_vc_khmer == 1
      		historic_event unique_vc_khmer_prompt
    		inc_event_counter unique_vc_khmer 1
    	end_if
    	if I_EventCounter unique_vc_minamoto == 1
      		historic_event unique_vc_minamoto_prompt
    		inc_event_counter unique_vc_minamoto 1
    	end_if
    	if I_EventCounter unique_vc_taira == 1
      		historic_event unique_vc_taira_prompt
    		inc_event_counter unique_vc_taira 1
    	end_if
    	if I_EventCounter unique_vc_daiviet == 1
      		historic_event unique_vc_daiviet_prompt
    		inc_event_counter unique_vc_daiviet 1
    	end_if
    	if I_EventCounter unique_vc_champa == 1
      		historic_event unique_vc_champa_prompt
    		inc_event_counter unique_vc_champa 1
    	end_if
    	if I_EventCounter unique_vc_ghurid == 1
      		historic_event unique_vc_ghurid_prompt
    		inc_event_counter unique_vc_ghurid 1
    	end_if
    	
    	inc_counter unique_victory_conditions 1
    end_monitor
    
    ;**********Script 1D-2 - Song Dynasty VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Defines ways for Song Dynasty player to win.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;Set Victory Point Counters
    monitor_event FactionTurnEnd FactionIsLocal
    	and FactionType song
    	and I_CompareCounter unique_victory_conditions == 3
    	and I_CompareCounter can_win == 0
    	and I_EventCounter unique_vc_song == 2
    
    	set_counter can_win 1
    	set_counter victory_points_1 0
    	set_counter victory_points_2 0
    	set_counter victory_points_3 0
    	set_counter victory_points_risk 0
    end_monitor
    
    ;Decrease timer until victory
    monitor_event FactionTurnEnd FactionIsLocal
    	and I_CompareCounter victory_countdown > 0
    		inc_counter victory_countdown -1
    end_monitor
    
    ;Prompt Player about achieving victory for Victory Type 1
    monitor_event FactionTurnStart FactionIsLocal
    	and FactionType song
    	and I_CompareCounter can_win == 1
    	and I_CompareCounter victory_points_1 > 100
    	and I_CompareCounter victory_countdown == 0
    
    	  	add_events
       			event counter victory1_accepted
       			event counter victory1_declined
       			date 0
      		end_add_events
      		historic_event victory1 true
    end_monitor
    
    ;Victory Conditions Fulfilled
    monitor_event EventCounterType victory1_accepted
    	if I_EventCounter victory1_accepted == 1
    		give_everything_to_faction scripting song false
    	end_if
    end_monitor
    
    ;Player wants to wait
    monitor_event EventCounterType victory1_declined
    	set_counter victory_countdown 10
    end_monitor
    
    ;Prompt Player about achieving victory for Victory Type 2
    monitor_event FactionTurnStart FactionIsLocal
    	and FactionType song
    	and I_CompareCounter can_win == 1
    	and I_CompareCounter victory_points_2 > 100
    	and I_CompareCounter victory_countdown == 0
    
    	  	add_events
       			event counter victory2_accepted
       			event counter victory2_declined
       			date 0
      		end_add_events
      		historic_event victory2 true
    end_monitor
    
    ;Victory Conditions Fulfilled
    monitor_event EventCounterType victory2_accepted
    	give_everything_to_faction scripting song false
    end_monitor
    
    ;Player wants to wait
    monitor_event EventCounterType victory2_declined
    	set_counter victory_countdown 10
    end_monitor
    
    ;Prompt Player about achieving victory for Victory Type 3
    monitor_event FactionTurnStart FactionIsLocal
    	and FactionType song
    	and I_CompareCounter can_win == 1
    	and I_CompareCounter victory_points_3 > 100
    	and I_CompareCounter victory_countdown == 0
    
    	  	add_events
       			event counter victory3_accepted
       			event counter victory3_declined
       			date 0
      		end_add_events
      		historic_event victory3 true
    end_monitor
    
    ;Victory Conditions Fulfilled
    monitor_event EventCounterType victory3_accepted
    	give_everything_to_faction scripting song false
    end_monitor
    
    ;Player wants to wait
    monitor_event EventCounterType victory3_declined
    	set_counter victory_countdown 10
    end_monitor
    
    ;Prompt Player about achieving victory for Victory Type Risk
    monitor_event FactionTurnStart FactionIsLocal
    	and FactionType song
    	and I_CompareCounter can_win == 1
    	and I_CompareCounter victory_points_risk > 100
    	and I_CompareCounter victory_countdown == 0
    
    	  	add_events
       			event counter victoryR_accepted
       			event counter victoryR_declined
       			date 0
      		end_add_events
      		historic_event victoryR true
    end_monitor
    
    ;Victory Conditions Fulfilled
    monitor_event EventCounterType victoryR_accepted
    	give_everything_to_faction scripting song false
    end_monitor
    
    ;Player wants to wait
    monitor_event EventCounterType victoryR_declined
    	set_counter victory_countdown 10
    end_monitor
    
    ;;;Victory Type 1 - Hold 50 Settlements including Heian-kyo
    
    ;Reset Settlement Value to prevent accumulation
    monitor_event FactionTurnEnd FactionIsLocal
    	and I_CompareCounter victory_points_1 > 0
    		set_counter victory_points_1 0
    end_monitor
    
    ;Check settlement ownership at slave turn end
    monitor_event FactionTurnEnd FactionType slave
    	and I_EventCounter unique_vc_song == 2
    
    	if I_SettlementOwner Lin-an song
    		inc_counter victory_points_1 1
    	end_if
    	if I_SettlementOwner Jiankang song
    		inc_counter victory_points_1 1
    	end_if
    	if I_SettlementOwner Heian-kyo song
    		inc_counter victory_points_1 100
    	end_if
    end_monitor
    
    ;;;Victory Type 2
    
    ;;;Victory Type 3
    
    ;;;Victory Type Risk
    
    ;Reset Risk Value to prevent accumulation
    monitor_event FactionTurnEnd FactionIsLocal
    	and I_CompareCounter victory_points_risk > 0
    		set_counter victory_points_risk 0
    end_monitor
    
    ;Check settlement ownership at slave turn end
    monitor_event FactionTurnEnd FactionType slave
    	and I_EventCounter unique_vc_song == 2
    
    	if I_SettlementOwner Lin-an song
    		inc_counter victory_points_risk 100
    	end_if
    	if I_SettlementOwner Jiankang song
    		inc_counter victory_points_risk 3
    	end_if
    end_monitor
    		
    
    ;**********Script 1D-3 - Jin Dynasty VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-4 - Goryeo VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-5 - Kingdom of Dali VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-6 - Xi Xia VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-7 - Tibetan Kingdoms VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-8 - Kara Khitan Khanate VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-9 - Mongol Khanate VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-10 - Pagan Kingdom VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-11 - Khmer Empire VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-12 - Kingdom of Champa VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-13 - Dai Viet VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-14 - Taira Clan VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-15 - Minamoto Clan VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-16 - Ghurid Sultanate VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    This is what I sent GED via PM about what it is supposed to do:

    I'm working on our script which will allow us to dictate unique victory conditions for each faction. I've included part of the shell of the script to get your thoughts on the implementation. Keep in mind there's a ton of duplicating still to do, and some of the outrageous values are for testing purposes only.

    I think you'll get the gist of it from looking at the script, but this is what it does:

    * First, it sets an event counter based on the faction chosen.
    * Then it uses that counter to pop up a prompt which explains to the player what the courses to victory are for the faction they chose.
    * Then it initializes the counters at 0 and sets a can_win counter so that winning can be disabled if desired in the future.
    * The next part checks the point totals for each victory condition to see if it is met and whether the player can win, then triggers an accept/decline to allow the player to choose if they want to end the game or not.
    (The reason for this is the unseen portion, all factions actual win conditions require possession of an inaccessible province controlled by our scripting faction, which is given to them when unique conditions are achieved. The scripting faction is frozen for our Wonders, so if a player "wins" but then stays longer, the buildings will be under their control and age, etc.)
    * If the player accepts, the give_everything_to_faction command supplies them with the province the game internally considers necessary to victory.
    * If the player declines, a 10-turn timer is set so the player isn't prompted every turn about victory.
    * Lastly it splits into the ways in which points are accumulated towards each victory.


    There will be 4 ways to win for each faction.

    The first for all factions will be the normal way to win, which is to hold X provinces including certain other provinces. This will be achieved quite simply by requiring [(X*200)+Y-X] points; where X is the number of required settlements, and Y is the number of total settlements. Each required region will increase the counter by 200, and each other region by 1. This insures the only way to win is by owning the required regions, since all the other regions combined don't add up to the points.(Example: Song Condition 1 = Hold 50 Regions including Nara, Seoul. Nara and Seoul ownership both increase counter by 200. All others increase counter by 1. Required points for victory = [(2*200)+50-2] = 448; a fairly simple formula)

    The next two ways to win will be faction-specific, and the possibilities are vast, so not a lot has been decided in regards to these conditions yet. In eventuality I want the other two ways to win to reflect the aspirations of the respective nation. A peaceful nation could win through cultural development that increases the counter for high-level buildings present. A nation that just wants to be a regional power could achieve victory by holding all the settlements in a region consistently for X turns and X turns in a row. There's a lot of possibility in this regard.

    The last way is risk-style. Or perhaps Hearts of Iron style, but anyways. Each province is worth a certain amount of victory points, so key provinces and national capitals are worth much more than outlying provinces. When you get enough victory points, you win, pretty simple.

    What the script does is reset the counter to 0 on the turn end of the player faction, and re-tally all of it on the turn end of the slave faction. Then the results are presented on the turn start of the player faction. Ideally if I conceived this correctly, this makes it so that the counter will not constantly increase for the same feat since it is always being reset, and have it rebuilt at the most opportune time to check in a collective turn.
    Some of the current problems occurring involve the map, and obviously there's a lot of filling in to do. As you can see on the first part of the counter setting, I commented a lot of that out. Reason for that is it wasn't transferring the faction export to the if statements for some reason and would never set. Solution will be to just replicate it for every faction in the 'and' statements unless it can be determined why the 'if' statements weren't working.

    As well, there's an issue that is recurring in this script and in the other script, which is that it doesn't seem to be recognizing the accept/decline counters for usage in the counter checking events, so clicking accept/decline does nothing. It seems to be the case for the shinobi script right now as well, and I haven't been able to find the reason.

    I've made a thread in the history area on regions to figure out the importance of regions for usage in the RISK part of the victory script.

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

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

    Default Re: Unique Victory Conditions Script

    I've temporarily commented out the line that sets the can_win counter to 1, thereby disabling the victory prompt in the script, until GED gets done with the server setup and can come help debug this accept/decline problem.

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

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

    Default Re: Unique Victory Conditions Script

    Okay I've made progress with this. After changing the way that it checks for the accept/decline counter, it is working now, after a bit of heartache with remembering I also changed a Event Counter to a regular counter, and forgot to update some conditions to CompareCounter.

    The old one used:

    Code:
    monitor_event EventCounterType victory1_accepted
    	if I_EventCounter victoryR_accepted == 1

    The new one uses:

    Code:
    monitor_conditions I_EventCounter victoryR_accepted == 1
    So this is what I'll be using for the accept/decline from now on since it actually works. Still isn't fully up and running, but that is because I still have "outlive jin" in the win conditions file and in my test I just wait three turns with some test parameters in place. As well, need to strengthen the scripting faction with garrison and order buildings since it rebels a lot despite being a frozen AI. :hmmm:

    Current version of the script:

    Code:
    ;**********Script 1D-1 - Victory Conditions Setup**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    declare_counter unique_vc_song
    
    ;Sets faction-based counter for usage in other commands
    monitor_event FactionTurnStart FactionIsLocal
    	and I_CompareCounter unique_victory_conditions == 1
    	and FactionType song
    	
    	inc_counter unique_vc_song 1
    
    ;	if FactionType song
    ;		set_event_counter unique_vc_song 1
    ;	end_if
    ;	if FactionType jin
    ;		set_event_counter unique_vc_jin 1
    ;	end_if
    ;	if FactionType goryeo
    ;		set_event_counter unique_vc_goryeo 1
    ;	end_if
    ;	if FactionType dali
    ;		set_event_counter unique_vc_dali 1
    ;	end_if
    ;	if FactionType xixia
    ;		set_event_counter unique_vc_xixia 1
    ;	end_if
    ;	if FactionType tibet
    ;		set_event_counter unique_vc_tibet 1
    ;	end_if
    ;	if FactionType khitans
    ;		set_event_counter unique_vc_khitans 1
    ;	end_if
    ;	if FactionType mongols
    ;		set_event_counter unique_vc_mongols 1
    ;	end_if
    ;	if FactionType pagan
    ;		set_event_counter unique_vc_pagan 1
    ;	end_if
    ;	if FactionType khmer
    ;		set_event_counter unique_vc_khmer 1
    ;	end_if
    ;	if FactionType minamoto
    ;		set_event_counter unique_vc_minamoto 1
    ;	end_if
    ;	if FactionType taira
    ;		set_event_counter unique_vc_taira 1
    ;	end_if
    ;	if FactionType daiviet
    ;		set_event_counter unique_vc_daiviet 1
    ;	end_if
    ;	if FactionType champa
    ;		set_event_counter unique_vc_champa 1
    ;	end_if
    ;	if FactionType ghurid
    ;		set_event_counter unique_vc_ghurid 1
    ;	end_if
    
    	inc_counter unique_victory_conditions 1
    end_monitor
    
    ;Shows user ways to win with their faction
    monitor_event FactionTurnStart FactionIsLocal
    	and I_CompareCounter unique_victory_conditions == 2
    
    	if I_CompareCounter unique_vc_song == 1
      		historic_event unique_vc_song_prompt
    		inc_counter unique_vc_song 1
    	end_if
    	if I_EventCounter unique_vc_jin == 1
      		historic_event unique_vc_jin_prompt
    		inc_event_counter unique_vc_jin 1
    	end_if
    	if I_EventCounter unique_vc_goryeo == 1
      		historic_event unique_vc_goryeo_prompt
    		inc_event_counter unique_vc_goryeo 1
    	end_if
    	if I_EventCounter unique_vc_dali == 1
      		historic_event unique_vc_dali_prompt
    		inc_event_counter unique_vc_dali 1
    	end_if
    	if I_EventCounter unique_vc_xixia == 1
      		historic_event unique_vc_xixia_prompt
    		inc_event_counter unique_vc_xixia 1
    	end_if
    	if I_EventCounter unique_vc_tibet == 1
      		historic_event unique_vc_tibet_prompt
    		inc_event_counter unique_vc_tibet 1
    	end_if
    	if I_EventCounter unique_vc_khitans == 1
      		historic_event unique_vc_khitans_prompt
    		inc_event_counter unique_vc_khitans 1
    	end_if
    	if I_EventCounter unique_vc_mongols == 1
      		historic_event unique_vc_mongols_prompt
    		inc_event_counter unique_vc_mongols 1
    	end_if
    	if I_EventCounter unique_vc_pagan == 1
      		historic_event unique_vc_pagan_prompt
    		inc_event_counter unique_vc_pagan 1
    	end_if
    	if I_EventCounter unique_vc_khmer == 1
      		historic_event unique_vc_khmer_prompt
    		inc_event_counter unique_vc_khmer 1
    	end_if
    	if I_EventCounter unique_vc_minamoto == 1
      		historic_event unique_vc_minamoto_prompt
    		inc_event_counter unique_vc_minamoto 1
    	end_if
    	if I_EventCounter unique_vc_taira == 1
      		historic_event unique_vc_taira_prompt
    		inc_event_counter unique_vc_taira 1
    	end_if
    	if I_EventCounter unique_vc_daiviet == 1
      		historic_event unique_vc_daiviet_prompt
    		inc_event_counter unique_vc_daiviet 1
    	end_if
    	if I_EventCounter unique_vc_champa == 1
      		historic_event unique_vc_champa_prompt
    		inc_event_counter unique_vc_champa 1
    	end_if
    	if I_EventCounter unique_vc_ghurid == 1
      		historic_event unique_vc_ghurid_prompt
    		inc_event_counter unique_vc_ghurid 1
    	end_if
    	
    	inc_counter unique_victory_conditions 1
    end_monitor
    
    ;**********Script 1D-2 - Song Dynasty VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Defines ways for Song Dynasty player to win.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;Set Victory Point Counters
    monitor_event FactionTurnEnd FactionIsLocal
    	and FactionType song
    	and I_CompareCounter unique_victory_conditions == 3
    	and I_CompareCounter can_win == 0
    	and I_CompareCounter unique_vc_song == 2
    
    	set_counter can_win 1
    	set_counter victory_points_1 0
    	set_counter victory_points_2 0
    	set_counter victory_points_3 0
    	set_counter victory_points_risk 0
    end_monitor
    
    ;Decrease timer until victory
    monitor_event FactionTurnEnd FactionIsLocal
    	and I_CompareCounter victory_countdown > 0
    		inc_counter victory_countdown -1
    end_monitor
    
    ;Prompt Player about achieving victory for Victory Type 1
    monitor_event FactionTurnStart FactionIsLocal
    	and FactionType song
    	and I_CompareCounter can_win == 1
    	and I_CompareCounter victory_points_1 > 100
    	and I_CompareCounter victory_countdown == 0
    
    	  	add_events
       			event counter victory1_accepted
       			event counter victory1_declined
       			date 0
      		end_add_events
      		historic_event victory1 true
    end_monitor
    
    ;Victory Conditions Fulfilled
    monitor_conditions I_EventCounter victory1_accepted == 1
    	give_everything_to_faction scripting song false
    	set_event_counter victory1_accepted 0
    end_monitor
    
    ;Player wants to wait
    monitor_conditions I_EventCounter victory1_declined == 1
    	set_counter victory_countdown 10
    	set_event_counter victory1_declined 0
    end_monitor
    
    ;Prompt Player about achieving victory for Victory Type 2
    monitor_event FactionTurnStart FactionIsLocal
    	and FactionType song
    	and I_CompareCounter can_win == 1
    	and I_CompareCounter victory_points_2 > 100
    	and I_CompareCounter victory_countdown == 0
    
    	  	add_events
       			event counter victory2_accepted
       			event counter victory2_declined
       			date 0
      		end_add_events
      		historic_event victory2 true
    end_monitor
    
    ;Victory Conditions Fulfilled
    monitor_conditions I_EventCounter victory2_accepted == 1
    	give_everything_to_faction scripting song false
    	set_event_counter victory2_accepted 0
    end_monitor
    
    ;Player wants to wait
    monitor_conditions I_EventCounter victory2_declined == 1
    	set_counter victory_countdown 10
    	set_event_counter victory2_declined 0
    end_monitor
    
    ;Prompt Player about achieving victory for Victory Type 3
    monitor_event FactionTurnStart FactionIsLocal
    	and FactionType song
    	and I_CompareCounter can_win == 1
    	and I_CompareCounter victory_points_3 > 100
    	and I_CompareCounter victory_countdown == 0
    
    	  	add_events
       			event counter victory3_accepted
       			event counter victory3_declined
       			date 0
      		end_add_events
      		historic_event victory3 true
    end_monitor
    
    ;Victory Conditions Fulfilled
    monitor_conditions I_EventCounter victory3_accepted == 1
    	give_everything_to_faction scripting song false
    	set_event_counter victory3_accepted 0
    end_monitor
    
    ;Player wants to wait
    monitor_conditions I_EventCounter victory3_declined == 1
    	set_counter victory_countdown 10
    	set_event_counter victory3_declined 0
    end_monitor
    
    ;Prompt Player about achieving victory for Victory Type Risk
    monitor_event FactionTurnStart FactionIsLocal
    	and FactionType song
    	and I_CompareCounter can_win == 1
    	and I_CompareCounter victory_points_risk > 100
    	and I_CompareCounter victory_countdown == 0
    
    	  	add_events
       			event counter victoryR_accepted
       			event counter victoryR_declined
       			date 0
      		end_add_events
      		historic_event victoryR true
    end_monitor
    
    ;Victory Conditions Fulfilled
    monitor_conditions I_EventCounter victoryR_accepted == 1
    	give_everything_to_faction scripting song false
    	set_event_counter victoryR_accepted 0
    end_monitor
    
    ;Player wants to wait
    monitor_conditions I_EventCounter victoryR_declined == 1
    	set_counter victory_countdown 10
    	set_event_counter victoryR_declined 0
    end_monitor
    
    ;;;Victory Type 1 - Hold 50 Settlements including Heian-kyo
    
    ;Reset Settlement Value to prevent accumulation
    monitor_event FactionTurnEnd FactionIsLocal
    	and I_CompareCounter victory_points_1 > 0
    		set_counter victory_points_1 0
    end_monitor
    
    ;Check settlement ownership at slave turn end
    monitor_event FactionTurnEnd FactionType slave
    	and I_CompareCounter unique_vc_song == 2
    
    	if I_SettlementOwner Lin-an song
    		inc_counter victory_points_1 1
    	end_if
    	if I_SettlementOwner Pingjiang song
    		inc_counter victory_points_1 1
    	end_if
    	if I_SettlementOwner Heian-kyo song
    		inc_counter victory_points_1 100
    	end_if
    end_monitor
    
    ;;;Victory Type 2
    
    ;;;Victory Type 3
    
    ;;;Victory Type Risk
    
    ;Reset Risk Value to prevent accumulation
    monitor_event FactionTurnEnd FactionIsLocal
    	and I_CompareCounter victory_points_risk > 0
    		set_counter victory_points_risk 0
    end_monitor
    
    ;Check settlement ownership at slave turn end
    monitor_event FactionTurnEnd FactionType slave
    	and I_CompareCounter unique_vc_song == 2
    
    	if I_SettlementOwner Lin-an song
    		inc_counter victory_points_risk 100
    	end_if
    	if I_SettlementOwner Pingjiang song
    		inc_counter victory_points_risk 3
    	end_if
    end_monitor
    		
    
    ;**********Script 1D-3 - Jin Dynasty VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-4 - Goryeo VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-5 - Kingdom of Dali VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-6 - Xi Xia VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-7 - Tibetan Kingdoms VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-8 - Kara Khitan Khanate VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-9 - Mongol Khanate VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-10 - Pagan Kingdom VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-11 - Khmer Empire VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-12 - Kingdom of Champa VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-13 - Dai Viet VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-14 - Taira Clan VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-15 - Minamoto Clan VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    
    ;**********Script 1D-16 - Ghurid Sultanate VC**********
    ;
    ;|Author| Augustus Lucifer
    ;|Purpose| Counters and other requisite global monitors for the unique victory conditions.
    ;|Changelog|
    ; o Script Created 12-31-08 ~ Augustus Lucifer
    You'll notice a lot of it is missing, but that's because people are still bantering about cities, and this is a heavily city-dependent script, so I'll put myself up a creek without a paddle if I go put in all the city values and have to tentatively rely on find-replace to correct them with changes.

    The good news for me as of this moment, is that choosing Decline works. Before it wasn't working in the ninja script, but here if I click accept it will run give_everything_to_faction, and if I click decline it won't and will set the countdown timer. The one thing I can't check yet is whether or not the victory timer will fire again after the 10 turns, since the scripting faction is long dead by then due to revolts.
    Last edited by Augustus Lucifer; February 06, 2009 at 04:17 PM.

Posting Permissions

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