Page 1 of 2 12 LastLast
Results 1 to 20 of 46

Thread: Scripts that are or will be in the SSHIP

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    7,483

    Icon14 Scripts that are or will be in the SSHIP

    Hi Guys,
    In this thread I'd like to present you with the scripts that I am working now or I've been working on in past in the SSHIP. Previous work consisted mainly fixing of the existing scripts, now I'm often adding my own, new scripts. They are crafted with history in mind, as the spirit of the mod is.

    If you feel an urge to change something in your build or to code a minimod, this thread should make it easier for you. Mind that the SSHIP script.txt includes a few instructions for the newbie scripters (the EDCT has even more).

    Structure of the script.txt (as of May 2022) is as follows:
    Code:
    ;===================== CONTENTS ==================================================
    
    ;---- HELP FOR MODERS
    ;-------  Technical advice
    ;-------  Advice on moding this SSHIP script
    ;-------  Ideas for further modding
    
    ;---- TECHNICALITIES for script
    ;------- Reveal everything ( shift + r to trigger)
    ;------- Test trigger ( shift + t to trigger)
    ;------- Show build version and date in the log
    
    ;---- CAMPAIGN SET-UP
    ;------- Difficulty set-up (counters & infos for difficulty, king's purse adjustments)
    ;------- Who's playing current turn
    ;---------- Definitions for eras, leap years, etc.
    ;---------- Beginning of AI turn: zeroing counters, setting AI & difficulties
    ;---------- Beginning of PLAYER turn: zeroing counters, setting player & other counters, aggressivity system decrease
    ;---------- Beginning of EACH FACTION turn: setting counters for faction, religion, culture, size
    ;---------- Whose settlement it is
    ;------- Reveal Known Settlements (at the beginning of a campaign)
    
    ;---- NOTIFICATIONS (pop-out windows)
    ;------- Info depending on difficulty
    ;------- Info depending on religion
    ;------- Factions' initial historical info pop-up
    ;------- Factions close-to-collapse
    ;------- Statistics of the campaign
    
    ;---- AI SUPPORT
    ;------- Destroy AI buildings that prevent AI from funding other buildings
    ;------- Spawn of Armies at the Beginning
    ;------- Spawn of Fleets at the Beginning
    ;------- Scripted Early Sieges with Additional Armies
    ;------- Additional Fleets Throughout The Game
    ;------- Additional General if there're Too Few
    
    ;---- AI FACTION REEMERGENCE SCRIPT   (11000 lines)
    
    ;---- BATTLE RELATED
    ;------- Leader Battle Models
    ;------- G5 BAI STUFF (22000 lines)
    ;------- G5 Looting Script
    
    ;---- ECONOMY
    ;------- Player's treasury size counter & anti-hoarding mechanism (to be used also in other scripts)
    ;------- G5 Faction Economy Script
    ;------- Additional Costs (Change of Capital, Supply, NewNobles, JoinsCrusade)
    ;------- Mercenaries Disband Due to Debts
    
    ;---- INTERNATIONAL AFFAIRS   (5500 lines)
    ;------- Small scripts for diplomacy
    ;------- Player Agressivity Mechanism (turmoil and deterioration of diplo standing after capture of a settlement)
    ;------- Aggressor Tracking Script (if and how many on-going war were inititated by a faction)
    ;------- AI Faction Leader Change Effects (for a weak AI the diplomatic standing is reset)
    
    ;---- FACTION LEADER
    ;------- FL Policies & Counters (EDCT -> counters -> EDB, script & other)    (1700 lines)
    ;------- Change on the throne counters & costs                                (2000 lines)
    ;------- Crowns (ceremony, costs, upkeep)
    ;------- FL Faction Killer (for each faction monitor CeasedFactionLeader)
    ;------- King's Right Hand tracking (Near_Loyalty)
    
    ;---- BUILDINGS
    ;---------- Counters for number of buildings completed
    ;------- REGULAR BUILDINGS
    ;---------- Racing Track
    ;---------- Universities - catholic evolution
    ;---------- Printing Press
    ;------- UNIQUE BUILDINGS (wonders) --- (fires coded for: Holy Sepulchre, Umayyad Mosque, Speyer, Wien, Krakow)
    ;------- HANSA buildings
    ;---------- Hanseatic System
    ;---------- Hansa buildings fires
    ;------- SOUTH ITALY buildings
    ;---------- Al-Idrisi
    ;---------- South Italy Building fires
    ;------- Knight Orders (Recruitment Requirements, Dissolution of the Templars, Hospitaller, Teutonic, Santiago)
    
    ;---- PROVINCES
    ;------- Provinces activated on SettlementSelected
    ;------- Capture of Settlements (change of name, armies spawned, building damaged, counters: _turns_in_our_realm, aggressivity)
    ;---------- List of 199 settlements by region                                (28000 lines)
    ;------- Settlement Situation (unrest due to conquest, occupation, weak leader, player's aggressivity)
    ;---------- Script for each of 199 settlements                               (55000 lines)
    ;------- Civil war after usurpation (Armies & Duration)                     (1800 lines)
    ;------- Rebellions in troublesome regions (spawn of slave armies: Austria)
    ;------- Wars over historically contested provinces (Bohemia, Jutland)
    
    ;---- INVASIONS
    ;------- Scripts common for invasions mechanisms (decrease purse, countdown of counters etc.)
    ;                monitor: PreFactionTurnStart FactionType slave
    ;------- Scotland Mobilizes
    ;------- Bulgarian Uprising (098 deactivated)
    ;------- Eldeguzid invasions of Georgia
    ;------- Turcoman Help for Rum
    ;------- Berber Help for Moors
    ;------- Makurian Help for the Fatimids
    ;------- Steppes Untamed - Nomadic Tribes Help for the Cumans
    ;------- Qara Khitai
    ;------- GOLDEN HORDE (MONGOL INVASIONS)
    
    ;---- FACTIONS' HISTORICAL EVOLUTIONS
    ;---------- Info on spheres of influence (activated on SettlementSelected)
    ;---------- Ostsiedlung event
    ;------- Catholic Factions
    ;---------- HRE Evolution
    ;---------- Poland Evolution
    ;---------- Hungary Evolution
    ;---------- Kingdom of Jerusalem Evolution
    ;---------- Aragon Evolution
    ;---------- France Evolution
    ;---------- England Evolution
    ;---------- Scotland Evolution
    ;---------- Norway Evolution
    ;---------- Denmark Evolution
    ;------- Orthodox Factions
    ;---------- Byzantine Evolutions
    ;---------- Serbia Evolution
    ;---------- Georgia Evolution
    ;---------- Rus Evolution
    ;------- Pagan Factions
    ;---------- Lithuania Evolution
    ;------- Muslim Dynasties
    ;---------- Rum Evolution
    ;---------- Almoravid Evolution
    ;---------- Zengid Evolution
    ;---------- Abbasid Evolution
    ;---------- Fatimid Evolution (Baqt, Fatimid to Ayyubid, Ayyubid to Mamluk)
    
    ;---- CHURCH, ANCILLARIES, PRINCESSES
    ;------- Church Titles
    ;------- Ecumenical Patriarch
    ;------- Great People Ancillaries
    ;------- Noble Lady Spawn Script (3000 lines)
    
    ;---- NATURAL DISASTERS
    ;------- Earthquakes
    ;------- Floods
    
    ;---- INTERACTIVE EVENTS
    ;------- Great Trade Fair
    ;------- Great Tourney
    ;------- Troubadours
    ;------- Great Councils
    ;------- Pirates
    ;------- Financial Support for the Crusaders
    Advice in the script.txt (as of May 2022) for the potential modders:
    Spoiler Alert, click show to read: 
    ; --------- MINIMISE NUMBER of ACTIVE MONITORS ------------;
    ; There're many ingenious scripts coded in the other mods, but they are very likely to interact with scripts already included in the mod.
    ; Or the may just get into collision with the overall gameplay, producing very UNexpected results, from strange behaviour to crashes.
    ; This concerns also the EDCT (traits), the EDA (anciallaries), the EDB (buildings), the DM (mercenaries): many mechanisms there are defined here in the script.
    ; So: DO NOT DELETE anything unless you're 200% sure it will not have any unforeseen side-effects.

    ;------- OPTIMISATION of processing time:
    ; The goal is to shorten the processing time between the turns, so: --------- MINIMISE NUMBER of ACTIVE MONITORS ------------
    ; They are stored in memory and linger there.
    ; Each monitors should be terminated as soon as it is possible. Add terminate to any monitor, just in case something strange happens.
    ; The number of times a monitor get called\tested seems not to matter (eg. several CharacterTurnEnd events with a thousand characters on the map should bog down the turn times, but it don't seem to).
    ; Maybe it'always better to put the conditions that have the least likelyhood at the beginning of a list of conditions in a monitor (because the engine will then just skip the rest of the conditions).

    ;------- Comfort of the players:
    ; - limit the frequency of historical_events notifications by limiting them to the relevant factions or only to the player.

    ;------- Saveguards against crashes:
    ; - always add a randomness to a monitor (eg RandomPercent > 90) so that it would be possible to move from a save even if that monitor would cause a crash
    ; - use < > rather than =

    ;------- COUNTERS
    ; You do not need to declare an event_counter - it always exists in a zero state.
    ; You need to declare a normal counter.
    ; Command "historic_event":
    ; - creates a regular event_counter (if one doesn't already exist) and increments its value by +1.
    ; - obviously, it also displays a scroll (formatted by an entry in descr_event_images.txt with text from historic_events.txt).
    ; - you can interact with this event_counter using set_event_counter, inc_event_counter, or conditions like I_EventCounter.

    ; Negation of a normal counter can be done in two ways:
    ; and not I_CompareCounter ai_ec_id = 21
    ; and I_CompareCounter ai_ec_id ! = 21

    ; (perhaps not true but it was noted before): counter that changes throughout the game (eg. during player's turn is 1, but during AI is 0) should rather be not be used as condition for buildings (in EDB) because it breaks the building queue.

    ;------- CONDITIONS IN MONITORS and in IF CLAUSES

    ; 'If' sections only work correctly with conditions that start with I_, like I_SettlementUnderSiege (basically conditions that do not need trigger requirements, eg do not depend on the export of the event).
    ; In case you want to script that something happens in a Scotland turn: monitor_event FactionTurnStart FactionType scotland
    ; but if you cannot use the monitor, use the clause: if I_EventCounter faction_turn_scotland = 1

    ; Conditions that CANNOT be used in IF-clauses:
    ; --- "Treasury = X" (needs the faction exports) - in the SSHIP special counters for treasury exist - look at the script!
    ; --- "FactionBuildingExists" (needs the faction exports) - but you can use I_SettlementOwner
    ; --- "SettlementBuildingFinished" (needs building exports)

    ;------- AFTER AN EVENT
    ; move_strat_camera - move (sweep like) from the current map view to the location of the event
    ; snap_strat_camera - instant placement of view on the location of the event
    ; position - locator button in a pop-out window
    ; zoom_strat_camera - zooms afterhe move/snap/clicking on the locator button

    ;------- SPECIAL ISSUES

    ; Crusades and Jihads:
    ; - IsCrusade / IsJihad - checks if theres one in progress, works also for other religions
    ; - IsOnJihad - checks if the character has signed up for the jihad
    ; - "monitor_event GeneralJoinCrusade" - applies to joining jihaad as well correctly assumed there is a separate event the same way there is a different condition). In which case the IsCrusade condition does have a function as it makes sure that it is only applicable during a crusade, not a Jihaad (IsJihaad) or both.

    ; Defining time:
    ; and I_TurnNumber > 10
    ; But one may define years of the mod and:
    ; and I_CompareCounter campaign_year > 1110
    ; (it is the way in Titanium)

    ; reveal_tile - reveals armies and whatever else is on the tile and it will continue to reveal that tile for the rest of the campaign unless you issue hide_all_revealed_tiles. Watch out if there's no hide_all_reveal_tiles somewhere else in script which will make armies, fleets, agents, etc. disappear under fog as they're not permanent fixtures on the map.

    ;------------------------------------------------------------------------------------------------------
    ;------- Advice on moding this SSHIP script - counters & mechanisms -----------------------------------
    ;------------------------------------------------------------------------------------------------------

    ;------- CODING WHICH FACTION IS PLAYING -------

    ; The best way to script things dependent on the player and factions:
    ;
    ; monitor_event whatever
    ; if I_EventCounter is_the_player == 1 ; player turn
    ; and I_EventCounter faction_turn_england == 1 ; England turn
    ; and I_EventCounter DifficultyLevel > 2 ; Hard or Very Hard difficulty
    ; do stuff
    ; end_monitor

    ; monitor_event whatever
    ; if I_EventCounter is_the_player == 0 ; AI turn
    ; and I_EventCounter faction_turn_england == 0 ; not England turn
    ; and I_IsFactionAIControlled france ; player is not France
    ; and I_EventCounter DifficultyLevel == 4 ; Very Hard difficulty
    ; do stuff
    ; end_monitor

    ;------- Who's turn: player, AI, faction (these are counters from the previous verison of the sship, somehow redundant)

    ; At the beginning of each faction turn start the following is defined:
    ; is_the_ai 0 = PLAYER TURN (used in the "Unrest Surges in Certain Major Cities" script)
    ; is_the_ai 1,2,3,4 = AI TURN: difficulties E/M/H/VH (used in the "Unrest Surges in Certain Major Cities" script, used in EDB to provide AI with bonuses depending on the difficulty level)

    ; is_the_player 1 = PLAYER TURN (used in the EDB for unit recruitment and for few building benefits)
    ; is_the_player 0 = AI TURN (used neither in the EDB nor in 097 script)

    ; ai_ec_id : = WHICH FACTION IS CURRENTLY PLAYING: 0=Local player, 1=rebels, 2=venice etc (used in Faction Economy script)
    ; pl_ec_id : = WHICH FACTION THE PLAYER IS: 2 = venice etc (used in Rebellion script)

    ; 1 slave, 2 venice, 3 sicily, 4 abbasid, 5 papal_states, 6 denmark, 7 egypt, 8 scotland, 9 cumans, 10 mongols, 11 turks,
    ; 12 france, 13 hre, 14 england, 15 portugal, 16 poland, 17 byzantium, 18 moors, 19 russia, 20 spain, 21 hungary, 22 aragon,
    ; 23 lithuania, 24 kievan_rus, 25 serbia, 26 georgia, 27 norway, 28 jerusalem, 29 zengid, 30 pisa, 31 rum

    ;------- Size of settlements
    ; there're 4 sizes defined (small: 1-3, medium 4-9, large 10-19, huge 20-50), each turn the counters are known:
    ; how bit the current faction is, and what was the size of each faction at the last beginning of its turn
    ; see here:

    ;------- THE SETTLEMENTS ----------------------------------------------------------------
    ; Have a look at the explanations at the beginning of the relevant section.
    ; In particular, any script aiming at provoking the unrest (turmoil) should do it through increasing a special SSHIP counter, not a direct command ("add_settlement_turmoil").
    ; This is because every console command "add_settlement_turmoil" replaces the previous unrest and new scripts often end up in lowering the current one.

    ;------- SPAWN OF AN ARMY ----------------------------------------------------------------
    ; if you add the same units in a spawned army, try to provide significant differences (with experience levels) between them
    ; so that it would be more entertaining for the player in fight (he needs to pay attention which unit he's fighting)
    ; eg.
    ; unit Macemen exp 7 armour 0 weapon_lvl 0
    ; unit Macemen exp 0 armour 0 weapon_lvl 0
    ; unit Crossbow Militia exp 7 armour 0 weapon_lvl 0
    ; unit Crossbow Militia exp 0 armour 0 weapon_lvl 0

    ; Name of a general:
    ; - if the army spawned is a faction - use "random_name"
    ; - if the army is slave then provide a name from the slave list (not another!)
    ; (sub_faction tag doesn't work in campaign_script so leaving "random_name" produces a nameless general)
    ; - you don't need to give him Bodyguard unit - any unit will do (although too weak will be replaced by a better, if such is in the army)

    ;------- Aggressor
    ; AGGRESSOR: to be analysed how do the links to EDCT work with
    ; aggressor 1 - faction is currently engaged in a war it has started.
    ; aggaragon 1 - it is Aragon that is the aggressor

    ; monitor_event CharacterTurnStart Trait Aggressor_Aragon > 0
    ; set_event_counter aggressor 1
    ; end_monitor

    ; monitor_event FactionWarDeclared TargetFactionType aragon
    ; set_event_counter aggaragon 1
    ; end_monitor

    ;------- Size of the players' treasury:
    ; player_treasury - see script for it, it is meant to be used in other scripts
    Last edited by Jurand of Cracow; May 29, 2022 at 06:34 AM.
    Mod leader of the SSHIP: traits, ancillaries, scripts, buildings, geography, economy.
    ..............................................................................................................................................................................
    If you want to play a historical mod in the medieval setting the best are:
    Stainless Steel Historical Improvement Project and Broken Crescent.
    Recently, Tsardoms and TGC look also very good. Read my opinions on the other mods here.
    ..............................................................................................................................................................................
    Reviews of the mods (all made in 2018): SSHIP, Wrath of the Norsemen, Broken Crescent.
    Follow home rules for playing a game without exploiting the M2TW engine deficiencies.
    Hints for Medieval 2 moders: forts, merchants, AT-NGB bug, trade fleets.
    Thrones of Britannia: review, opinion on the battles, ideas for modding. Shieldwall is promising!
    Dominant strategy in Rome2, Attila, ToB and Troy: “Sniping groups of armies”. Still there, alas!

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

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

    Let us start with the Noble Ladies script. This was done, fixed and actually tested over this year, I hope it fully works now. I'm actually interested if the players find the number of the princesses on the map right.

    Code:
    ;======================================================================================================
    ;------- Noble Lady Spawn Script
    ;======================================================================================================
    ; first version VineFynn 2019, re-coded by JoC 2020
    
    ; What does it do:
    ; starting in 1157 (turn 50) it provides each faction with a princess (called noble lady) every generation (slightly more than 20 years)
    ; the goal is to make the princesses an important part of the game (as wifes, tools of diplomacy, diplomats themselves) - without this script the "natural born" princesses would appear very rarely due to the fact that in most cases the new FL would ascend to the throne after his chilren had came of age
    
    
    ; Possible further modding:
    ; the whole section can be deleted without any impact on the other parts of the game, if one doesn't like it;
    ; a submod "Royal Ladies of the Court" could be implemented to make a part of the game for the player (but it's not advised: it would be very processing-power consuming);
    ; another option is to have Yes/No proposal for the player - against a payment (but Bloodlines and names might make the script long!)
    ; until this happens all "I_IsFactionAIControlled" are omitted in the script - thus the player also gets a princess from the script.
    
    set_event_counter spainlady 1
    ...
    
    ; princess spawn is stochastic below, and one may adjust when they start being spawned
    ; and also often they're spawned (100 - every 15 years, 50 - every 28 years)
    ; groups are made so that princesses from the same region have different delays
    
    monitor_event PreFactionTurnStart I_TurnNumber > 50
        and FactionType slave
    
        if RandomPercent < 66
            inc_event_counter spainlady 1
            ...
        end_if
    
        if I_EventCounter spainlady > 28
            ;            and I_IsFactionAIControlled spain
    
            if I_SettlementOwner Leon = spain
                and RandomPercent < 5
    
                spawn_character spain Blanca, princess, age 19, x 37, y 152           ; Charm 4
                console_command give_trait "Blanca" IAmPrincess 2
                console_command give_trait "Blanca" Princess_Royal_Blood_Spanish 1
                console_command give_trait "Blanca" PrettyWoman 1
                console_command give_trait "Blanca" HumbleWoman 1
                console_command give_trait "Blanca" SpiritedWoman 1
    
                set_event_counter spainlady 0
    
            end_if
    
            if I_EventCounter spainlady > 28
                and I_SettlementOwner Santiago = spain
                and RandomPercent < 5
    
                spawn_character spain Isabel, princess, age 19, x 14, y 155           ; Charm 3
                console_command give_trait "Isabel" IAmPrincess 2
                console_command give_trait "Isabel" Princess_Royal_Blood_Spanish 1
                console_command give_trait "Isabel" PrettyWoman 1
                console_command give_trait "Isabel" GoodPrincess 1
    
                set_event_counter spainlady 0
    
            end_if
    
            if I_EventCounter spainlady > 28
                and I_SettlementOwner Leon = spain
                and RandomPercent < 5
    
                spawn_character spain Sancha, princess, age 19, x 37, y 152           ; Charm 1
                console_command give_trait "Sancha" IAmPrincess 2
                console_command give_trait "Sancha" Princess_Royal_Blood_Spanish 1
                console_command give_trait "Sancha" PrettyWoman 1
                console_command give_trait "Sancha" PretentiousWoman 1
    
                set_event_counter spainlady 0
    
            end_if
    
    
            if I_EventCounter spainlady > 28
                and I_SettlementOwner Santiago = spain
                and RandomPercent < 5
    
                spawn_character spain Jimena, princess, age 19, x 14, y 155            ; Charm 2
                console_command give_trait "Jimena" IAmPrincess 2
                console_command give_trait "Jimena" Princess_Royal_Blood_Spanish 1
                console_command give_trait "Jimena" BigotWoman 1
                console_command give_trait "Jimena" HumbleWoman 1
                console_command give_trait "Jimena" FaithfulWoman 1
    
                set_event_counter spainlady 0
    
            end_if
    
            if I_EventCounter spainlady > 28
                and I_SettlementOwner Leon = spain
                and RandomPercent < 5
    
                spawn_character spain Ana, princess, age 19, x 37, y 152            ; Charm 5
                console_command give_trait "Ana" IAmPrincess 2
                console_command give_trait "Ana" Princess_Royal_Blood_Spanish 1
                console_command give_trait "Ana" PrettyWoman 1
                console_command give_trait "Ana" HumbleWoman 1
                console_command give_trait "Ana" SpiritedWoman 1
                console_command give_trait "Ana" UnchasteWoman 1
    
                historic_event noble_lady_spawn_spain
                set_event_counter spainlady 0
    
            end_if
    
    
            if I_EventCounter spainlady > 28
                and I_SettlementOwner Santiago = spain
                and RandomPercent < 5
    
                spawn_character spain Inmaculada, princess, age 19, x 14, y 155           ; Charm 6
                console_command give_trait "Inmaculada" IAmPrincess 2
                console_command give_trait "Inmaculada" Princess_Royal_Blood_Spanish 1
                console_command give_trait "Inmaculada" PrettyWoman 1
                console_command give_trait "Inmaculada" TolerantWoman 1
                console_command give_trait "Inmaculada" SpiritedWoman 1
                console_command give_trait "Inmaculada" FaithfulWoman 1
                console_command give_trait "Inmaculada" FairWoman 1
    
                historic_event noble_lady_spawn_spain
                set_event_counter spainlady 0
    
            end_if
        end_if
    ...
    Last edited by Jurand of Cracow; May 29, 2022 at 06:39 AM.

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

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

    This fires only at the beginning of the game and will be improved in the future. The problems from the previous versions of the SSHIP (Santiago not revealed etc.) are fixed, I hope.
    You may always provide bits of the script you think should be there, I'd include them (after scrutiny ;-)

    Code:
        ;========================================================================================================
        ;------- City Initial Reveal
        ;========================================================================================================
        ; it is only for the player because the AI can always see all the settlements and ports
        ; the cities should be revealed on the basis of both historicity (actually, many should be) and gameplay (many shouldn't be so that exploration the map is a part of the game)
        ;
        ; this script should be reviewed faction-by-faction in the future
        
         monitor_event FactionTurnStart FactionIsLocal 
    
    
            if I_EventCounter faction_turn_spain = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
            end_if 
    
    
            if I_EventCounter faction_turn_france = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
            end_if 
    
    
            if I_EventCounter faction_turn_portugal = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
            end_if 
    
    
            if I_EventCounter faction_turn_aragon = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
            end_if 
    
    
            if I_EventCounter faction_turn_hre = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
                reveal_tile 168,173    ;    Venice        
                reveal_tile 181,206    ;    Prague
                reveal_tile 170,222    ;    Brandenburg
                reveal_tile 224,208    ;    Krakow
                reveal_tile 198,222    ;    Poznan
            end_if 
    
    
            if I_EventCounter faction_turn_england = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
            end_if 
    
    
            if I_EventCounter faction_turn_scotland = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
            end_if 
    
    
            if I_EventCounter faction_turn_denmark = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
                reveal_tile 224,208    ;    Krakow            
            end_if 
    
    
            if I_EventCounter faction_turn_norway = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
            end_if 
    
    
            if I_EventCounter faction_turn_poland = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
                reveal_tile 181,206    ;    Prague
            end_if 
    
    
            if I_EventCounter faction_turn_hungary = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
                reveal_tile 168,173    ;    Venice        
                reveal_tile 181,206    ;    Prague
                reveal_tile 224,208    ;    Krakow            
            end_if 
    
    
            if I_EventCounter faction_turn_venice = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
                reveal_tile 302,61    ;     Cairo
            end_if 
    
    
            if I_EventCounter faction_turn_sicily = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
                reveal_tile 168,173    ;    Venice   
                reveal_tile 302,61    ;     Cairo
            end_if 
    
    
            if I_EventCounter faction_turn_pisa = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
                reveal_tile 168,173    ;    Venice   
                reveal_tile 302,61    ;     Cairo
            end_if 
    
    
            if I_EventCounter faction_turn_abbasid = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 416,94    ;     Baghdad
                reveal_tile 302,61    ;     Cairo
                reveal_tile 364,1    ;     Mecca
            end_if 
    
    
            if I_EventCounter faction_turn_byzantium = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
                reveal_tile 168,173    ;    Venice   
                reveal_tile 302,61    ;     Cairo
            end_if 
    
    
            if I_EventCounter faction_turn_kievan_rus = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 224,208    ;    Krakow
            end_if 
    
    
            if I_EventCounter faction_turn_russia = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
            end_if 
    
    
            if I_EventCounter faction_turn_serbia = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
            end_if 
    
    
            if I_EventCounter faction_turn_georgia = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 416,94    ;     Baghdad
            end_if 
    
    
            if I_EventCounter faction_turn_lithuania = 1
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 224,208    ;    Krakow
            end_if 
    
    
            if I_EventCounter faction_turn_moors = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 416,94    ;     Baghdad
                reveal_tile 302,61    ;     Cairo
                reveal_tile 364,1    ;     Mecca
            end_if 
    
    
            if I_EventCounter faction_turn_rum = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 416,94    ;     Baghdad
                reveal_tile 302,61    ;     Cairo
                reveal_tile 364,1    ;     Mecca
            end_if 
    
    
            if I_EventCounter faction_turn_turks = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 416,94    ;     Baghdad
                reveal_tile 302,61    ;     Cairo
                reveal_tile 364,1    ;     Mecca
            end_if 
    
    
            if I_EventCounter faction_turn_egypt = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 416,94    ;     Baghdad
                reveal_tile 302,61    ;     Cairo
                reveal_tile 364,1    ;     Mecca
            end_if 
    
    
            if I_EventCounter faction_turn_zengid = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 416,94    ;     Baghdad
                reveal_tile 302,61    ;     Cairo
                reveal_tile 364,1    ;     Mecca
            end_if 
    
    
            if I_EventCounter faction_turn_jerusalem = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 169,146    ;     Rome
                reveal_tile 14,155    ;     Santiago de Compostela
                reveal_tile 168,173    ;    Venice   
                reveal_tile 302,61    ;     Cairo
            end_if 
    
    
            if I_EventCounter faction_turn_mongols = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
                reveal_tile 416,94    ;     Baghdad
            end_if 
    
    
            if I_EventCounter faction_turn_cumans = 1
                reveal_tile 330,74    ;    Jerusalem
                reveal_tile 284,142    ;    Constantinople
            end_if 
    
    
            hide_all_revealed_tiles
            terminate_monitor
        end_monitor
    Last edited by Jurand of Cracow; November 28, 2020 at 11:09 AM.

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

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

    EDIT: Mind that this script has been integrated with DIP.


    ---------------------

    The first script is pertinent to Jerusalem. As you see, it changes its name and present a movie. For some other cities there're also movies, as below.
    Actually, I'd be very happy if somebody would produce movies (.bik) for the other cities - this would spice up the game.

    Code:
        ;====================================================================================================== JERUSALEM
        ;------- Jerusalem ---------------------------------------------------------------------------------
    
        declare_counter Jerusalem_christian
        declare_counter Jerusalem_islam
        declare_counter Jerusalem_pagan
        set_counter Jerusalem_christian 0
        set_counter Jerusalem_islam 0
        set_counter Jerusalem_pagan 0
    
        monitor_event GeneralCaptureSettlement SettlementName Jerusalem
        
            if FactionReligion catholic
            and I_CompareCounter Jerusalem_christian = 0
    
                change_settlement_name Jerusalem Jerusalem
                historic_event jerusalem_christian event/Christians_Capture_Jerusalem.bik
                set_counter Jerusalem_christian 1
                set_counter Jerusalem_islam 0
                set_counter Jerusalem_pagan 0
            end_if    
    
            if FactionReligion orthodox
            and I_CompareCounter Jerusalem_christian = 0
    
                change_settlement_name Jerusalem Hierosolyma
                historic_event jerusalem_christian event/Christians_Capture_Jerusalem.bik
                set_counter Jerusalem_christian 1
                set_counter Jerusalem_islam 0
                set_counter Jerusalem_pagan 0
            end_if
               
            if FactionReligion islam
            and I_CompareCounter Jerusalem_islam = 0
    
                change_settlement_name Jerusalem al_Quds
                historic_event jerusalem_muslim event/Muslims_Capture_Jerusalem.bik
                set_counter Jerusalem_islam 1
                set_counter Jerusalem_christian 0
                set_counter Jerusalem_pagan 0
            end_if
    
            if FactionReligion pagan
            and I_CompareCounter Jerusalem_pagan = 0
    
                historic_event jerusalem_pagan
                set_counter Jerusalem_pagan 1
                set_counter Jerusalem_islam 0
                set_counter Jerusalem_christian 0
            end_if
        end_monitor
    Constantinople gets a similar script (and in the next SSHIP will get also the movies), but no specific text yet (Georgios, maybe you'd volunteer to write them?)
    Code:
    ;====================================================================================================== CONSTANTINOPLE  in the future make specific text for the event
    
        monitor_event GeneralCaptureSettlement SettlementName Constantinople
    
    
            if FactionReligion orthodox
            and not FactionType russia
            and not FactionType kievan_rus        
                change_settlement_name Constantinople Constantinople    
            end_if
    
    
            if FactionType russia
                change_settlement_name Constantinople ConstantinopleRus
                if I_EventCounter is_the_player = 1 
                    historic_event SETTLEMENT_NAME_CHANGE
                end_if            
            end_if
    
    
            if FactionType kievan_rus
                change_settlement_name Constantinople ConstantinopleRus
                if I_EventCounter is_the_player = 1 
                    historic_event SETTLEMENT_NAME_CHANGE
                end_if            
            end_if
    
    
            if FactionReligion catholic    
                change_settlement_name Constantinople Constantinople    
            end_if
            
            if FactionReligion islam
            and not FactionType turks        
            and not FactionType rum        
                change_settlement_name Constantinople ConstantinopleArabic
                if I_EventCounter is_the_player = 1 
                    historic_event SETTLEMENT_NAME_CHANGE event/Constantinople_captured_by_muslims.bik
                end_if    
            end_if
    
    
            if FactionType turks
                change_settlement_name Constantinople ConstantinopleTurkic
                if I_EventCounter is_the_player = 1 
                    historic_event SETTLEMENT_NAME_CHANGE event/Constantinople_captured_by_muslims.bik
                end_if            
            end_if
    
    
            if FactionType rum
                change_settlement_name Constantinople ConstantinopleTurkic
                if I_EventCounter is_the_player = 1 
                    historic_event SETTLEMENT_NAME_CHANGE event/Constantinople_captured_by_muslims.bik
                end_if            
            end_if
    
    
            if FactionType cumans
                change_settlement_name Constantinople ConstantinopleTurkic
                if I_EventCounter is_the_player = 1 
                    historic_event SETTLEMENT_NAME_CHANGE
                end_if            
            end_if
    
    
            if FactionType mongols
                change_settlement_name Constantinople ConstantinopleTurkic
                if I_EventCounter is_the_player = 1 
                    historic_event SETTLEMENT_NAME_CHANGE
                end_if            
            end_if
            
        end_monitor

    Some other cities also get similar scripts, but they're not shown to every faction and they're limited - just change of the name and a pop-out window. For certain cities something more, like for Krakow.

    Code:
        ;====================================================================================================== BALTICS
        ;------- Baltics -----------------------------------------------------------------------------------
    
    
        ;------------------------------------------------------------------------------  TURKU
    
    
    
    
        monitor_event GeneralCaptureSettlement SettlementName Turku
    
    
            if FactionReligion catholic
                change_settlement_name Turku Abo
                
                if I_EventCounter is_the_player = 1 
                    historic_event SETTLEMENT_NAME_CHANGE
                end_if
            end_if
        
            if not FactionReligion catholic 
                change_settlement_name Turku Turku
            end_if
            
        end_monitor
    
    ...
    
        ;------------------------------------------------------------------------------  KRAKOW
        monitor_event GeneralCaptureSettlement SettlementName Krakow
    
    
            if FactionType poland
                change_settlement_name Krakow Krakow
                historic_event CONQUERED_KRAKOW_PL  factions { poland, hre, france, england, norway, denmark, hungary, lithuania, kievan_rus, russia, cumans, }
            end_if
    
    
            if  FactionType hre
                change_settlement_name Krakow Krakau
                historic_event CONQUERED_KRAKOW  factions { poland, hre, france, england, norway, denmark, hungary, lithuania, kievan_rus, russia, cumans, }
            end_if
             
            if not FactionType slave
            and not FactionType poland
            and not FactionType hre        
                change_settlement_name Krakow Krakow
                historic_event CONQUERED_KRAKOW  factions { poland, hre, france, england, norway, denmark, hungary, lithuania, kievan_rus, russia, cumans, }
            end_if
         
            if I_EventCounter is_the_player = 1 
            and RandomPercent < 66
            and I_EventCounter is_the_ai > 2
                console_command set_building_health Krakow hinterland_roads 60
            end_if    
            
        end_monitor
    Code:
    ;------------------------------------------------------------------------------ MECCA in the future make specific text for the event
    
    
        monitor_event GeneralCaptureSettlement SettlementName Mecca
    
    
            if FactionReligion orthodox
                change_settlement_name Mecca MeccaLatin
                if I_EventCounter is_the_player = 1 
                    historic_event SETTLEMENT_NAME_CHANGE
                end_if    
            end_if
    
    
            if FactionReligion catholic    
                change_settlement_name Mecca MeccaLatin
                if I_EventCounter is_the_player = 1 
                    historic_event SETTLEMENT_NAME_CHANGE event/Mecca_captured_by_christians.bik
                end_if    
            end_if
            
            if FactionReligion islam
                change_settlement_name Mecca Mecca
            end_if
            
        end_monitor
    
    
    ;------------------------------------------------------------------------------ CAIRO in the future make specific text for the event
    
    
        monitor_event GeneralCaptureSettlement SettlementName Cairo
    
    
            if FactionReligion orthodox
                change_settlement_name Cairo CairoLatin
                if I_EventCounter is_the_player = 1 
                    historic_event SETTLEMENT_NAME_CHANGE
                end_if
            end_if
    
    
            if FactionReligion catholic    
                change_settlement_name Cairo CairoLatin
                if I_EventCounter is_the_player = 1 
                    historic_event SETTLEMENT_NAME_CHANGE event/Cairo_captured_by_christians.bik
                end_if    
            end_if
            
            if FactionReligion islam
                change_settlement_name Cairo Cairo
            end_if
            
        end_monitor    
    
    
    ;------------------------------------------------------------------------------ BAGHDAD in the future make specific text for the event
    
    
        monitor_event GeneralCaptureSettlement SettlementName Baghdad
    
    
            if FactionReligion orthodox
                change_settlement_name Baghdad Baghdad
            end_if
    
    
            if FactionReligion catholic    
                change_settlement_name Baghdad Baghdad
            end_if
            
            if FactionReligion islam
            and not FactionType turks    
                change_settlement_name Baghdad Baghdad
            end_if
    
    
            if FactionType turks    
                change_settlement_name Baghdad Baghdad
                if I_EventCounter is_the_player = 1 
                    historic_event SETTLEMENT_NAME_CHANGE event/Baghdad_captured_by_seljuks.bik
                end_if                
            end_if
            
        end_monitor
    Last edited by Jurand of Cracow; May 29, 2022 at 06:43 AM.

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

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

    This one you probably know well ;-)

    Code:
        ;======================================================================================================
        ;------- Mercenaries Disband Due to Debts
        ;======================================================================================================
        ; player gets a warning 1 turn before disbandment
        ; all units with attribute "mercenary_unit" will be disbanded - even the factional units
        ;
        ; at some point it's worth to code also cool off period for "mercenaries_disband", as it is for "debt_warning"
    
    
    
    
        ;----------------- (0) overall debt warning
    
    
        set_event_counter debt_warning 5
    
    
        monitor_event PreFactionTurnStart not IsFactionAIControlled
            and Treasury < 1000
            and Treasury > 0
            and I_EventCounter debt_warning > 4
    
    
            historic_event warning_debt
            set_event_counter debt_warning 0
    
    
        end_monitor
    
    
        monitor_event PreFactionTurnStart not IsFactionAIControlled
            and I_EventCounter debt_warning < 5
    
    
            inc_event_counter debt_warning 1
    
    
        end_monitor
    
    
        ;----------------- (I) player recovered from debt
    
    
        monitor_event PreFactionTurnStart not IsFactionAIControlled
            and Treasury > 0
    
    
            if I_CompareCounter pl_ec_id = 2
                set_event_counter venice_mercenary_warning 0
            end_if
    ...
    
    
        end_monitor
    
    
        ;----------------- (II) player was in debt and mercenaries go now
    
    
        monitor_event PreFactionTurnStart not IsFactionAIControlled
            and Treasury < -500
    
    
            if I_CompareCounter pl_ec_id = 2
                and I_EventCounter venice_mercenary_warning = 1
                destroy_units venice, mercenary_unit
                historic_event mercenaries_disband
            end_if
    ...
    
    
            ;----------------- (III) player is in debt for the first turn and gets a warning
    
    
            if I_CompareCounter pl_ec_id = 2
                and I_EventCounter venice_mercenary_warning = 0
                inc_event_counter venice_mercenary_warning 1
                historic_event mercenaries_complain
            end_if
    ...
    
    
        end_monitor
    Last edited by Jurand of Cracow; November 28, 2020 at 11:15 AM.

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

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

    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

  7. #7

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

    is it possible to have rebels spawning because of either king's low authority / having ennemies on your soil / beeing in debt ?
    I think it would be cool and historical. Could represent the warbands of routiers in western europe for example
    I

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

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

    Quote Originally Posted by lequintal69 View Post
    is it possible to have rebels spawning because of either king's low authority / having ennemies on your soil / beeing in debt ?
    I think it would be cool and historical. Could represent the warbands of routiers in western europe for example
    I
    Perhaps possible. However, at this very moment nobody deals with the rebel spawn. JLMP had it in mind, iirc. Lusitanio would perhaps know.

  9. #9
    Lusitanio's Avatar Campidoctor
    Join Date
    Jan 2018
    Location
    Portugal
    Posts
    1,530

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

    Quote Originally Posted by Jurand of Cracow View Post
    Perhaps possible. However, at this very moment nobody deals with the rebel spawn. JLMP had it in mind, iirc. Lusitanio would perhaps know.
    It would be possible using the king authority (I_FactionLeaderAttribute), any trait that the king might have (I_FactionLeaderTrait), being in debt would work too by just using the condition and Treasury < 0. There are also other interesting conditions, like the taxes on a certain city and the happiness level.

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

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

    Quote Originally Posted by lequintal69 View Post
    is it possible to have rebels spawning because of either king's low authority / having ennemies on your soil / beeing in debt ?
    I think it would be cool and historical. Could represent the warbands of routiers in western europe for example
    I
    Mount and Blade flashbacks , imagine stacks of Sea Raiders roaming around the countryside. Would be a good addition for immersion.

  11. #11

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

    Quote Originally Posted by Nemesis2345 View Post
    Mount and Blade flashbacks, imagine stacks of Sea Raiders roaming around the countryside. Would be a good addition for immersion.
    Perhaps "Sea Riders" stacks (not many units) could spawn in Scotland and Northern England coast, I don't know if it'd be possible to make script remove them after some turns, but if so, I think they would be fitting for 12th century, so they'd make devastation, but you could send nobles with their Knight BG to hunt them down optionally, disable if Norway falls. (For northeast coast in 13th century I'd rather see a full-blown historical naval invasion like in the Britannia Kingdoms campaign (I think it was the Haakon IV invasion of 1263).

    I think it would be great for young FM considering the state of the traits. I'd rather have bigger stacks, as uprisings for high tax, many levy units under a minor noble, or a high probability that if mercenaries dont get paid and they're enough (like 6+), they start pillaging the countryside (Trigger in own lands) as a Rebel stack (high devastation).

    Maybe even mix It and have a Rebel captain with a merc. Unit and maybe other mercenary units but less (say 3+ units, including his) join with the commoners and all pillage.

    It'd be great if they would look for your undefended settlements also (specially cities) and sack them and keep going.

    I've written plenty recently, but they're just ideas I get when I read your discussions, please feel free to ignore, pick something, or change whatever.
    Last edited by removeduser_28376423423; November 29, 2020 at 01:07 PM.

  12. #12

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

    ...


  13. #13

    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?

  14. #14

    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.

  15. #15

    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"

  16. #16

    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

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

    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.

  18. #18

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

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

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

    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.

  20. #20

    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.

Page 1 of 2 12 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
  •