Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 55

Thread: Scripts that are or will be in the SSHIP

  1. #21

    Default Re: Scripts that are or will be in the SSHIP

    Quote Originally Posted by Jurand of Cracow View Post
    This one was made by MWY long time ago, I've introduced it for 097. It's very historical. I've got a few other similar historical events in mind that would replicate this script (Almohads, Makuria, Timurids)

    Code:
        ;======================================================================================================
    	;------- Qara Khitai  ---------------------------------------------------------------------------------
    	;======================================================================================================
    	
        ;====================================================================================================== Qara Khitai Invasion
        ;------- Qara Khitai Trade & Invasion
        ; made in 2018 by MWY
    
    
        ;------------------ AI -------------------
        monitor_event PreFactionTurnStart FactionType turks
            and IsFactionAIControlled
            and I_SettlementOwner Merv = turks
            and I_TurnNumber > 14
            and RandomPercent > 66
    
    
            set_event_counter Qara_Khitai_Provoked 0
    
    
            if RandomPercent > 5
                inc_event_counter Qara_Khitai_Provoked 1
            end_if
            if RandomPercent > 5
                inc_event_counter Qara_Khitai_Provoked 1
            end_if
    
    
            if I_EventCounter Qara_Khitai_Provoked = 0
                add_money turks -15000
    
    
                increment_kings_purse turks 250
                historic_event Qara_Khitai_Trade
            end_if
    
    
            if I_EventCounter Qara_Khitai_Provoked = 1
                add_money turks -7500
    
    
                increment_kings_purse turks 250
                historic_event Qara_Khitai_Trade
            end_if
    
    
            if I_EventCounter Qara_Khitai_Provoked = 2
                set_event_counter Qara_Khitai_Invasion 1
            end_if
    
    
            terminate_monitor
        end_monitor
    
    
        ;------------------ PLAYER -------------------
        monitor_event PreFactionTurnStart FactionType turks
            and not IsFactionAIControlled
            and I_SettlementOwner Merv = turks
            and SettlementsTaken > 1
            and RandomPercent > 75
    
    
            set_event_counter Qara_Khitai_Provoked 0
            historic_event Qara_Khitai_Ambassadors true
    
    
            terminate_monitor
        end_monitor
    
    
        monitor_event PreFactionTurnStart FactionType turks
            and not IsFactionAIControlled
            and I_SettlementOwner Merv = turks
            and I_EventCounter Qara_Khitai_Contact = 1
            and RandomPercent > 50
    
    
            set_event_counter Qara_Khitai_Contact 2
            historic_event Qara_Khitai_Ambassadors_Two true
    
    
            terminate_monitor
        end_monitor
    
    
        monitor_event EventCounter EventCounterType Qara_Khitai_Ambassadors_accepted
            and EventCounter = 1
    
    
            set_event_counter Qara_Khitai_Contact 1
            add_money turks -10000
            set_event_counter Qara_Khitai_Ambassadors_accepted 0
            terminate_monitor
        end_monitor
    
    
        monitor_event EventCounter EventCounterType Qara_Khitai_Ambassadors_declined
            and EventCounter = 1
    
    
            set_event_counter Qara_Khitai_Contact 1
            inc_event_counter Qara_Khitai_Provoked 1
            set_event_counter Qara_Khitai_Ambassadors_declined 0
            terminate_monitor
        end_monitor
    
    
        monitor_event EventCounter EventCounterType Qara_Khitai_Ambassadors_Two_accepted
            and EventCounter = 1
    
    
            add_money turks -5000
            set_event_counter Qara_Khitai_Ambassadors_Two_accepted 0
            terminate_monitor
        end_monitor
    
    
        monitor_event EventCounter EventCounterType Qara_Khitai_Ambassadors_Two_declined
            and EventCounter = 1
    
    
            inc_event_counter Qara_Khitai_Provoked 1
            set_event_counter Qara_Khitai_Ambassadors_Two_declined 0
            terminate_monitor
        end_monitor
    
    
    
    
        monitor_event EventCounter EventCounterType Qara_Khitai_Provoked
            and I_EventCounter Qara_Khitai_Contact = 2
    
    
            if I_EventCounter Qara_Khitai_Provoked = 2
                and RandomPercent > 5
                set_event_counter Qara_Khitai_Invasion 1
            end_if
    
    
            if I_EventCounter Qara_Khitai_Provoked = 1
                and RandomPercent > 50
                set_event_counter Qara_Khitai_Invasion 1
            end_if
    
    
            if I_EventCounter Qara_Khitai_Provoked = 0
                and RandomPercent > 95
                set_event_counter Qara_Khitai_Invasion 1
            end_if
    
    
            if not I_EventCounter Qara_Khitai_Invasion = 1
                increment_kings_purse turks 250
                historic_event Qara_Khitai_Trade
            end_if
    
    
            terminate_monitor
        end_monitor
    
    
    
    
        monitor_event FactionTurnStart FactionType slave
            and I_EventCounter Qara_Khitai_Invasion = 1
    
    
            historic_event Qara_Khitai_Attack
    
    
            spawn_army ; URGENCH
                faction slave
                character	Tabuyan, named character, age 48, x 504, y 148, label qarakhitaileader, family
                traits MilitaryInclination 1 , Military_Edu 3 , NaturalMilitarySkill 2 , GoodCommander 2 , BattleDread 1 , StrategyDread 2 , PublicFaith 1 , GoodCavalryGeneral 1 , ReligionStarter 1 , BiologicalSon 1 , Handsome 6 , Intelligent 6
                unit	ME Bodyguard		exp 4 armour 0 weapon_lvl 0
                unit	Nukeri Horse Archers		exp 3 armour 0 weapon_lvl 0
                unit	Nukeri Horse Archers		exp 3 armour 0 weapon_lvl 0
                unit	Nukeri Horse Archers		exp 3 armour 0 weapon_lvl 0
                unit	Lubchiten Horse Archers		exp 3 armour 0 weapon_lvl 0
                unit	Lubchiten Horse Archers		exp 3 armour 0 weapon_lvl 0
                unit	Steppe Kazaks		exp 2 armour 0 weapon_lvl 0
                unit	Steppe Kazaks		exp 2 armour 0 weapon_lvl 0
                unit	Turkish Horse Archers		exp 2 armour 0 weapon_lvl 0
                unit	Turkish Horse Archers		exp 2 armour 0 weapon_lvl 0
                unit	Merguen Archers		exp 3 armour 0 weapon_lvl 0
                unit	Merguen Archers		exp 3 armour 0 weapon_lvl 0
                unit	Kashtim Thralls		exp 3 armour 0 weapon_lvl 0
                unit	Kashtim Thralls		exp 3 armour 0 weapon_lvl 0
                unit	Afghan Javelinmen		exp 2 armour 0 weapon_lvl 0
                unit	Afghan Javelinmen		exp 2 armour 0 weapon_lvl 0
            end
    
    
            spawn_army ; MERV
                faction slave
                character	Yelu_Dashi, named character, age 27, x 508, y 126, label qarakhitaiheir, family
                traits MilitaryInclination 1 , Military_Edu 2 , NaturalMilitarySkill 2 , GoodCommander 2 , Anger 1 , StrategyDread 1 , PublicFaith 1 , Loyal 2 , ContentGeneral 1
                unit	ME Bodyguard				exp 4 armour 0 weapon_lvl 0
                unit	Nukeri Horse Archers		exp 3 armour 0 weapon_lvl 0
                unit	Nukeri Horse Archers		exp 3 armour 0 weapon_lvl 0
                unit	Lubchiten Horse Archers		exp 3 armour 0 weapon_lvl 0
                unit	Lubchiten Horse Archers		exp 3 armour 0 weapon_lvl 0
                unit	Lubchiten Horse Archers		exp 3 armour 0 weapon_lvl 0
                unit	Steppe Kazaks				exp 2 armour 0 weapon_lvl 0
                unit	Steppe Kazaks				exp 2 armour 0 weapon_lvl 0
                unit	Steppe Kazaks				exp 2 armour 0 weapon_lvl 0
                unit	Turkish Horse Archers		exp 2 armour 0 weapon_lvl 0
                unit	Turkish Horse Archers		exp 2 armour 0 weapon_lvl 0
                unit	Merguen Archers		exp 3 armour 0 weapon_lvl 0
                unit	Merguen Archers		exp 3 armour 0 weapon_lvl 0
                unit	Kashtim Thralls		exp 3 armour 0 weapon_lvl 0
                unit	Kashtim Thralls		exp 3 armour 0 weapon_lvl 0
                unit	Kashtim Thralls		exp 3 armour 0 weapon_lvl 0
                unit	Kashtim Thralls		exp 3 armour 0 weapon_lvl 0
            end
    
    
            terminate_monitor
        end_monitor
    
    
    
    
        declare_counter QK_attack_urgench
        set_counter QK_attack_urgench 0
        declare_counter QK_attack_Merv
        set_counter QK_attack_Merv 0
    
    
        monitor_event FactionTurnStart FactionType slave
            and I_CharacterExists qarakhitaileader
    
    
            if I_SettlementOwner Urgench = slave
                terminate_monitor
            end_if
    
    
            if I_SettlementUnderSiege Urgench
                if I_CompareCounter QK_attack_urgench = 1
                    siege_settlement qarakhitaileader, Urgench, attack
                    set_counter QK_attack_urgench 2
                    terminate_monitor
                end_if
            end_if
    
    
            if I_CompareCounter QK_attack_urgench = 1
                terminate_monitor
            end_if
    
    
            if not I_SettlementUnderSiege Urgench
                if I_CompareCounter QK_attack_urgench = 0
                    siege_settlement qarakhitaileader, Urgench, maintain
                    set_counter QK_attack_urgench 1
                end_if
            end_if
    
    
        end_monitor
    
    
        monitor_event FactionTurnStart FactionType slave
            and IsFactionAIControlled
            and I_CharacterExists qarakhitaiheir
    
    
            if I_SettlementOwner Merv = slave
                terminate_monitor
            end_if
    
    
            if I_SettlementUnderSiege Merv
                if I_CompareCounter QK_attack_Merv = 1
                    siege_settlement qarakhitaiheir, Merv, attack
                    set_counter QK_attack_Merv 2
                    terminate_monitor
                end_if
            end_if
    
    
            if I_CompareCounter QK_attack_Merv = 1
                terminate_monitor
            end_if
    
    
            if not I_SettlementUnderSiege Merv
                if I_CompareCounter QK_attack_Merv = 0
                    siege_settlement qarakhitaiheir, Merv, maintain
                    set_counter QK_attack_Merv 1
                end_if
            end_if
    
    
        end_monitor
    These scripts are great! I think they make the game more immersive, plus they are totally historical. They also add a point of alert and danger for factions located on the edges of the campaign map such as the Moors and the Almohad invasion or the Egyptians and the invasion of the Black Africans of Makuria.
    It will be a great challenge to deal with these foreign invasions along with the great Mongol invasion.

    @Sindathar, i agree about your idea, simulating a rebel army for high tax and unrest in the countryside, also with little invasion from the sea raiders together with mercenaries...
    It would be a campaign very surprising and with added difficulty
    Last edited by j.a.luna; November 29, 2020 at 11:43 AM.
    THE MORE YOU SWEAT NOW,
    THE LESS YOU BLEED IN BATTLE!!!



    Sign the petition to remove hardcoded limits for M2TW

  2. #22

    Default Re: Scripts that are or will be in the SSHIP

    can you please explain the logic behind the qara khitai event? do they always invade or there can be a chance that they leave you be?

  3. #23

    Default Re: Scripts that are or will be in the SSHIP

    Quote Originally Posted by kaiser29 View Post
    can you please explain the logic behind the qara khitai event? do they always invade or there can be a chance that they leave you be?
    Seen them peacefully settling. Resulting into a increase of 250 gold to the Seljuk's king purse.

    Anyway, I have a few suggestions of scripts regarding civil wars. Or, more accurately, general suggestions, that probably would require scripts, that I wouldn't know ow to do. Mostly, the player would try to get rid of conspiring and rebellious generals. There's four ways to do that. 1 - Boating accident, always popular for being more or less guaranteed to get rid of multiple characters, but would depend on the presence of pirates or enemy fleets. 2 - Deserting. These characters have bottom low loyalty, so leaving them outside could eventually lead to desertion, but it is hardly guaranteed. 3 - Dying bravely in combat, no explanation required. 4 - Selflessly helping the diseased in a plagued city and, sorrowfully, coming down to the disease.

    All of these, naturally, can happen accidentally. But if the player wants it to happen "accidentally", it requires moving a character outside, least they are in a coastal settlement with a port, in which they could grab a ship and go straight for method 1. My suggestions is to create, if possible, a script that makes it guaranteed these plotting characters to go rebel outside the settlement. Now, that would actually help the player getting them out of the family tree and succession line, but with that, would come two more things. A full stack army to go with the rebels, and, if possible, the civil war. That would allow for the possibility of either allowing, passively, these characters to stay in the settlement and the civil war happen on succession, or get an immediate, flaming conclusion to the whole thing that, upon loss, would result in a greatly weakened realm.

    The highest levels of conspirators have severe debuffs to governance and movement speed, that would make the sailing option very hard to pull off. Player would, naturally, just leave them outside until they die or, hopefully, rebel (the France case). Instead of just keeping them out as a non-factor, that would allow these characters to actually become a real visible danger to the campaign.

  4. #24

    Default Re: Scripts that are or will be in the SSHIP

    Any plans on adding Withwnar's bodyguard scrip in to SS? Would be great if we could change bodyguards into a later plate armoured unit, including dismounted knights. First you select early or late, then you select unit, then armour upg, then exp upg. That is 12 units * 4 armour levels * 10 exp levels = 480 entries. Should not be a problem to duplicate. Now we can start with a Norman knight with a hauberk and short sleeves with an armour value of, say, 5 and progress into 7, 9, 11. Then with the late unit you get 12, 14, 16, 18.

    Early mounted knights with sword/lance and shield
    Early mounted knight with axe/lance and shield
    Early dismounted knights with spear and shield
    Early dismounted knights with sword and shield
    Early dismounted knights with axe and shield

    Late mounted knight with sword/lance and shield
    Late mounted knight with mace/lance and shield
    Late dismounted knights with pike
    Late dismounted knights with two handed poleaxe
    Late dismounted knights with two handed sword
    Late dismounted knights with sword and shield
    Late dismounted knights with mace and shield
    "Alea iacta est"

  5. #25

    Default Re: Scripts that are or will be in the SSHIP

    Hey guys, I'll share here some of the progress I'm making on reviewing the script for version 098.
    Tell me if you spot mistakes!

    Qara Khitai invasion

    First one, as I'm quite proud of it: I managed to squeeze the previous 4 monitors in a single one.
    097 version:
    Code:
        monitor_event FactionTurnStart FactionType slave
            and I_EventCounter Qara_Khitai_Invasion = 1
    
            historic_event Qara_Khitai_Attack
    
            log --- Script Qara Khitai Invasion --- spawn army Urgench
            spawn_army ; URGENCH
                faction slave
                character    Tabuyan, named character, age 48, x 504, y 148, label qarakhitaileader, family
                traits MilitaryInclination 1 , Military_Edu 3 , NaturalMilitarySkill 2 , GoodCommander 2 , BattleDread 1 , StrategyDread 2 , PublicFaith 1 , GoodCavalryGeneral 1 , ReligionStarter 1 , BiologicalSon 1 , Handsome 6 , Intelligent 6
                unit    ME Bodyguard        exp 4 armour 0 weapon_lvl 0
                unit    Nukeri Horse Archers        exp 3 armour 0 weapon_lvl 0
                unit    Nukeri Horse Archers        exp 3 armour 0 weapon_lvl 0
                unit    Nukeri Horse Archers        exp 3 armour 0 weapon_lvl 0
                unit    Lubchiten Horse Archers        exp 3 armour 0 weapon_lvl 0
                unit    Lubchiten Horse Archers        exp 3 armour 0 weapon_lvl 0
                unit    Steppe Kazaks        exp 2 armour 0 weapon_lvl 0
                unit    Steppe Kazaks        exp 2 armour 0 weapon_lvl 0
                unit    Turkish Horse Archers        exp 2 armour 0 weapon_lvl 0
                unit    Turkish Horse Archers        exp 2 armour 0 weapon_lvl 0
                unit    Merguen Archers        exp 3 armour 0 weapon_lvl 0
                unit    Merguen Archers        exp 3 armour 0 weapon_lvl 0
                unit    Kashtim Thralls        exp 3 armour 0 weapon_lvl 0
                unit    Kashtim Thralls        exp 3 armour 0 weapon_lvl 0
                unit    Afghan Javelinmen        exp 2 armour 0 weapon_lvl 0
                unit    Afghan Javelinmen        exp 2 armour 0 weapon_lvl 0
            end
    
            log --- Script Qara Khitai Invasion --- spawn army Merv
            spawn_army ; MERV
                faction slave
                character    Yelu_Dashi, named character, age 27, x 508, y 126, label qarakhitaiheir, family
                traits MilitaryInclination 1 , Military_Edu 2 , NaturalMilitarySkill 2 , GoodCommander 2 , Anger 1 , StrategyDread 1 , PublicFaith 1 , Loyal 2 , ContentGeneral 1
                unit    ME Bodyguard                exp 4 armour 0 weapon_lvl 0
                unit    Nukeri Horse Archers        exp 3 armour 0 weapon_lvl 0
                unit    Nukeri Horse Archers        exp 3 armour 0 weapon_lvl 0
                unit    Lubchiten Horse Archers        exp 3 armour 0 weapon_lvl 0
                unit    Lubchiten Horse Archers        exp 3 armour 0 weapon_lvl 0
                unit    Lubchiten Horse Archers        exp 3 armour 0 weapon_lvl 0
                unit    Steppe Kazaks                exp 2 armour 0 weapon_lvl 0
                unit    Steppe Kazaks                exp 2 armour 0 weapon_lvl 0
                unit    Steppe Kazaks                exp 2 armour 0 weapon_lvl 0
                unit    Turkish Horse Archers        exp 2 armour 0 weapon_lvl 0
                unit    Turkish Horse Archers        exp 2 armour 0 weapon_lvl 0
                unit    Merguen Archers        exp 3 armour 0 weapon_lvl 0
                unit    Merguen Archers        exp 3 armour 0 weapon_lvl 0
                unit    Kashtim Thralls        exp 3 armour 0 weapon_lvl 0
                unit    Kashtim Thralls        exp 3 armour 0 weapon_lvl 0
                unit    Kashtim Thralls        exp 3 armour 0 weapon_lvl 0
                unit    Kashtim Thralls        exp 3 armour 0 weapon_lvl 0
            end
    
            terminate_monitor
        end_monitor
    
    
        declare_counter QK_attack_Urgench
        set_counter QK_attack_Urgench 0
        declare_counter QK_attack_Merv
        set_counter QK_attack_Merv 0
    
        monitor_event FactionTurnStart FactionType slave
            and I_CharacterExists qarakhitaileader
    
            if I_SettlementOwner Urgench = slave
                terminate_monitor
            end_if
    
            if I_SettlementUnderSiege Urgench
                if I_CompareCounter QK_attack_Urgench = 1
                    log --- Script Qara Khitai Invasion --- attack Urgench
                    siege_settlement qarakhitaileader, Urgench, attack
                    set_counter QK_attack_Urgench 2
                    terminate_monitor
                end_if
            end_if
    
            if I_CompareCounter QK_attack_Urgench = 1
                terminate_monitor
            end_if
    
            if not I_SettlementUnderSiege Urgench
                if I_CompareCounter QK_attack_Urgench = 0
                    log --- Script Qara Khitai Invasion --- siege Urgench
                    siege_settlement qarakhitaileader, Urgench, maintain
                    set_counter QK_attack_Urgench 1
                end_if
            end_if
    
        end_monitor
    
        monitor_event FactionTurnStart FactionType slave
            and IsFactionAIControlled
            and I_CharacterExists qarakhitaiheir
    
            if I_SettlementOwner Merv = slave
                terminate_monitor
            end_if
    
            if I_SettlementUnderSiege Merv
                if I_CompareCounter QK_attack_Merv = 1
                    log --- Script Qara Khitai Invasion --- attack Merv
                    siege_settlement qarakhitaiheir, Merv, attack
                    set_counter QK_attack_Merv 2
                    terminate_monitor
                end_if
            end_if
    
            if I_CompareCounter QK_attack_Merv = 1
                terminate_monitor
            end_if
    
            if not I_SettlementUnderSiege Merv
                if I_CompareCounter QK_attack_Merv = 0
                    log --- Script Qara Khitai Invasion --- siege Merv
                    siege_settlement qarakhitaiheir, Merv, maintain
                    set_counter QK_attack_Merv 1
                end_if
            end_if
    
        end_monitor
    New version
    Code:
    declare_counter QK_attack_Urgench
    set_counter QK_attack_Urgench 0
    declare_counter QK_attack_Merv
    set_counter QK_attack_Merv 0
    
        monitor_event FactionTurnStart FactionType slave
            and I_EventCounter Qara_Khitai_Invasion = 1
    
            log --- Script start: Qara Khitai invasion 
    
            if I_CompareCounter QK_attack_Merv = 0
                and I_CompareCounter QK_attack_Urgench = 0
    
                historic_event Qara_Khitai_Attack
                log ------ spawn army near Urgench
                spawn_army
                    faction slave
                    character    Tabuyan, named character, age 48, x 504, y 148, label qarakhitaileader, family
                    traits MilitaryInclination 1 , Military_Edu 3 , NaturalMilitarySkill 2 , GoodCommander 2 , BattleDread 1 , StrategyDread 2 , PublicFaith 1 , GoodCavalryGeneral 1 , ReligionStarter 1 , BiologicalSon 1 , Handsome 6 , Intelligent 6
                    unit    ME Bodyguard        exp 4 armour 0 weapon_lvl 0
                    unit    Nukeri Horse Archers        exp 3 armour 0 weapon_lvl 0
                    unit    Nukeri Horse Archers        exp 3 armour 0 weapon_lvl 0
                    unit    Nukeri Horse Archers        exp 3 armour 0 weapon_lvl 0
                    unit    Lubchiten Horse Archers        exp 3 armour 0 weapon_lvl 0
                    unit    Lubchiten Horse Archers        exp 3 armour 0 weapon_lvl 0
                    unit    Steppe Kazaks        exp 2 armour 0 weapon_lvl 0
                    unit    Steppe Kazaks        exp 2 armour 0 weapon_lvl 0
                    unit    Turkish Horse Archers        exp 2 armour 0 weapon_lvl 0
                    unit    Turkish Horse Archers        exp 2 armour 0 weapon_lvl 0
                    unit    Merguen Archers        exp 3 armour 0 weapon_lvl 0
                    unit    Merguen Archers        exp 3 armour 0 weapon_lvl 0
                    unit    Kashtim Thralls        exp 3 armour 0 weapon_lvl 0
                    unit    Kashtim Thralls        exp 3 armour 0 weapon_lvl 0
                    unit    Afghan Javelinmen        exp 2 armour 0 weapon_lvl 0
                    unit    Afghan Javelinmen        exp 2 armour 0 weapon_lvl 0
                end
    
                log ------ spawn army near Merv
                spawn_army
                    faction slave
                    character    Yelu_Dashi, named character, age 27, x 508, y 126, label qarakhitaiheir, family
                    traits MilitaryInclination 1 , Military_Edu 2 , NaturalMilitarySkill 2 , GoodCommander 2 , Anger 1 , StrategyDread 1 , PublicFaith 1 , Loyal 2 , ContentGeneral 1
                    unit    ME Bodyguard                exp 4 armour 0 weapon_lvl 0
                    unit    Nukeri Horse Archers        exp 3 armour 0 weapon_lvl 0
                    unit    Nukeri Horse Archers        exp 3 armour 0 weapon_lvl 0
                    unit    Lubchiten Horse Archers        exp 3 armour 0 weapon_lvl 0
                    unit    Lubchiten Horse Archers        exp 3 armour 0 weapon_lvl 0
                    unit    Lubchiten Horse Archers        exp 3 armour 0 weapon_lvl 0
                    unit    Steppe Kazaks                exp 2 armour 0 weapon_lvl 0
                    unit    Steppe Kazaks                exp 2 armour 0 weapon_lvl 0
                    unit    Steppe Kazaks                exp 2 armour 0 weapon_lvl 0
                    unit    Turkish Horse Archers        exp 2 armour 0 weapon_lvl 0
                    unit    Turkish Horse Archers        exp 2 armour 0 weapon_lvl 0
                    unit    Merguen Archers        exp 3 armour 0 weapon_lvl 0
                    unit    Merguen Archers        exp 3 armour 0 weapon_lvl 0
                    unit    Kashtim Thralls        exp 3 armour 0 weapon_lvl 0
                    unit    Kashtim Thralls        exp 3 armour 0 weapon_lvl 0
                    unit    Kashtim Thralls        exp 3 armour 0 weapon_lvl 0
                    unit    Kashtim Thralls        exp 3 armour 0 weapon_lvl 0
                end
            end_if
    
            if I_SettlementOwner Urgench = slave
                log ------ abort Urgench attack (slave controlled)
                set_counter QK_attack_Urgench 2
            end_if
            
            if I_CompareCounter QK_attack_Urgench = 0
                and I_SettlementUnderSiege Urgench
    
                log ------ abort Urgench attack (already under siege)
                set_counter QK_attack_Urgench 2
            end_if
            
            if I_CompareCounter QK_attack_Urgench = 0
                and not I_SettlementUnderSiege Urgench
    
                log ------ siege Urgench
                siege_settlement qarakhitaileader, Urgench, maintain
                set_counter QK_attack_Urgench 1
            end_if
    
            if I_CompareCounter QK_attack_Urgench = 1
                log ------ attack Urgench
                siege_settlement qarakhitaileader, Urgench, attack
                set_counter QK_attack_Urgench 2
            end_if
    
            if I_SettlementOwner Merv = slave
                log ------ abort Merv attack (slave controlled)
                set_counter QK_attack_Merv 2
            end_if
            
            if I_CompareCounter QK_attack_Merv = 0
                and I_SettlementUnderSiege Merv
    
                log ------ abort Merv attack (already under siege)
                set_counter QK_attack_Merv 2
            end_if
    
            if I_CompareCounter QK_attack_Merv = 0
                and not I_SettlementUnderSiege Merv
    
                log ------ siege Merv
                siege_settlement qarakhitaiheir, Merv, maintain
                set_counter QK_attack_Merv 1
            end_if
    
            if I_CompareCounter QK_attack_Merv = 1
                log ------ attack Merv
                siege_settlement qarakhitaiheir, Merv, attack
                set_counter QK_attack_Merv 2
            end_if
    
            if I_CompareCounter QK_attack_Merv = 2
                and I_CompareCounter QK_attack_Urgench = 2
                
                log ------ terminate monitor (invasion finished)
                terminate_monitor
            end_if
            log ------ Script end
        end_monitor

    Small improvements

    Also merging or terminating monitors here and there. For exemple:
    Mongols progress info, 097 version:
    Code:
        monitor_event FactionTurnEnd FactionType mongols
            and IsFactionAIControlled
            and I_CharacterTypeNearTile mongols, named_character, 10, 440, 194
    
            historic_event mongols_blue_horde_caucasus
    
            terminate_monitor
        end_monitor
    
        monitor_event FactionTurnEnd FactionType mongols
            and IsFactionAIControlled
            and I_CharacterTypeNearTile mongols, named_character, 10, 326, 202
    
            historic_event mongols_blue_horde_kiev
    
            terminate_monitor
        end_monitor
    
        monitor_event FactionTurnEnd FactionType mongols
            and IsFactionAIControlled
            and I_CharacterTypeNearTile mongols, named_character, 10, 280, 184
    
            historic_event mongols_blue_horde_hungary
    
            terminate_monitor
        end_monitor
    
        monitor_event FactionTurnEnd FactionType mongols
            and IsFactionAIControlled
            and I_CharacterTypeNearTile mongols, named_character, 5, 396, 89
    
            historic_event mongols_horde_baghdad
    
            terminate_monitor
        end_monitor
    New version, I don't think it'll change turn times much, but it's about keeping the scripts clean
    Code:
    declare_counter mongols_reach_caucasus
    set_counter mongols_reach_caucasus 0
    declare_counter mongols_reach_kiev
    set_counter mongols_reach_kiev 0
    declare_counter mongols_reach_hungary
    set_counter mongols_reach_hungary 0
    declare_counter mongols_reach_baghdad
    set_counter mongols_reach_baghdad 0
    
        monitor_event FactionTurnEnd FactionType mongols
        
            if not I_IsFactionAIControlled
                terminate_monitor
            end_if
    
            if I_CompareCounter mongols_reach_caucasus = 0
                and I_CharacterTypeNearTile mongols, named_character, 10, 440, 194
                historic_event mongols_blue_horde_caucasus
                set_counter mongols_reach_caucasus 1
            end_if
    
            if I_CompareCounter mongols_reach_kiev = 0
                and I_CharacterTypeNearTile mongols, named_character, 10, 326, 202
                historic_event mongols_blue_horde_kiev
                set_counter mongols_reach_kiev 1
            end_if
    
            if I_CompareCounter mongols_reach_hungary = 0
                and I_CharacterTypeNearTile mongols, named_character, 10, 280, 184
                historic_event mongols_blue_horde_hungary
                set_counter mongols_reach_hungary 1
            end_if
    
            if I_CompareCounter mongols_reach_baghdad = 0
                and I_CharacterTypeNearTile mongols, named_character, 5, 396, 89
                historic_event mongols_horde_baghdad
                set_counter mongols_reach_baghdad 1
            end_if
            
            if I_CompareCounter mongols_reach_caucasus = 1
                and I_CompareCounter mongols_reach_kiev = 1
                and I_CompareCounter mongols_reach_hungary = 1
                and I_CompareCounter mongols_reach_baghdad = 1
                terminate_monitor
            end_if
        end_monitor
    EDIT 26/01/2021
    Qara Kithai encounter for player

    I'm also quite proud of that one: went from this
    Code:
    set_event_counter Qara_Khitai_Contact 0
    
        monitor_event PreFactionTurnStart FactionType turks
            and I_SettlementOwner Merv = turks
            and SettlementsTaken > 1
            
            log --- Script start : Qara Khitai (player)
            if I_IsFactionAIControlled turks
                log ------ terminate script (AI is turks)
                terminate_monitor
            end_if
            
            if I_EventCounter Qara_Khitai_Contact = 0
                and RandomPercent > 75
    
                log ------ First contact
                set_event_counter Qara_Khitai_Provoked 0
                historic_event Qara_Khitai_Ambassadors true
            end_if
            
            if I_EventCounter Qara_Khitai_Contact = 1
                and RandomPercent > 50
                
                log ------ Second contact
                set_event_counter Qara_Khitai_Contact 2
                historic_event Qara_Khitai_Ambassadors_Two true
                log ------ terminate script
                terminate_monitor
            end_if
            log ------ Script end
        end_monitor
    
        monitor_event EventCounter EventCounterType Qara_Khitai_Ambassadors_accepted
            and EventCounter = 1
    
            log --- Script Qara Khitai Ambassadors --- First contact accepted
            set_event_counter Qara_Khitai_Contact 1
            add_money turks -10000
            set_event_counter Qara_Khitai_Ambassadors_accepted 0
            terminate_monitor
        end_monitor
    
        monitor_event EventCounter EventCounterType Qara_Khitai_Ambassadors_declined
            and EventCounter = 1
    
            log --- Script Qara Khitai Ambassadors --- First contact declined
            set_event_counter Qara_Khitai_Contact 1
            inc_event_counter Qara_Khitai_Provoked 1
            set_event_counter Qara_Khitai_Ambassadors_declined 0
            terminate_monitor
        end_monitor
    
        monitor_event EventCounter EventCounterType Qara_Khitai_Ambassadors_Two_accepted
            and EventCounter = 1
    
            log --- Script Qara Khitai Ambassadors --- Second contact accepted
            add_money turks -5000
            set_event_counter Qara_Khitai_Ambassadors_Two_accepted 0
            terminate_monitor
        end_monitor
    
        monitor_event EventCounter EventCounterType Qara_Khitai_Ambassadors_Two_declined
            and EventCounter = 1
    
            log --- Script Qara Khitai Ambassadors --- Second contact refused
            inc_event_counter Qara_Khitai_Provoked 1
            set_event_counter Qara_Khitai_Ambassadors_Two_declined 0
            terminate_monitor
        end_monitor
    
    
        monitor_event EventCounter EventCounterType Qara_Khitai_Provoked
            and I_EventCounter Qara_Khitai_Contact = 2
    
            if I_EventCounter Qara_Khitai_Provoked = 2
                and RandomPercent > 5
                log --- Script Qara Khitai Ambassadors --- set event counter Qara_Khitai_Invasion 1
                set_event_counter Qara_Khitai_Invasion 1
            end_if
    
            if I_EventCounter Qara_Khitai_Provoked = 1
                and RandomPercent > 50
                log --- Script Qara Khitai Ambassadors --- set event counter Qara_Khitai_Invasion 1
                set_event_counter Qara_Khitai_Invasion 1
            end_if
    
            if I_EventCounter Qara_Khitai_Provoked = 0
                and RandomPercent > 95
                log --- Script Qara Khitai Ambassadors --- set event counter Qara_Khitai_Invasion 1
                set_event_counter Qara_Khitai_Invasion 1
            end_if
    
            if not I_EventCounter Qara_Khitai_Invasion = 1
                log --- Script Qara Khitai Ambassadors --- Trading
                increment_kings_purse turks 250
                historic_event Qara_Khitai_Trade
            end_if
            terminate_monitor
        end_monitor
    to this single monitor:
    Code:
        monitor_event PreFactionTurnStart FactionType turks
            and I_SettlementOwner Merv = turks
            and SettlementsTaken > 1
            
            log --- Script start : Qara Khitai (player)
            if I_IsFactionAIControlled turks
                log ------ terminate script (AI is turks)
                terminate_monitor
            end_if
            
            if I_EventCounter Qara_Khitai_Contact = 0
                and RandomPercent > 75
    
                historic_event Qara_Khitai_Ambassadors true
    
                while I_EventCounter Qara_Khitai_Ambassadors_accepted = 0
                    and I_EventCounter Qara_Khitai_Ambassadors_declined = 0
                end_while
    
                set_event_counter Qara_Khitai_Contact 1
    
                if I_EventCounter Qara_Khitai_Ambassadors_accepted = 1
                    log ------ First contact accepted
                    set_event_counter Qara_Khitai_Provoked 0
                    add_money turks -10000
                    set_event_counter Qara_Khitai_Ambassadors_accepted 0
                end_if
    
                if I_EventCounter Qara_Khitai_Ambassadors_declined = 1
                    log ------ First contact declined
                    inc_event_counter Qara_Khitai_Provoked 1
                    set_event_counter Qara_Khitai_Ambassadors_declined 0
                end_if
            end_if
            
            if I_EventCounter Qara_Khitai_Contact = 1
                and RandomPercent > 50
    
                set_event_counter Qara_Khitai_Contact 2
                historic_event Qara_Khitai_Ambassadors_Two true
    
                while I_EventCounter Qara_Khitai_Ambassadors_Two_accepted = 0
                    and I_EventCounter Qara_Khitai_Ambassadors_Two_declined = 0
                end_while
    
                if I_EventCounter Qara_Khitai_Ambassadors_Two_accepted = 1
                    log ------ Second contact accepted
                    add_money turks -5000
                    set_event_counter Qara_Khitai_Ambassadors_Two_accepted 0
                end_if
    
                if I_EventCounter Qara_Khitai_Ambassadors_Two_declined = 1
                    log ------ Second contact refused
                    inc_event_counter Qara_Khitai_Provoked 1
                    set_event_counter Qara_Khitai_Ambassadors_Two_declined 0
                end_if
            end_if
    
            if I_EventCounter Qara_Khitai_Contact = 2
    
                if I_EventCounter Qara_Khitai_Provoked = 0
                    and RandomPercent > 95
                    log ------ Invasion (provoked 0)
                    set_event_counter Qara_Khitai_Invasion 1
                end_if
    
                if I_EventCounter Qara_Khitai_Provoked = 1
                    and RandomPercent > 50
                    log ------ Invasion (provoked 1)
                    set_event_counter Qara_Khitai_Invasion 1
                end_if
    
                if I_EventCounter Qara_Khitai_Provoked = 2
                    and RandomPercent > 5
                    log ------ Invasion (provoked 2)
                    set_event_counter Qara_Khitai_Invasion 1
                end_if
    
                if not I_EventCounter Qara_Khitai_Invasion = 1
                    log ------ Trading
                    increment_kings_purse turks 250
                    historic_event Qara_Khitai_Trade
                end_if
                
                log ------ Terminate monitor_event
                terminate_monitor
            end_if
            log ------ Script end
        end_monitor

    Last edited by Belovèse; January 26, 2021 at 03:44 PM.
    Belovèse's Toolbox: export text files to spreadsheet, detailed unit stats
    Stainless Steel Historical Improvement Project (SSHIP) team member.
    Mini-mods: diplomacy and relation/reputation - detailled unit stats

  6. #26
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    8,488

    Default Re: Scripts that are or will be in the SSHIP

    It seems there'll be another script for Georgia. It's because I've spotted the right unit for this script and I've fixed the recruitment before.

    {GEORGIAN1_REFORMS_INFO_BODY}\nThere are four major political reforms for Georgia in the SSHIP:\n\nThe Georgian Golden Age, which historically peaked in the second part of the 12th century, will be triggered once Georgia has constructed three Local Guards and one Ikoner Studio, and the Faction Leader has relations to the royal houses of either Kiev or Byzantium (i.e. his wife or one of his ancestors was of this blood). Alternatively, the Golden Age will start once the Faction Leader holds the Crown. \n\nThe nation's greatest poet, Shota Rustaveli, wrote his oevres in the first half of 13the century. An in-game event to commemorate him will be triggered if two Orthodox Cathedral and three Ikoner Studios have been built by the faction.\n\nThe Georgian Revival, which historically occurred in the first part of 14th century, will be triggered if an enemy faction (not the rebels) conquered Tbilisi, then Georgia reconquered it, and constructed at least three Provincial Councils while holding a Citadel.\n\nFinally, the creation of the Last United Kingdom in first part of 15th century will will be triggered if Georgia owns a Huge City with a Great Universilty and a Huge Orthodox Cathedral, and also holds a Citadel with a Royal Armoury.
    {GEORGIAN1_REFORMS_INFO_TITLE}Georgian Political Reforms


    {GEORGIAN1B_MILITARY_REFORMS_INFO_BODY}\nThere are two reforms that introduce very specific units into Georgian military.\n\n(1) The contacts with the Turks from the late 11th century. and then the Mongol invasions of 13th century. prompted the Georgian Eristavi to recruit more and more Tatar riders. At some point they became an important branch of the military. In the game, after 10 successful battles against the Turks, the Cumans or the Mongols, Tatar Lancers units will be available for recruitment in the stables.\n\n(2) The relative proximity of the Latin principalities in Syria in 12th century provided opportunities to get in close contacts with this world, also as far as the military technology is concerned. To reflect it, the 13th century marriages of the Georgian kings with the princesses from the great royal families of the Latin world (i.e. of German, French, English, Jerusalem or Sicilian bloods) will result in the introduction of advanced crossbow units provided Georgia has built at least 2 Marksmans Ranges.
    {GEORGIAN1B_MILITARY_REFORMS_INFO_TITLE}Georgian Military Reforms



    {GEORGIAN8_TATAR_LANCERS_REFORM_TITLE}The Tatar Lancers Reform
    {GEORGIAN8_TATAR_LANCERS_REFORM_BODY}\nThe contacts with the Turks from the late 11c. and then the Mongol invasions of 13c. prompted the Georgian Eristavi to recruit more and more Tatar riders. At some point they became an important branch of the military.\n\nGAME STRATEGY: From this moment, the Tatar Lancers can be recruited from the stables.[/QUOTE]
    Code:
        ;-------------------------------------------------------------------- GEORGIAN 8 TATAR LANCERS REFORMS    ; the blueprint for this script are the EBII Pontos reforms
        ; it is likely to happen within the first 100-150 turns (backstop at turn 160)
    
    
        declare_counter georgia_battlewon
    
    
        monitor_event PostBattle FactionType georgia
            and WonBattle
            and GeneralFoughtFaction cumans
            and not I_ConflictType Naval
            and not I_ConflictType Withdraw
            inc_counter georgia_battlewon 1
            if I_IsFactionAIControlled georgia                    ; not for the AI
                terminate_monitor
            end_if
            if I_CompareCounter georgia_battlewon > 10
                terminate_monitor
            end_if
        end_monitor
    
    
        monitor_event PostBattle FactionType georgia
            and WonBattle
            and GeneralFoughtFaction turks
            and not I_ConflictType Naval
            and not I_ConflictType Withdraw
            inc_counter georgia_battlewon 1
            if I_IsFactionAIControlled georgia                    ; not for the AI
                terminate_monitor
            end_if
            if I_CompareCounter georgia_battlewon > 10
                terminate_monitor
            end_if
        end_monitor
    
    
        monitor_event PostBattle FactionType georgia
            and WonBattle
            and GeneralFoughtFaction rum
            and not I_ConflictType Naval
            and not I_ConflictType Withdraw
            inc_counter georgia_battlewon 1
            if I_IsFactionAIControlled georgia                    ; not for the AI
                terminate_monitor
            end_if
            if I_CompareCounter georgia_battlewon > 10
                terminate_monitor
            end_if
        end_monitor
    
    
        monitor_event PostBattle FactionType georgia
            and WonBattle
            and GeneralFoughtFaction mongols
            and not I_ConflictType Naval
            and not I_ConflictType Withdraw
            inc_counter georgia_battlewon 1
            if I_IsFactionAIControlled georgia                    ; not for the AI
                terminate_monitor
            end_if
            if I_CompareCounter georgia_battlewon > 10
                terminate_monitor
            end_if
        end_monitor
    
    
        monitor_event FactionTurnStart FactionType georgia
    
    
            if I_SettlementOwner Kutaisi = georgia
                and I_SettlementOwner Tbilisi = georgia
                and I_NumberOfSettlements georgia > 2
                and I_CompareCounter georgia_battlewon > 9
                set_event_counter georgian8_tatar_lancers_reform_player 1
                historic_event GEORGIAN8_TATAR_LANCERS_REFORM factions { georgia, }
                terminate_monitor
            end_if
    
    
            if I_TurnNumber > 160                                        ; FALL BACK - in case of failure or a bug
                and RandomPercent > 90                                    ; to add some randomness against the bugs
                historic_event GEORGIAN8_TATAR_LANCERS_REFORM factions { georgia, }
                terminate_monitor
            end_if
        
        end_monitor
    Last edited by Jurand of Cracow; June 22, 2021 at 02:24 PM.

  7. #27

    Default Re: Scripts that are or will be in the SSHIP

    So, the turn times will be 20 minutes long now?

  8. #28
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    8,488

    Default Re: Scripts that are or will be in the SSHIP

    Quote Originally Posted by Draken2007 View Post
    So, the turn times will be 20 minutes long now?
    Well, @Belovese spent a lot of time in pruning and economizing on the scripts - see below "merging or terminating monitors" in his entry. On my computer, at some point he achieved something like 28 seconds for initial turns. In my latest test games, the turns last 45-50 seconds. It happens though that something is running in the background (I don't know what) and the turns are 2 minutes - then I need to close the game or log-out (I haven't pinpointed the method yet) and then those 45 secs. are back.

  9. #29

    Default Re: Scripts that are or will be in the SSHIP

    Quote Originally Posted by Jurand of Cracow View Post
    Well, @Belovese spent a lot of time in pruning and economizing on the scripts - see below "merging or terminating monitors" in his entry. On my computer, at some point he achieved something like 28 seconds for initial turns. In my latest test games, the turns last 45-50 seconds. It happens though that something is running in the background (I don't know what) and the turns are 2 minutes - then I need to close the game or log-out (I haven't pinpointed the method yet) and then those 45 secs. are back.
    The first turns are 45 seconds, at turn 50, it will be around 3 -5 min. Which is what I had and why I can't play this mod.

    The only version I can play is 0.95 which has regular SS6.4 turn times. You guys should go back to that instead of inflating your mod with scripts.

    Maybe create an installer so that we can choose how bloated we want the game. Like Bulat Steel mod does it.

  10. #30
    Nemesis2345's Avatar Semisalis
    Join Date
    May 2013
    Location
    Constanta, Romania
    Posts
    462

    Default Re: Scripts that are or will be in the SSHIP

    Quote Originally Posted by Draken2007 View Post
    The first turns are 45 seconds, at turn 50, it will be around 3 -5 min. Which is what I had and why I can't play this mod.

    The only version I can play is 0.95 which has regular SS6.4 turn times. You guys should go back to that instead of inflating your mod with scripts.

    Maybe create an installer so that we can choose how bloated we want the game. Like Bulat Steel mod does it.
    Thing is , thats not it...

    I can say i get around 25-45 second turn times as well , i used to have them really long too but on 0.9.4 which was ages ago . So i dont think it's really the game as is the computer that runs it .

    Medieval 2 being an old as the hills game cant properly use newer hardware (and it's been a looooooong time) so as Jurand said ,sometimes the game is slow for some reason.

  11. #31

    Default Re: Scripts that are or will be in the SSHIP

    Quote Originally Posted by Nemesis2345 View Post
    Thing is , thats not it...

    I can say i get around 25-45 second turn times as well , i used to have them really long too but on 0.9.4 which was ages ago . So i dont think it's really the game as is the computer that runs it .

    Medieval 2 being an old as the hills game cant properly use newer hardware (and it's been a looooooong time) so as Jurand said ,sometimes the game is slow for some reason.
    If that's the case, then it sucks but I'm simply not going to downgrade my system just so I can run this mod. I just simply don't play it. Medieval 2 needs a remaster exactly for this reason. Soon enough, this game won't even run anymore.

  12. #32
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    8,488

    Default Re: Scripts that are or will be in the SSHIP

    Quote Originally Posted by Draken2007 View Post
    The first turns are 45 seconds, at turn 50, it will be around 3 -5 min. Which is what I had and why I can't play this mod.

    The only version I can play is 0.95 which has regular SS6.4 turn times. You guys should go back to that instead of inflating your mod with scripts.

    Maybe create an installer so that we can choose how bloated we want the game. Like Bulat Steel mod does it.
    Modders are always welcome to the team, so maybe somebody would make it - if it could be separated.

    I'm runnng a test version of 098 and at turn 60 the turn times are still below 50 second. It is, inter alia, because many initial scripts are terminated until then (information windows, initial sieges etc.).

  13. #33

    Default Re: Scripts that are or will be in the SSHIP

    Is there any plan to make a script that automatically change the bodyguard from early to late? (No, not just the armour upgrade but a similar script to marian reforms)

  14. #34
    Nemesis2345's Avatar Semisalis
    Join Date
    May 2013
    Location
    Constanta, Romania
    Posts
    462

    Default Re: Scripts that are or will be in the SSHIP

    Quote Originally Posted by umbracatervae777 View Post
    Is there any plan to make a script that automatically change the bodyguard from early to late? (No, not just the armour upgrade but a similar script to marian reforms)
    Well , the thing is the Early era and Late era bodyguards are 2 separate units ,so you would need to make 2 separate units for each faction or smth. It is already possible, but i think there are no more Unit slots so thats why it wont work here.

    But iirc they are planning on overhauling alot of units so we might get some free slots idk.

    I know Kostic made different models based on the era and you jsut had to replace the data folder if u wanted. It was a nice try from him to appeal to everyone .

  15. #35

    Default Re: Scripts that are or will be in the SSHIP

    Quote Originally Posted by Nemesis2345 View Post
    Well , the thing is the Early era and Late era bodyguards are 2 separate units ,so you would need to make 2 separate units for each faction or smth. It is already possible, but i think there are no more Unit slots so thats why it wont work here.

    But iirc they are planning on overhauling alot of units so we might get some free slots idk.

    I know Kostic made different models based on the era and you jsut had to replace the data folder if u wanted. It was a nice try from him to appeal to everyone .
    Late era bodyguard already exist in game for any faction whose have a shared bodyguard unit. But at the moment they are only recruitable at castles when certain event happens.

  16. #36
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    8,488

    Default Re: Scripts that are or will be in the SSHIP

    Quote Originally Posted by umbracatervae777 View Post
    Is there any plan to make a script that automatically change the bodyguard from early to late? (No, not just the armour upgrade but a similar script to marian reforms)
    Frankly speaking, I don't know. It's not my piece of cake, and I've already have a lot on my plate.

    Quote Originally Posted by umbracatervae777 View Post
    Late era bodyguard already exist in game for any faction whose have a shared bodyguard unit. But at the moment they are only recruitable at castles when certain event happens.
    They're also recruitable from the Tourney buildings and from Professional buildings.

    In the wake of remake of the Professional building (2 levels) into Landowners builidign (4 levels), their recruitment will be adjusted, eg.
    Code:
    ; General SPAIN ARAGON PORTUGAL landowners4 -----------------------------------------------------------------------------------
    
            recruit_pool	"SE Bodyguard"			0.8	0.02	1  0  requires factions { spain, aragon, portugal, } and region_religion catholic 50 and not event_counter HEAVY_MAIL_ARMOR 1
            recruit_pool	"SE Bodyguard"			0.8	0.03	1  0  requires factions { spain, aragon, portugal, } and region_religion catholic 50 and event_counter HEAVY_MAIL_ARMOR 1 and not event_counter TRANSITIONAL_ARMOR 1
            recruit_pool	"SE Bodyguard"			0.8	0.04	1  0  requires factions { spain, aragon, portugal, } and region_religion catholic 50 and event_counter TRANSITIONAL_ARMOR 1 and not event_counter HALF_PLATE_ARMOR 1
            recruit_pool	"SE Late Bodyguard"		0.8	0.055	1  0  requires factions { spain, aragon, portugal, } and region_religion catholic 50 and event_counter HALF_PLATE_ARMOR 1 and not event_counter MATCHLOCK 1 
            recruit_pool	"SE Late Bodyguard"		0.8	0.077	1  0  requires factions { spain, aragon, portugal, } and region_religion catholic 50 and event_counter MATCHLOCK 1

  17. #37
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    8,488

    Default Re: Scripts that are or will be in the SSHIP

    A new invasion - to provide a hiccough for the expansion of Georgia;
    (obviously, in the future I'll make this code a bit more intricate)
    EDIT: a new script shown here, more intricate.

    I think it now shows nicely the historical push in the SSHIP: it were the Khwaresmians who finished off the Eldeguzid Atabegs.

    Code:
    ;======================================================================================================
        ;------- Eldeguzid invasions of Georgia  --------------------------------------------------------------
        ;======================================================================================================
        ; by JoC 2021
        
        ;======================================================================================================
        ; the goal is to make the life of Georgia a bit more difficult early game when they seem to be overpowered
        ; it happens every 15 years until the Mongols sack Samarkand or Georgia takes Baghdad and Isfahan
    
    
        set_event_counter eldeguzid_invasions_allowed 0        
                
        monitor_event PreFactionTurnStart FactionType georgia
            and I_NumberOfSettlements georgia > 2
            and I_SettlementOwner Tbilisi = georgia            ; Georgia holds it's lands, it is not a respawn / the last stand
            and I_SettlementOwner Kutaisi = georgia
            
            log --- Script start : Ildeguzids invasion
            
            inc_event_counter eldeguzid_invasions_allowed 1
    
    
            if I_EventCounter ELDEGUZID1_START < 1
                historic_event ELDEGUZID1_START factions { cumans, turks, abbasid, zengid, rum, byzantium, georgia, jerusalem, }
            end_if
            
            if I_EventCounter SAMARKAND_SACKED > 0
                log ------ Terminate: no more Ildeguzid invasions after Khwaresmians chased out of Marawannahr
                terminate_monitor
            end_if
    
    
            if I_SettlementOwner Isfahan = georgia
            and I_SettlementOwner Baghdad = georgia
                log ------ Terminate: no more Ildeguzid invasions after Georgia conquers both Baghdad and Isfahan
                terminate_monitor        
            end_if
            
            if I_CompareCounter eldeguzid_invasions_allowed > 20
            and RandomPercent > 10
            and I_SettlementOwner Tabriz = georgia
            
                log ------ spawn army in Tabriz
                spawn_army
                    faction slave
                    character    Saban ad-Din, named character, age 35, x 431, y 133
                    traits LoyaltyStarter 3 , MilitaryInclination 1 , Military_Edu 3 , GoodCommander 2 , ReligionStarter 1 , Royal_Blood_Rum_Turkish 1 , BiologicalSon 1 , Handsome 3 , Intelligent 6 
                        unit    ME Bodyguard                exp 3 armour 1 weapon_lvl 0
                        unit    Turkomans                    exp 7 armour 1 weapon_lvl 0
                        unit    Turkomans                    exp 4 armour 1 weapon_lvl 0
                        unit    Turkomans                    exp 1 armour 1 weapon_lvl 0    
                        unit    Turkomans                    exp 0 armour 0 weapon_lvl 0    
                        unit    Turkish Horse Archers        exp 4 armour 0 weapon_lvl 0
                        unit    Turkish Horse Archers        exp 1 armour 0 weapon_lvl 0
                        unit    Dismounted Fari Archers        exp 1 armour 0 weapon_lvl 0
                        unit    Turkish Archers                exp 4 armour 0 weapon_lvl 0        
                        unit    Turkish Archers                exp 1 armour 0 weapon_lvl 0                        
                        unit    Turkish Archers                exp 0 armour 0 weapon_lvl 0                
                end
    
    
                historic_event ELDEGUZID2_INVASION  factions { cumans, turks, abbasid, zengid, rum, byzantium, georgia, jerusalem, }
                set_event_counter eldeguzid_invasions_allowed 0
                
            end_if
            
            if I_CompareCounter eldeguzid_invasions_allowed > 20
            and RandomPercent > 10
            and not I_SettlementOwner Tabriz = georgia
            and I_SettlementOwner Baku = georgia
            
                log ------ spawn army in Shirvan
                spawn_army
                    faction slave
                    character    Saban ad-Din, named character, age 35, x 411, y 140
                    traits LoyaltyStarter 3 , MilitaryInclination 1 , Military_Edu 3 , GoodCommander 2 , ReligionStarter 1 , Royal_Blood_Rum_Turkish 1 , BiologicalSon 1 , Handsome 3 , Intelligent 6 
                        unit    ME Bodyguard                exp 3 armour 1 weapon_lvl 0
                        unit    Turkomans                    exp 7 armour 1 weapon_lvl 0
                        unit    Turkomans                    exp 4 armour 1 weapon_lvl 0
                        unit    Turkomans                    exp 1 armour 1 weapon_lvl 0    
                        unit    Turkomans                    exp 0 armour 0 weapon_lvl 0    
                        unit    Turkish Horse Archers        exp 4 armour 0 weapon_lvl 0
                        unit    Turkish Horse Archers        exp 1 armour 0 weapon_lvl 0
                        unit    Dismounted Fari Archers        exp 1 armour 0 weapon_lvl 0
                        unit    Turkish Archers                exp 4 armour 0 weapon_lvl 0        
                        unit    Turkish Archers                exp 1 armour 0 weapon_lvl 0                        
                        unit    Turkish Archers                exp 0 armour 0 weapon_lvl 0                
                end
    
    
                historic_event ELDEGUZID2_INVASION  factions { cumans, turks, abbasid, zengid, rum, byzantium, georgia, jerusalem, }
                set_event_counter eldeguzid_invasions_allowed 0
                
            end_if
    
    
            if I_CompareCounter eldeguzid_invasions_allowed > 20
            and RandomPercent > 10
            and not I_SettlementOwner Tabriz = georgia
            and not I_SettlementOwner Baku = georgia
            and I_SettlementOwner Ani = georgia
            
            log ------ spawn army in Armenia
                spawn_army
                    faction slave
                    character    Salih ad-Din, named character, age 35, x 404, y 123
                    traits LoyaltyStarter 3 , MilitaryInclination 1 , Military_Edu 3 , GoodCommander 2 , ReligionStarter 1 , Royal_Blood_Rum_Turkish 1 , BiologicalSon 1 , Handsome 3 , Intelligent 6 
                        unit    ME Bodyguard                exp 3 armour 1 weapon_lvl 0
                        unit    Turkomans                    exp 7 armour 1 weapon_lvl 0
                        unit    Turkomans                    exp 4 armour 1 weapon_lvl 0
                        unit    Turkomans                    exp 1 armour 1 weapon_lvl 0    
                        unit    Turkomans                    exp 0 armour 0 weapon_lvl 0    
                        unit    Turkish Horse Archers        exp 4 armour 0 weapon_lvl 0
                        unit    Turkish Horse Archers        exp 1 armour 0 weapon_lvl 0
                        unit    Dismounted Fari Archers        exp 1 armour 0 weapon_lvl 0
                        unit    Turkish Archers                exp 4 armour 0 weapon_lvl 0        
                        unit    Turkish Archers                exp 1 armour 0 weapon_lvl 0                        
                        unit    Turkish Archers                exp 0 armour 0 weapon_lvl 0                
                end
    
    
                historic_event ELDEGUZID2_INVASION factions { cumans, turks, abbasid, zengid, rum, byzantium, georgia, jerusalem, }
                set_event_counter eldeguzid_invasions_allowed 0
                
            end_if
            
            if I_CompareCounter eldeguzid_invasions_allowed > 20
            and RandomPercent > 10
            and not I_SettlementOwner Tabriz = georgia
            and not I_SettlementOwner Baku = georgia
            
            log ------ spawn army in Kartli
                spawn_army
                    faction slave
                    character    Salih ad-Din, named character, age 35, x 416, y 112
                    traits LoyaltyStarter 3 , MilitaryInclination 1 , Military_Edu 3 , GoodCommander 2 , ReligionStarter 1 , Royal_Blood_Rum_Turkish 1 , BiologicalSon 1 , Handsome 3 , Intelligent 6 
                        unit    ME Bodyguard                exp 3 armour 1 weapon_lvl 0
                        unit    Turkomans                    exp 7 armour 1 weapon_lvl 0
                        unit    Turkomans                    exp 4 armour 1 weapon_lvl 0
                        unit    Turkomans                    exp 1 armour 1 weapon_lvl 0    
                        unit    Turkomans                    exp 0 armour 0 weapon_lvl 0    
                        unit    Turkish Horse Archers        exp 4 armour 0 weapon_lvl 0
                        unit    Turkish Horse Archers        exp 1 armour 0 weapon_lvl 0
                        unit    Dismounted Fari Archers        exp 1 armour 0 weapon_lvl 0
                        unit    Turkish Archers                exp 4 armour 0 weapon_lvl 0        
                        unit    Turkish Archers                exp 1 armour 0 weapon_lvl 0                        
                        unit    Turkish Archers                exp 0 armour 0 weapon_lvl 0                
                end
    
    
                historic_event ELDEGUZID2_INVASION  factions { cumans, turks, abbasid, zengid, rum, byzantium, georgia, jerusalem, }
                set_event_counter eldeguzid_invasions_allowed 0
                
            end_if
            
            log ------ Script end
                
        end_monitor


    Spoiler Alert, click show to read: 


    {ELDIGUZIDS1_BODY}The Atabegs of Azerbaijan rose from the ashes of the vast Seljuk Empire in the beginning of the twelfth century. The atabeg (literally father lord in Turkish) was the title of guardians appointed for minor princes of the Seljukid line who were nominally placed in charge of provincial garrisons. Atabegs, usually Turkic slave-officers, were officially tutors and vice-regents to their princes, but in the political circumstances of the time, they were the actual rulers. In 1136, Sultan Masud appointed Shams ad-Din Eldegiz to be an atabeg of Arslan-shah, his step-son and juvenile successor, transferring Azerbaijan to his possession as iqta, land in lieu of payment. Eldegiz chose Barda as his residence, from where he set about extending his power, founding the Atabeg state in what is now Azerbaijan. Under the Atabegs, Azerbaijan became a significant cultural center of the Turkic people.
    {ELDIGUZIDS1TITLE}The Eldeguzid Atabegate


    {ELDIGUZIDS2_INVASION_BODY}Shams ad-Din Ildeniz was a capable general and administrator and theoretically consolidating and extending the power of his prince, he subdued a spacious territory between the Caucasus and the Persian Gulf. The word “Azam” (Azam stands for Great) was added to his title, a tile which all of the State’s subsequent rulers would use. His strongest foe was Georgia, whose army was strengthened by 40,000 Kipchak Turkic warriors. In 1138 the Georgian king Demetre I, attacked the ancient city of Ganja. While leaving the city his troops carried off the well-known iron gate of Ganja as their trophy, which is now on display in the city of Gori. From 1161 onwards, the Georgians made plundering raids on Ani, Dvin, Ganja, Nakhchivan and other regions controlled by the Atabeg. Eldeniz formed a union with other Seljukids in the beginning of 1160s to fight against the Georgians, and in 1163 the allies inflicted a defeat on king George III of Georgia. In response to this defeat, the czar of Georgia occupied Ganja in 1165. Georgians took several Azerbaijani cities and reached such faraway cities as Nakhchivan and Beylakan. Usually, the Georgians demanded tribute then left once this had been paid.
    {ELDIGUZIDS2_INVASION_TITLE}Eldeguzids Invade Georgia!
    Last edited by Jurand of Cracow; August 08, 2021 at 03:29 AM.

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

    Default Re: Scripts that are or will be in the SSHIP

    Another script that will be in the next version.
    Code:
        ;======================================================================================================
        ;------- Destroy AI buildings that prevent AI from funding other buildings
        ; by JoC 2021
        
        ; The non-existence of certain buildings is a prerequisite for building some other buildings.
        ; Eg. grasslands and chude_building prevents building upper stages of the farms.
        ; The AI doesn't know it so it would be blocked at some point from developing certain settlements further (eg. farms are pre-requisits of a number of other buildings).
        ; To to prevent such a situation this scirpt periodically destroys the problematic buildings.
        ; Note: buildings that a faction is not eligible to use (eg. Tourney fields for the Muslims) should not be destroyed with the script because another AI faction may re-conquer the settlement and then it could be eligible. The AI is bad at building new buildings so it would be a major setback for the AI development. At the same time, there's no problem with the possession of those buildings by the non-eligible AI factions: they are deprived of the benefits of these building in the capabilities section.
        ; Siege workshops are disbanded because the AI can neither built nor benefit from them.
    
    
        ; Pro memoria: a major restriction of the "destroy" command is that you cannot destroy a building in a single settlement. You can only destroy a building chain in the whole faction.
    
    
        set_event_counter AI_building_destruction 0
    
    
        monitor_event FactionTurnEnd FactionType slave
                inc_event_counter AI_building_destruction 1
    
    
            if I_EventCounter AI_building_destruction > 50
            
                log --- Script start: Destroy AI buildings that prevent something
                
                if I_IsFactionAIControlled spain
    
    
                    log --- spain AI buildings are destroyed
                    destroy_buildings spain autonomy true
                    destroy_buildings spain food_supply true
                    destroy_buildings spain castle_gallows true
                    destroy_buildings spain siege true
                    destroy_buildings spain castle_siege true
                    
                    if I_TurnNumber > 60
                        destroy_buildings spain grasslands true    
                    end_if
    
    
                    if I_TurnNumber > 160
                        destroy_buildings spain chude_building true    
                    end_if
                    
                    log ------ done
                end_if
    
    
    
    
                if I_IsFactionAIControlled france
    
    
                    log --- france AI buildings are destroyed
                    destroy_buildings france autonomy true
                    destroy_buildings france food_supply true
                    destroy_buildings france castle_gallows true
                    destroy_buildings france siege true
                    destroy_buildings france castle_siege true
    
    
                    if I_TurnNumber > 60
                        destroy_buildings france grasslands true    
                    end_if
    
    
                    if I_TurnNumber > 160
                        destroy_buildings france chude_building true    
                    end_if
                    
                    log ------ done
                end_if

  19. #39

    Default Re: Scripts that are or will be in the SSHIP

    Nice invasion scripts! Also you plan to add Almohad invasion for Iberia and moors? This would be pretty flavour and historical for these lands, the Iberian crusaders resisting a new wave of invasion in the Iberian peninsula and the Almoravids being replaced by the most fanatical Almohads.
    Although it would be to find the most ideal way to represent them, perhaps as a simple invasion script but almost as a Mongolian horde or to make the Almohad faction as a horde-type faction from the beginning and the settlements of the Maghreb and Andalusia make them rebels with large armies to make them difficult to conquer (represent the great division and the weakening of the Almoravid separating into small taifa again), but maybe sship developers wants make another ideas...
    THE MORE YOU SWEAT NOW,
    THE LESS YOU BLEED IN BATTLE!!!



    Sign the petition to remove hardcoded limits for M2TW

  20. #40

    Default Re: Scripts that are or will be in the SSHIP

    Are you planning to add judaism and shia/sunni islam as religions like Broken Crescent and Bellum Crucis?

Page 2 of 3 FirstFirst 123 LastLast

Posting Permissions

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