Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23

Thread: 098 teaser: DYNAMIC INTEGRATION OF PROVINCES

  1. #21
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    6,998

    Default Re: 098 teaser: DYNAMIC INTEGRATION OF PROVINCES by JoC

    Perhaps the final improvement to the "Settlement Capture" script is the introduction of a window for the player informing him when his army is spawned as a result of a conquest of one of core provinces of his faction (not necessarily owned by him) by a AI faction. An example of a current full code for "Settlement Capture" for one settlement (there's 199 such codes), is here:
    Code:
        ;======================================================================================================
        ;------------------------------------------------------------------------------  TWANGSTE After Capture
    
    
        declare_counter current_name_Twangste                        ; 0 - Twangste, 1 - Kunigsberg, 2 - Krolewiec
        set_counter current_name_Twangste 0
        set_event_counter Twangste_turns_in_our_realm 500
        
        monitor_event GeneralCaptureSettlement SettlementName Twangste
    
    
            wait 1
            log --- Twangste AFTER CAPTURE NAME CHANGE ------------------------------------------------
            
            if I_EventCounter faction_turn_pagan > 0                ; Pagan factions: Twangste
    
    
                change_settlement_name Twangste Twangste
                
                if I_EventCounter is_the_player == 1 
                and I_CompareCounter current_name_Twangste > 0
                    historic_event SETTLEMENT_NAME_CHANGE
                end_if
            
                set_counter current_name_Twangste 0        
            end_if
            
            if I_EventCounter faction_turn_catholic > 0                ; Catholic factions but Poland: Kunigsberg
            and not I_EventCounter faction_turn_poland > 0
            
                change_settlement_name Twangste TwangsteGerman
                
                if I_EventCounter is_the_player == 1 
                and I_CompareCounter current_name_Twangste < 1
                    historic_event SETTLEMENT_NAME_CHANGE
                end_if
    
    
                if I_EventCounter is_the_player == 1
                and I_CompareCounter current_name_Twangste > 1
                    historic_event SETTLEMENT_NAME_CHANGE
                end_if
                
                set_counter current_name_Twangste 1        
            end_if
    
    
            if I_EventCounter faction_turn_poland > 0                ; Poland: Krolewiec 
    
    
                change_settlement_name Twangste TwangstePolish
                
                if I_EventCounter is_the_player == 1
                and I_CompareCounter current_name_Twangste < 2
                    historic_event SETTLEMENT_NAME_CHANGE
                end_if
            
                set_counter current_name_Twangste 2        
            end_if
    
    
    
    
            log --- Twangste AFTER CAPTURE ARMY SPAWN -------------------------------------------
    
    
            if I_NumberOfSettlements lithuania > 0                    ; faction exists
            and I_EventCounter faction_size_small == 0                ; the conqueror is not a small faction
            and RandomPercent < 66                                    ; some randomness is always good
            and I_EventCounter DifficultyLevel > 2                    ; only for H/VH difficulties 
            and I_EventCounter Twangste_turns_in_our_realm > 550    ; to avoid situation of spawning many armies in a loop situation (conquer-retake-conquer...)
            and I_EventCounter faction_turn_lithuania == 0            ; Balticum        
            and I_EventCounter HANSEATIC_COG < 1                    ; befor full impact of die Hanse    
            
                if I_EventCounter is_the_player == 1
                    historic_event SETTLEMENT_CAPTURE_REBELLION
                end_if
    
    
                if I_EventCounter pl_ec_id == 23
                    historic_event SETTLEMENT_CAPTURE_REBELLION_OUR_PEOPLE
                end_if
                
                spawn_army
                    faction lithuania
                        character random_name, named character, age 37, x 222, y 235
                        traits CounterOfBattles 4, NaturalMilitarySkill 2 , GoodCommander 1 , Hardened 1 , StrategyDread 1 , Feck 4 , BattleScarred 3 , Xenophobia 3
                        unit    Lith Bodyguard            exp 1 armour 1 weapon_lvl 0
                        unit    Ducal Cavalry            exp 0 armour 0 weapon_lvl 0
                        unit    Ducal Spearmen            exp 0 armour 0 weapon_lvl 0
                        unit    Woodsmen                exp 7 armour 0 weapon_lvl 0
                        unit    Woodsmen                exp 0 armour 0 weapon_lvl 0
                        unit    Baltic Spearmen            exp 7 armour 0 weapon_lvl 0
                        unit    Baltic Spearmen            exp 0 armour 0 weapon_lvl 0
                        unit    Lithuanian Skirmishers    exp 0 armour 0 weapon_lvl 0
                        unit    Hunters                    exp 7 armour 0 weapon_lvl 0
                        unit    Hunters                    exp 0 armour 0 weapon_lvl 0
                end
                
            end_if
    
    
            if I_NumberOfSettlements lithuania > 0                    ; faction exists
            and I_EventCounter faction_size_small == 0                ; the conqueror is not a small faction
            and RandomPercent < 66                                    ; some randomness is always good
            and I_EventCounter DifficultyLevel > 2                    ; only for H/VH difficulties 
            and I_EventCounter Twangste_turns_in_our_realm > 550    ; to avoid situation of spawning many armies in a loop situation (conquer-retake-conquer...)
            and I_EventCounter faction_turn_lithuania == 0            ; Balticum
            and I_EventCounter HANSEATIC_COG == 1                    ; die Hanse    is here
            and I_EventCounter current_name_Twangste == 0            ; Twangste    
            
                if I_EventCounter is_the_player == 1
                    historic_event SETTLEMENT_CAPTURE_REBELLION
                end_if
    
    
                if I_EventCounter pl_ec_id == 23
                    historic_event SETTLEMENT_CAPTURE_REBELLION_OUR_PEOPLE
                end_if
                
                spawn_army
                    faction lithuania
                        character random_name, named character, age 37, x 222, y 235
                        traits CounterOfBattles 4, NaturalMilitarySkill 2 , GoodCommander 1 , Hardened 1 , StrategyDread 1 , Feck 4 , BattleScarred 3 , Xenophobia 3
                        unit    Lith Bodyguard            exp 1 armour 1 weapon_lvl 0
                        unit    Ducal Cavalry            exp 0 armour 0 weapon_lvl 0
                        unit    Ducal Spearmen            exp 0 armour 0 weapon_lvl 0
                        unit    Woodsmen                exp 7 armour 0 weapon_lvl 0
                        unit    Woodsmen                exp 0 armour 0 weapon_lvl 0
                        unit    Baltic Spearmen            exp 7 armour 0 weapon_lvl 0
                        unit    Baltic Spearmen            exp 0 armour 0 weapon_lvl 0
                        unit    Lithuanian Skirmishers    exp 0 armour 0 weapon_lvl 0
                        unit    Hunters                    exp 7 armour 0 weapon_lvl 0
                        unit    Hunters                    exp 0 armour 0 weapon_lvl 0
                end
                
            end_if
            
            if I_NumberOfSettlements hre > 0                        ; faction exists
            and I_EventCounter faction_size_small == 0                ; the conqueror is not a small faction
            and RandomPercent < 66                                    ; some randomness is always good
            and I_EventCounter DifficultyLevel > 2                    ; only for H/VH difficulties 
            and I_EventCounter Twangste_turns_in_our_realm > 550    ; to avoid situation of spawning many armies in a loop situation (conquer-retake-conquer...)
            and I_EventCounter faction_turn_hre == 0                ; Balticum
            and I_EventCounter HANSEATIC_COG == 1                    ; die Hanse    is here
            and I_EventCounter current_name_Twangste == 1            ; Kunigsberg    
            
                if I_EventCounter is_the_player == 1
                    historic_event SETTLEMENT_CAPTURE_REBELLION
                end_if
    
    
                if I_EventCounter pl_ec_id == 13
                    historic_event SETTLEMENT_CAPTURE_REBELLION_OUR_PEOPLE
                end_if
                
                spawn_army
                    faction hre
                        character random_name, named character, age 37, x 222, y 235
                        traits CounterOfBattles 4, NaturalMilitarySkill 2 , GoodCommander 1 , Hardened 1 , StrategyDread 1 , Feck 4 , BattleScarred 3 , Xenophobia 3
                            unit    NE Bodyguard            exp 1 armour 1 weapon_lvl 0
                            unit    Mailed Knights            exp 0 armour 0 weapon_lvl 0
                            unit    Mounted Sergeants        exp 0 armour 1 weapon_lvl 0
                            unit    Sergeant Spearmen        exp 7 armour 1 weapon_lvl 0
                            unit    Sergeant Spearmen        exp 0 armour 0 weapon_lvl 0
                            unit    Woodsmen                exp 0 armour 0 weapon_lvl 0
                            unit    Hunters                    exp 0 armour 0 weapon_lvl 0
                            unit    Lettish Crossbowmen        exp 7 armour 0 weapon_lvl 0
                            unit    Lettish Crossbowmen        exp 0 armour 0 weapon_lvl 0    
                end
                
            end_if
            
            if I_NumberOfSettlements poland > 0                        ; faction exists
            and I_EventCounter faction_size_small == 0                ; the conqueror is not a small faction
            and RandomPercent < 66                                    ; some randomness is always good
            and I_EventCounter DifficultyLevel > 2                    ; only for H/VH difficulties 
            and I_EventCounter Twangste_turns_in_our_realm > 550    ; to avoid situation of spawning many armies in a loop situation (conquer-retake-conquer...)
            and I_EventCounter faction_turn_poland == 0
            and I_EventCounter HANSEATIC_COG == 1                    ; die Hanse    is here
            and I_EventCounter current_name_Twangste == 2            ; Krolewiec    
            
                if I_EventCounter is_the_player == 1
                    historic_event SETTLEMENT_CAPTURE_REBELLION
                end_if
    
    
                if I_EventCounter pl_ec_id == 16
                    historic_event SETTLEMENT_CAPTURE_REBELLION_OUR_PEOPLE
                end_if
                
                spawn_army
                    faction poland
                        character random_name, named character, age 37, x 222, y 235
                        traits CounterOfBattles 4, NaturalMilitarySkill 2 , GoodCommander 1 , Hardened 1 , StrategyDread 1 , Feck 4 , BattleScarred 3 , Xenophobia 3
                            unit    NE Bodyguard            exp 1 armour 1 weapon_lvl 0
                            unit    Polish Knights            exp 0 armour 0 weapon_lvl 0
                            unit    Polish Retainers        exp 0 armour 1 weapon_lvl 0
                            unit    Woodsmen                exp 7 armour 0 weapon_lvl 0
                            unit    Woodsmen                exp 0 armour 0 weapon_lvl 0
                            unit    Slav Levies                exp 7 armour 1 weapon_lvl 0
                            unit    Slav Levies                exp 0 armour 0 weapon_lvl 0
                            unit    Slavic Javelinmen        exp 1 armour 0 weapon_lvl 0
                            unit    Lettish Crossbowmen        exp 7 armour 0 weapon_lvl 0
                            unit    Lettish Crossbowmen        exp 0 armour 0 weapon_lvl 0        
                end
                
            end_if        
    
    
    
    
            log --- Twangste AFTER CAPTURE INITIAL INTEGRATION, BUILDINGS DAMAGED & OTHER COUNTERS ---------
    
    
            set_event_counter Twangste_turns_in_our_realm 0
            
            if I_EventCounter is_the_player == 1    
                inc_counter number_settlements_conquered_by_player 1
            end_if
    
    
    
    
            log --- Twangste AFTER CAPTURE IMPACT ON PLAYER AGGRESSIVITY REPUTATION ------------------------
            
            if I_EventCounter is_the_player == 1                            ; only player
            and I_EventCounter DifficultyLevel == 4                            ; VH difficulty    
            and I_EventCounter faction_turn_lithuania == 0                    ; expansion in Baltics is legitimate for Lithuania 
    
    
                if I_EventCounter FL_is_crowned_ruler == 1                    ; crowned FL
    
    
                    inc_event_counter player_aggressivity 3                    ; +3
                    
                    if I_EventCounter FL_diplomatic_skills_counter < 3        ; +3  Crowned FL Refined diplomatic skills
                        inc_event_counter player_aggressivity 3                ; cumulative!
                        
                        if I_EventCounter FL_diplomatic_skills_counter < 2    ; +3  Crowned FL Mediocre diplomatic skills
                            inc_event_counter player_aggressivity 3            ; cumulative!
    
    
                        end_if
                    end_if
                end_if
    
    
                if I_EventCounter FL_is_crowned_ruler < 1                    ; UN-crowned
    
    
                    inc_event_counter player_aggressivity 6                    ; +6
                    
                    if I_EventCounter FL_diplomatic_skills_counter < 3        ; +6  UNcrowned FL Refined diplomatic skills
                        inc_event_counter player_aggressivity 6                ; cumulative!
                        
                        if I_EventCounter FL_diplomatic_skills_counter < 2    ; +6  UNcrowned FL Mediocre diplomatic skills
                            inc_event_counter player_aggressivity 6            ; cumulative!
    
    
                        end_if
                    end_if
                end_if
                
                if I_EventCounter player_aggressivity > 24                    ; 25+, then player is warmonger: very high turmoil, fast deterioration of diplo standing
                and I_EventCounter player_aggressivity_feedback < 3            ; fires only on a change from a lower level
                    historic_event PLAYER_AGGRESSIVITY_WARMONGER            ; info for the player
                    set_event_counter player_aggressivity_feedback 3        ; it will go down in another script
                    log ------ player warmonger info
                end_if
    
    
                if I_EventCounter player_aggressivity > 12                    ;  13-24, then player is aggressive: high turmoil, deterioration of diplo standing
                and I_EventCounter player_aggressivity < 25
                and I_EventCounter player_aggressivity_feedback < 2            ; fires only on a change from a lower level
                    historic_event PLAYER_AGGRESSIVITY_AGGRESSIVE
                    set_event_counter player_aggressivity_feedback 2
                    log ------ player aggressive info
                end_if
    
    
            end_if
            
        end_monitor
    Last edited by Jurand of Cracow; April 01, 2022 at 02:10 PM.

  2. #22
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    6,998

    Default Re: 098 teaser: DYNAMIC INTEGRATION OF PROVINCES by JoC

    This pic shows that you can cope with the maximum unrest - if you've got good infrastructure in the city:


  3. #23
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    6,998

    Default Re: 098 teaser: DYNAMIC INTEGRATION OF PROVINCES by JoC

    Quote Originally Posted by Macaras View Post
    I have noticed one thing - when the settlement is conquered from the rebels the resistance script activates and gives an army to a faction that supposedly is related to this area, not the rebel. So for example if human plays France, and HRE takes over Clarmont, France (human in this case) receives an additional general and army next to it ? Similarly I play Sicily and conquer Calari from slaves - the Pisan army appears. Intuitively it should be either rebel army or none I would say in such cases. The same happens to AI.
    this is the whole point in stabilizing the map in the historical perspective. The uprising can be in favour of the faction that traditionally held it (but can also be independent). In cases where historically it was contested there're a few possibilities, and the choice of the faction the uprising is alleged to is random. In cases where the province was traditionally independent - eg. Ireland - the uprising army will always be independent (or rebel, or in the code "slave").
    (old pic, sorry, but we refer here to the reverse of this situation)

Page 2 of 2 FirstFirst 12

Posting Permissions

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