Page 2 of 5 FirstFirst 12345 LastLast
Results 21 to 40 of 92

Thread: Campaign Script Optimizations

  1. #21

    Default Re: Campaign Script Optimizations

    So "monitor_event FactionTurnStart FactionType slave" is better then?, hehe I accidentally did it that way xD as I was using a software that can edit both campaign scripts simultaenously

  2. #22

    Default Re: Campaign Script Optimizations

    It was a mistake of mine; whatever we "gain" at the start of the availability of the ancillary, we lose it at the end of the availability. So it is no better than the other way (just keep it at FactionTurnStart and don't tell it to anyone )

  3. #23

    Default Re: Campaign Script Optimizations

    Another one of the "easy" stuff, this time for the section "Setup Events". I_LocalFaction conditions are checked only if the DifficultyLevel is the appropriate.

    Early campaign:
    Spoiler Alert, click show to read: 
    Code:
    ;==================== Setup Events ======================
    monitor_event PreFactionTurnStart FactionIsLocal
    
    if I_EventCounter DifficultyLevel >= 3
    
        if I_LocalFaction england
            console_command give_trait "William Plantagenet" HarshRuler 2
            console_command give_trait england4william Arse 1
            console_command give_trait england4william PublicAtheism 1
            console_command give_trait england4william Feck 1
            console_command give_trait "Gregory Darnley" Embezzler 1
            console_command give_trait "Gregory Darnley" Corrupt 1
        end_if
    
        if I_LocalFaction france
            console_command give_trait "Raoul de_Blois" DiscontentGeneral 1
            console_command give_trait "Guillaume de_Clermont" DiscontentGeneral 1
            console_command give_trait "Gaston d_Aquitaine" DiscontentGeneral 1
        end_if
    
        if I_LocalFaction hre
            console_command give_trait "Heinrich von_Hohenstaufen" Offensive_To_Nobles 1
            console_command give_trait "Heinrich von_Hohenstaufen" PublicAtheism 1
            console_command give_trait hre4heinrich DiscontentGeneral 1
            console_command diplomatic_stance hre venice neutral
            console_command diplomatic_stance hre milan neutral
        end_if
    
        if I_LocalFaction spain
            console_command diplomatic_stance spain portugal neutral
        end_if
    
        if I_LocalFaction venice
            console_command diplomatic_stance venice papal_states neutral
            console_command diplomatic_stance venice hre neutral
        end_if
    
        if I_LocalFaction sicily
            console_command diplomatic_stance sicily papal_states neutral
        end_if
    
        if I_LocalFaction milan
            console_command diplomatic_stance milan papal_states neutral
            console_command diplomatic_stance milan hre neutral
        end_if
    
        if I_LocalFaction russia
            console_command diplomatic_stance russia kievan_rus neutral
        end_if
    
        if I_LocalFaction portugal
            console_command diplomatic_stance portugal spain neutral
        end_if
    
        if I_LocalFaction kievan_rus
            console_command diplomatic_stance kievan_rus russia neutral
        end_if
    
        if I_LocalFaction kwarezm
            console_command give_trait "Qudbaddin Mohammed" Paranoia 1
        end_if
    
    end_if
    
        terminate_monitor
    end_monitor
    
    ;==================== City Reveal =======================

    Late campaign: Double FactionIsLocal condition was removed. The if about venice was also removed, as it contained nothing!
    Spoiler Alert, click show to read: 
    Code:
    ;==================== Setup Events ======================
    ;-- Mongol invasion
    monitor_event FactionTurnStart FactionIsLocal
        historic_event mongols_invasion_warn factions { england , france , hre , denmark , spain , aragon , portugal , milan , venice , sicily , norway , scotland , cumans , byzantium , russia , moors , turks , egypt , poland , hungary , lithuania , kievan_rus , teutonic_order , jerusalem , }
        historic_event mongols_invasion_warn_mongols factions { mongols , }
        historic_event mongols_invasion_warn_kwarezm factions { kwarezm , }
        set_event_counter mongols_invasion_warn 1
    terminate_monitor
    end_monitor
    
    monitor_event FactionTurnStart FactionIsLocal 
        and I_TurnNumber = 2
        historic_event the_mongols_emerge event/mongols_invade.bik factions { england , france , hre , denmark , spain , aragon , portugal , milan , venice , sicily , norway , scotland , cumans , byzantium , russia , moors , turks , egypt , poland , hungary , lithuania , kievan_rus , teutonic_order , jerusalem , }
    terminate_monitor
    end_monitor
    
    monitor_event PreFactionTurnStart FactionIsLocal
    
    if I_EventCounter DifficultyLevel >= 3
    
        if I_LocalFaction hre
            console_command give_trait "Frederick von_Hohenstaufen" Offensive_To_Nobles 1
            console_command diplomatic_stance hre papal_states war
        end_if
    
        if I_LocalFaction byzantium
            console_command diplomatic_stance byzantium venice war
            console_command diplomatic_stance byzantium turks war
        end_if
    
        if I_LocalFaction moors
            console_command diplomatic_stance moors spain war
            console_command diplomatic_stance moors aragon war
            console_command diplomatic_stance moors portugal war
        end_if
    
        if I_LocalFaction turks
            console_command diplomatic_stance turks byzantium war
        end_if
    
        if I_LocalFaction lithuania
            console_command diplomatic_stance teutonic_order lithuania war
        end_if
    
        if I_LocalFaction teutonic_order
            console_command diplomatic_stance teutonic_order lithuania war
        end_if
    
    end_if
    
        terminate_monitor
    end_monitor
    
    ;==================== City Reveal =======================


    A note: Everything I have post in this thread is for SS v6.4.

  4. #24

    Default Re: Campaign Script Optimizations

    That part needs some clean up/tweaking as well...as it's targeting characters that dont exist, so i'll replace names with labels and tweak descr_start to include such labels

  5. #25

    Default Re: Campaign Script Optimizations

    Quote Originally Posted by Melooo182 View Post
    That part needs some clean up/tweaking as well...as it's targeting characters that dont exist, so i'll replace names with labels and tweak descr_start to include such labels


    Some minor fixes in the "Major Events" section:

    Major Events --Jerusalem Captured: Tweaked for no counters and less monitors, that terminate when they should.
    Spoiler Alert, click show to read: 
    Code:
    ;--- Jerusalem Captured
    monitor_event GeneralCaptureSettlement SettlementName Jerusalem
        and not CharacterReligion islam
        and not CharacterReligion pagan
        and not CharacterReligion heretic
    
        historic_event jerusalem_christian event/Christians_Capture_Jerusalem.bik
    terminate_monitor
    end_monitor
    
    monitor_event GeneralCaptureSettlement SettlementName Jerusalem
        and CharacterReligion islam
    
        historic_event jerusalem_muslim event/Muslims_Capture_Jerusalem.bik
    terminate_monitor
    end_monitor
    
    monitor_event GeneralCaptureSettlement SettlementName Jerusalem
        and CharacterReligion pagan
        and not FactionIsLocal
    
        historic_event jerusalem_pagan
    terminate_monitor
    end_monitor
    
    ;--- World is round


    Major Events -- Capital Change: Only one monitor instead of two. Monitor terminates when it has nothing to do (that is, if campaign difficulty is easy).
    Spoiler Alert, click show to read: 
    Code:
    ;-- Capital Change
    monitor_event FactionNewCapital FactionIsLocal
    
        if I_EventCounter DifficultyLevel = 1
            terminate_monitor
        end_if
    
        if not I_HotseatEnabled
            historic_event capital_change
        end_if
    
        if I_EventCounter DifficultyLevel = 2
            console_command add_money -2000
        end_if
    
        if I_EventCounter DifficultyLevel > 2
            console_command add_money -5000
        end_if
    
    end_monitor
    
    ;================= Player Notification ==================

  6. #26

    Default Re: Campaign Script Optimizations

    while we are at it, i think jerusalem captured by christians should have the requirement that is no longer held by crusaders
    Code:
    ;--- Jerusalem Captured
    monitor_event GeneralCaptureSettlement SettlementName Jerusalem
        and not CharacterReligion islam
        and not CharacterReligion pagan
        and not CharacterReligion heretic
        and not I_SettlementOwner Jerusalem = jerusalem; not sure if this would work though
    
        historic_event jerusalem_christian event/Christians_Capture_Jerusalem.bik
    terminate_monitor
    end_monitor
    the other way would be with a counter but then an extra monitor would be required
    Code:
    declare_counter jerusalem_lost
    monitor_event SettlementTurnStart SettlementName Jerusalem
    and not FactionReligion catholic
    and not FactionReligion orthodox
        set_counter jerusalem_lost 1
    terminate_monitor
    end_monitor
    monitor_event GeneralCaptureSettlement SettlementName Jerusalem
        and not CharacterReligion islam
        and not CharacterReligion pagan
        and not CharacterReligion heretic
        and I_CompareCounter jerusalem_lost = 1
    
        historic_event jerusalem_christian event/Christians_Capture_Jerusalem.bik
    terminate_monitor
    end_monitor
    there is probably a better way

  7. #27

    Default Re: Campaign Script Optimizations

    Quote Originally Posted by Melooo182 View Post
    while we are at it, i think jerusalem captured by christians should have the requirement that is no longer held by crusaders
    Code:
    ;--- Jerusalem Captured
    monitor_event GeneralCaptureSettlement SettlementName Jerusalem
        and not CharacterReligion islam
        and not CharacterReligion pagan
        and not CharacterReligion heretic
        and not I_SettlementOwner Jerusalem = jerusalem; not sure if this would work though
    
    
        historic_event jerusalem_christian event/Christians_Capture_Jerusalem.bik
    terminate_monitor
    end_monitor
    the other way would be with a counter but then an extra monitor would be required if the City is lost to rebels through rioting etc :/
    There is also a chance that jerusalem recaptures Jerusalem from those christians and it can go on this way... So, I'm thinking of this:
    Code:
    ;--- Jerusalem Captured
    monitor_event GeneralCaptureSettlement SettlementName Jerusalem
        and not CharacterReligion islam
        and not CharacterReligion pagan
        and not CharacterReligion heretic
    
        if I_SettlementOwner Jerusalem != jerusalem
        historic_event jerusalem_christian event/Christians_Capture_Jerusalem.bik
        end_if
    terminate_monitor
    end_monitor
    Asthe "GeneralCaptureSettlement" event exports totarget_faction, I'm thinking of this solution too:
    Code:
    ;--- Jerusalem Captured
    
    monitor_event GeneralCaptureSettlement SettlementName Jerusalem
        and not CharacterReligion islam
        and not CharacterReligion pagan
        and not CharacterReligion heretic
        and not TargetFactionReligion catholic
        and not TargetFactionReligion orthodox
    
        historic_event jerusalem_christian event/Christians_Capture_Jerusalem.bik
    terminate_monitor
    end_monitor
    The latter approach -if applied for islam and pagans too- may be a good "reason" to avoid termination of these monitors and have the "Jerusalem messages" multiple times (GeneralCaptureSettlement is not that heavy)

    EDIT: Corrected previous typo error in the last monitor
    Last edited by gsthoed; July 03, 2014 at 09:16 PM. Reason: correcting errors

  8. #28

    Default Re: Campaign Script Optimizations

    I come back to the Faction Killer Workaround, because I think we've done something wrong.

    Code:
    monitor_event BecomesFactionLeader FactionType sicily
        set_event_counter status_sicily 2 ; not emerged=0 dead=1 alive=2
        if I_CompareCounter sicily_died = 1
            inc_event_counter killed_factions_count -1
        end_if
    end_monitor
    These event_counters (status_sicily) were supposed to be able to be used in the EDB, weren't they? It seems that in EDB if an event_counter > 1, then it is recognized as =1.
    Maybe we have to remove these event_counters; maybe it should be better if we have this correspondence:
    sicily is not emerged -- value for status_sicily unspecified
    sicily is destroyed ("dead") -- value for status_sicily 0
    sicily is alive -- value for status_sicily 1.

  9. #29

    Default Re: Campaign Script Optimizations

    I have finished testing a fix for the reverting of campaign difficulty to medium level when a previous AI-controlled faction comes under human control (hotseat campaigning). I believe I am close to fixing for the battle dificulty too. I'll post it in the appropriate thread when ready.
    The first part of these fixes can improve the non-hotseat campaigning too. It does exactly the same job with the "default" "Setup AI" section of the CS, but more monitors are terminated for all levels of campaign difficulty, except medium. In the attached file there are these new "Setup AI" sections for early and late campaigns respectively. In the spoiler, I present briefly these changes.

    Step A) New Setup AI - Part 1
    Spoiler Alert, click show to read: 
    Code:
    ;====================== Setup AI ========================
    ; Part 1 -- Set DifficultyLevel
    monitor_event PreFactionTurnStart FactionIsLocal
        and CampaignDifficulty = easy
    
        set_event_counter DifficultyLevel 1
    
        historic_event difficulty_easy
    ...
    ...
        terminate_monitor
    end_monitor
    
    monitor_event PreFactionTurnStart FactionIsLocal
        and CampaignDifficulty != medium
    
    if not I_EventCounter DifficultyLevel = 1
        
        set_event_counter DifficultyLevel 3
        ; do stuf common for hard and very_hard campaign difficulty
    
    end_if
    
        terminate_monitor
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionIsLocal
        and CampaignDifficulty = very_hard 
    
        set_event_counter DifficultyLevel 4
    
        historic_event difficulty_very_hard
    ...
    ...
        terminate_monitor
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionIsLocal
    
    if not I_EventCounter DifficultyLevel = 4
    and not I_EventCounter DifficultyLevel = 3
    and not I_EventCounter DifficultyLevel = 1
        
        set_event_counter DifficultyLevel = 2
    
        historic_event difficulty_medium
        ...
    
    end_if
    
    if I_EventCounter DifficultyLevel = 3
    
        historic_event difficulty_hard
        ...
    end_if
    
        terminate_monitor
    end_monitor


    EDIT: Actually, why I didn't do this?
    Spoiler Alert, click show to read: 
    Code:
    ;====================== Setup AI ========================
    ; Part 1 -- Set DifficultyLevel
    
    set_event_counter DifficultyLevel 2
    monitor_event PreFactionTurnStart FactionIsLocal
        and CampaignDifficulty = easy
    
        set_event_counter DifficultyLevel 1
    
        historic_event difficulty_easy
    ...
    ...
        terminate_monitor
    end_monitor
    
    monitor_event PreFactionTurnStart FactionIsLocal
        and CampaignDifficulty != medium
    
    if not I_EventCounter DifficultyLevel = 1
        
        set_event_counter DifficultyLevel 3
        ; do stuf common for hard and very_hard campaign difficulty
    
    end_if
    
        terminate_monitor
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionIsLocal
        and CampaignDifficulty = very_hard 
    
        set_event_counter DifficultyLevel 4
    
        historic_event difficulty_very_hard
    ...
    ...
        terminate_monitor
    end_monitor
    
    
    monitor_event PreFactionTurnStart FactionIsLocal
    
     if I_EventCounter DifficultyLevel = 2
    
         historic_event difficulty_medium
        ...
    
    end_if
    
    if I_EventCounter DifficultyLevel = 3
    
        historic_event difficulty_hard
        ...
    end_if
    
        terminate_monitor
    end_monitor
    Attached Files Attached Files
    Last edited by gsthoed; August 03, 2014 at 04:49 AM. Reason: Upate

  10. #30

  11. #31

    Default Re: Campaign Script Optimizations

    Hey melooo and gsthoed very interesting discussion you guys have right here! While browsing the campaigns script myself, I noticed that the interactive events part is severly flawed and not working in the game right now.

    original, not working code:

    Spoiler Alert, click show to read: 

    ;--- Great Trade Fair
    monitor_event FactionTurnStart FactionIsLocal
    and FactionBuildingExists > fairground
    and RandomPercent < 10
    and I_TurnNumber > 10
    and not I_HotseatEnabled

    historic_event great_fair true

    end_monitor

    monitor_conditions I_EventCounter great_fair_accepted = 1
    console_command add_money -2500
    set_event_counter great_fair_accepted = 0
    end_monitor

    monitor_conditions I_EventCounter great_fair_declined = 1
    set_event_counter great_fair_declined = 0
    end_monitor


    set_event_counter great_fair_declined = 0 is wrong. should be: set_event_counter great_fair_declined 0

    So the whole trait gaining/losing doesnt work. Fixed version without monitor conditions:

    Spoiler Alert, click show to read: 

    ;--- Great Trade Fair
    monitor_event FactionTurnStart FactionIsLocal
    and FactionBuildingExists > fairground
    and RandomPercent < 10
    and not I_HotseatEnabled

    historic_event great_fair true

    end_monitor

    monitor_event EventCounter EventCounterType great_fair_accepted
    and EventCounter = 1

    console_command add_money -2500

    set_event_counter great_fair_true 1
    set_event_counter great_fair_accepted 0
    end_monitor

    monitor_event EventCounter EventCounterType great_fair_declined
    and EventCounter = 1

    set_event_counter great_fair_false 1
    set_event_counter great_fair_declined 0
    end_monitor

    monitor_event PreFactionTurnStart FactionIsLocal

    if I_EventCounter great_fair_true 1
    set_event_counter great_fair_true 0
    end_if

    if I_EventCounter great_fair_false 1
    set_event_counter great_fair_false 0
    end_if
    end_monitor


    As said, it works without monitor_conditions. Notice that you will have to adjust the great_fair trait gaining stuff in the export_descr_character_traits to match to great_fair_true or trait_fair_false instead of great_fair_accepted. The part with great_fair_true or false seems redundant, but the game checks the posibility for the character to gain a trait at the end of the turn, so the counter still has to be 1 until the prenextturnstart.

    This method should also work for every other interactive event such as troubadours, councils, etc.

  12. #32

    Default Re: Campaign Script Optimizations

    Thanks man for the contribution!

    Hmmm these could be added to 'Is the AI?' prefactionsturnstart monitor
    Code:
    monitor_event PreFactionTurnStart FactionIsLocal
    
    if I_EventCounter great_fair_true 1 
    set_event_counter great_fair_true 0
    end_if
    
    if I_EventCounter great_fair_false 1 
    set_event_counter great_fair_false 0
    end_if
    end_monitor
    This is my take for the church councils
    also simplified the event to be checked by the trait triggers to just 1 which can have a value of 1 or 2 and resetted to 0 with the prefactionturnstart
    Spoiler Alert, click show to read: 
    Code:
    ;--- Great Councils
    monitor_event EventCounter EventCounterType council_of_clermont
        and EventCounter > 0
        and not I_HotseatEnabled
        and not FactionReligion islam
        and not FactionReligion pagan
    
    
        historic_event great_council true
    terminate_monitor
    end_monitor
    
    
    monitor_event EventCounter EventCounterType lateran_council1
        and EventCounter > 0
        and not I_HotseatEnabled
        and not FactionReligion islam
        and not FactionReligion pagan
    
    
        historic_event great_council true
    terminate_monitor
    end_monitor
    
    
    monitor_event EventCounter EventCounterType lateran_council2
        and EventCounter > 0
        and not I_HotseatEnabled
        and not FactionReligion islam
        and not FactionReligion pagan
    
    
        historic_event great_council true
    terminate_monitor
    end_monitor
    
    
    monitor_event EventCounter EventCounterType lateran_council3
        and EventCounter > 0
        and not I_HotseatEnabled
        and not FactionReligion islam
        and not FactionReligion pagan
    
    
        historic_event great_council true
    terminate_monitor
    end_monitor
    
    
    monitor_event EventCounter EventCounterType lateran_council4
        and EventCounter > 0
        and not I_HotseatEnabled
        and not FactionReligion islam
        and not FactionReligion pagan
    
    
        historic_event great_council true
    terminate_monitor
    end_monitor
    
    
    monitor_event EventCounter EventCounterType great_council_accepted
        and I_EventCounter great_council_accepted = 1
        console_command add_money -1500
        set_event_counter great_council_accepted 0
    
    
        set_event_counter troubadours_event_true 2
    end_monitor
    
    
    monitor_event EventCounter EventCounterType great_council_declined
        and I_EventCounter great_council_declined = 1
        set_event_counter great_council_declined 0
    
    
        set_event_counter troubadours_event_true 1
    end_monitor

  13. #33

    Default Re: Campaign Script Optimizations

    Quote Originally Posted by MWY View Post
    So the whole trait gaining/losing doesnt work. Fixed version without monitor conditions:

    Spoiler Alert, click show to read: 

    ;--- Great Trade Fair
    monitor_event FactionTurnStart FactionIsLocal
    and FactionBuildingExists > fairground
    and RandomPercent < 10
    and not I_HotseatEnabled

    historic_event great_fair true

    end_monitor

    monitor_event EventCounter EventCounterType great_fair_accepted
    and EventCounter = 1

    console_command add_money -2500

    set_event_counter great_fair_true 1
    set_event_counter great_fair_accepted 0
    end_monitor

    monitor_event EventCounter EventCounterType great_fair_declined
    and EventCounter = 1

    set_event_counter great_fair_false 1
    set_event_counter great_fair_declined 0
    end_monitor

    monitor_event PreFactionTurnStart FactionIsLocal

    if I_EventCounter great_fair_true 1
    set_event_counter great_fair_true 0
    end_if

    if I_EventCounter great_fair_false 1
    set_event_counter great_fair_false 0
    end_if
    end_monitor


    As said, it works without monitor_conditions. Notice that you will have to adjust the great_fair trait gaining stuff in the export_descr_character_traits to match to great_fair_true or trait_fair_false instead of great_fair_accepted. The part with great_fair_true or false seems redundant, but the game checks the posibility for the character to gain a trait at the end of the turn, so the counter still has to be 1 until the prenextturnstart.

    This method should also work for every other interactive event such as troubadours, councils, etc.
    I like this version! Two notes though:
    a) if we don't want this event to happen when not I_HotseatEnabled, why not terminating the first monitor?
    Code:
    monitor_event FactionTurnStart FactionIsLocal
    and FactionBuildingExists > fairground
    and RandomPercent < 10
    
     if I_HotseatEnabled
      terminate_monitor
    end_if
    
    historic_event great_fair true
    
    end_monitor
    b) I'm with Melooo182 about "resetting" counters in the "Is the AI?" section. Since the only value of great_fair_true great_fair_false event counters that will be used in EDCT file is 1, we can avoid using the if command and just set them to zero in each preturnstart
    Code:
    monitor_event PreFactionTurnStart FactionIsLocal
    
    set_event_counter great_fair_true 0
    set_event_counter great_fair_false 0
     
     end_monitor
    Melooo182: It is reported in docudemons that FactionReligion condition requires trigger faction. The event EventCounter exports only to event_counter. Also, troubadours_event_true in "Great Councils"?
    Last edited by gsthoed; July 13, 2014 at 08:43 AM.

  14. #34

    Default Re: Campaign Script Optimizations

    Melooo182: It is reported in docudemons that FactionReligion condition requires trigger faction. The event EventCounter exports only to event_counter. Also, troubadours_event_true in "Great Councils"?
    Ah right :/ forgot to check that

  15. #35

    Default Re: Campaign Script Optimizations

    Quote Originally Posted by gsthoed View Post
    I come back to the Faction Killer Workaround, because I think we've done something wrong.

    Code:
    monitor_event BecomesFactionLeader FactionType sicily
        set_event_counter status_sicily 2 ; not emerged=0 dead=1 alive=2
        if I_CompareCounter sicily_died = 1
            inc_event_counter killed_factions_count -1
        end_if
    end_monitor
    These event_counters (status_sicily) were supposed to be able to be used in the EDB, weren't they? It seems that in EDB if an event_counter > 1, then it is recognized as =1.
    Maybe we have to remove these event_counters; maybe it should be better if we have this correspondence:
    sicily is not emerged -- value for status_sicily unspecified
    sicily is destroyed ("dead") -- value for status_sicily 0
    sicily is alive -- value for status_sicily 1.
    are you sure the unspecified value will not be counted as 0?

  16. #36

    Default Re: Campaign Script Optimizations

    Quote Originally Posted by Melooo182 View Post
    are you sure the unspecified value will not be counted as 0?
    I had once a case which I cannot remember now in which the unspecified value didn't count as 0. In other cases it's true that it counts as 0. My previous suggestions to this point should be ignored.
    But the issue about EDB remains. This might be useful http://www.twcenter.net/forums/showt...=1#post5555510
    Quoted from that post:
    Some things you need to know:
    The requires event_counter line is a bit flawed in the EDB file. It will only detect 0 and 1 for event_counter values. Anything over 1 will be treated as a 1. If you need multiple options then you need multiple event_counters.

  17. #37

    Default Re: Campaign Script Optimizations

    hmmm well emerging faction already use some event as a reference to actually emerge.

    Teutonic Order emerges with the Inquisition event

    Mongols and Timurids are bit trickier as they dont directly use an event but rather use it to make various stages of their invasions, so we could perhaps add a "set_event_counter mongols_emerged/timurids_emerged 1" in their scripts parts

    I still don't know what use this could have but maybe some RR tweak submod that allows some AOR units only after these factions emerge...or the contrary allows some AOR units until these factions emerge.

    so these would be ones used in EDB while the status 1/2 for traits or ancillaries

  18. #38

    Default Re: Campaign Script Optimizations

    Quote Originally Posted by Melooo182 View Post
    hmmm well emerging faction already use some event as a reference to actually emerge.

    Teutonic Order emerges with the Inquisition event

    Mongols and Timurids are bit trickier as they dont directly use an event but rather use it to make various stages of their invasions, so we could perhaps add a "set_event_counter mongols_emerged/timurids_emerged 1" in their scripts part
    Haven't tried, but mongols_invasion and timurids_invasion even_counters don't do the job? For example, as soon as timurids_invasion sets to 1, there is a monitor that starts spawning them in the same manner that inquisition triggers the spawning of teutonic_order; same for mongols.

  19. #39

    Default Re: Campaign Script Optimizations

    Also I have a sort of a question

    I_TurnNumber actually counts the turns and not years, right?

    if so changing the year/turn ratio in descr_strat would make some of these scripted stuff appear in the wrong year, right?

    maybe something like this would be better for great peoples ancillaries and other date dependant scripts
    Code:
    monitor_event EventCounter EventCounterType early_era
        and EventCounter = 1
    
    
        add_events
            event counter    1105AD
            date    5
            event counter    1108AD
            date    8
            event counter    1115AD
            date    15
            event counter    1142AD
            date    42
            ...etc
        end_add_events
    terminate_monitor
    end_monitor
    or just directly add them to the descr_events?

  20. #40

    Default Re: Campaign Script Optimizations

    Quote Originally Posted by Melooo182 View Post
    Also I have a sort of a question

    I_TurnNumber actually counts the turns and not years, right?

    if so changing the turn/year ratio in descr_strat would makes some of these scripted stuff appear in the wrong year, right?

    maybe something like this would be better for great peoples ancillaries and other date dependant scripts
    Code:
    monitor_event EventCounter EventCounterType early_era
        and EventCounter = 1
    
    
        add_events
            event counter    1105AD
            date    5
            event counter    1108AD
            date    8
            event counter    1115AD
            date    15
            event counter    1142AD
            date    42
            ...etc
        end_add_events
    terminate_monitor
    end_monitor
    or just directly add them to the descr_events?
    As it is in v6.4, Great People Ancillaries is a turn dependent script. If you moddify the timescale, surely this approach of yours will make the appearance more historically accurate but it may not suit well for those that change the timescale for other reasons than make some events appear earlier or later in the campaign (for example you use 2TPY submod to disable ageing script and bring back devastation); these people will have to adapt the date-based events (and maybe several other stuff), there is no reason to make them adapt the previously turn-dependent ones too.
    On the other hand, if you won't change the timescale, these extra EventCounter monitors are unnecessary, as you cannot avoid the monitor of (Pre)FactionTurnStart of slaves which determines the availability of Great People Ancillaries.

Page 2 of 5 FirstFirst 12345 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
  •