Results 1 to 16 of 16

Thread: Nabatu reforms not working

  1. #1

    Default Nabatu reforms not working

    I think I've met all the requiresments:

    - I own 2 metropolises and 2 polis
    - I own 4 large markets
    - faction leader has "Philhellenos" trait (note: something wonky may be going on with the faction leader. He became FL by suiciding the previous FL on a ship. The first time I did this he remained FH (no FL at all?!?), so I reloaded and suicided the FL again in a different way and it worked)
    - thorakitai reforms have occurred. In fact, it is currently turn 232
    - settled reforms took place on turn 160-ish

    Is there anything I am missing?

  2. #2

    Default Re: Nabatu reforms not working

    Some other information: The third large market, and thus the final non-thorakitai reforms requirement finished building on turn 203, right when the thorakitai reforms took place. If this caused the script to go haywire, please let me know

  3. #3

    Default Re: Nabatu reforms not working

    There's a code fragment in campaign_script that might be causing the second Nabatu reform to not fire.

    monitor_event FactionTurnStart FactionType f_nabatu
    if I_EventCounter ecNabatu_Imperial > 0 ; reform has happened
    terminate_monitor ; kill this monitor
    end_if
    if not I_IsFactionAIControlled f_nabatu ; reset loop for the human player
    and I_EventCounter ecNabatu_Imperial < 1 ; reform has not happened yet
    set_counter nabatu_hel_poleis 0 ; reset counter
    set_counter nabatu_trade_centers 0 ; reset counter
    end_if
    if I_IsFactionAIControlled f_nabatu ; Fallback trigger for the AI
    and I_NumberOfSettlements f_nabatu > 9 ; have at least 10 settlements
    ;set_event_counter ecNabatu_Settled 0
    set_event_counter ecNabatu_Imperial 1
    set_religion f_nabatu rel_c ;;; change to Eastern Imperial "religion"
    terminate_monitor
    end_if
    end_monitor

    The reset loop activates before:

    monitor_event CharacterTurnEnd FactionType f_nabatu
    and IsFactionLeader
    and Trait Philhellene > 0 ;;; Faction leader has the requisite "Philhellene" trait
    and I_EventCounter ecNabatu_Settled > 0 ;;; first reform has happened
    and I_EventCounter ecThorakitaiReform > 0 ;;; late Hellenistic reform has happened
    and I_CompareCounter nabatu_hel_poleis > 2 ;;; have at least 3 major Greek settlements
    and I_CompareCounter nabatu_trade_centers > 2 ;;; have at least 3 major markets
    ;set_event_counter ecNabatu_Settled 0 ;;; Settled reform
    set_event_counter ecNabatu_Imperial 1 ;;; Empire reform
    set_religion f_nabatu rel_c ;;; change to Eastern Imperial "religion"
    historic_event HE_NABATU_IMPERIAL factions { f_nabatu, }
    terminate_monitor
    end_monitor

    So if the human controls Nabatu then both counters are being reset before the reform checks take place! Is this a bug or did I misinterpret the script?

  4. #4

    Default Re: Nabatu reforms not working

    It looks like it should work this way for the 2nd reform:

    When the turn starts for the faction it resets the counters
    Code:
        monitor_event FactionTurnStart FactionType f_nabatu
            if I_EventCounter ecNabatu_Imperial > 0                        ; reform has happened
                terminate_monitor                                        ; kill this monitor
            end_if
            if not I_IsFactionAIControlled f_nabatu                        ; reset loop for the human player
                and I_EventCounter ecNabatu_Imperial < 1                ; reform has not happened yet
                set_counter nabatu_hel_poleis 0                         ; reset counter
                set_counter nabatu_trade_centers 0                ; reset counter
            end_if
            if I_IsFactionAIControlled f_nabatu                          ; Fallback trigger for the AI
                and I_NumberOfSettlements f_nabatu > 9                        ; have at least 10 settlements
                ;set_event_counter ecNabatu_Settled 0
                set_event_counter ecNabatu_Imperial 1
                set_religion f_nabatu rel_c                            ;;; change to Eastern Imperial "religion"
                terminate_monitor
            end_if
        end_monitor
    Then poleis/metropoleis and markets are counted
    Code:
        monitor_event SettlementTurnStart FactionType f_nabatu            ; Count Hellenistic poleis administered by Nabatu
            and SettlementBuildingExists > polis_one                    ; settlements with larger Greek Poleis already present
            if I_IsFactionAIControlled f_nabatu                            ; terminate if faction is AI controlled
                terminate_monitor
            end_if
            if I_EventCounter ecNabatu_Settled > 0
                inc_counter nabatu_hel_poleis 1
            end_if
            if I_EventCounter ecNabatu_Imperial > 0                    ; Imperial reform has happened
                terminate_monitor
            end_if
        end_monitor
    
    
        monitor_event SettlementTurnStart FactionType f_nabatu            ; Count large cities with fully developed markets controlled by Nabatu
            and SettlementBuildingExists > market_three                    ; massive city-requiring market
            if I_IsFactionAIControlled f_nabatu                            ; terminate if faction is AI controlled
                terminate_monitor
            end_if
            if I_EventCounter ecNabatu_Settled > 0
                inc_counter nabatu_trade_centers 1
            end_if
            if I_EventCounter ecNabatu_Imperial > 0                    ; Imperial reform has happened
                terminate_monitor
            end_if
        end_monitor
    And then at the end of the turn it checks the reform requirements based on the faction leader
    Code:
        monitor_event CharacterTurnEnd FactionType f_nabatu
            and IsFactionLeader
            and Trait Philhellene > 0                            ;;; Faction leader has the requisite "Philhellene" trait
            and I_EventCounter ecNabatu_Settled > 0             ;;; first reform has happened
            and I_EventCounter ecThorakitaiReform > 0             ;;; late Hellenistic reform has happened
            and I_CompareCounter nabatu_hel_poleis > 2            ;;; have at least 3 major Greek settlements
            and I_CompareCounter nabatu_trade_centers > 2        ;;; have at least 3 major markets
            ;set_event_counter ecNabatu_Settled 0                ;;; Settled reform
            set_event_counter ecNabatu_Imperial 1                ;;; Empire reform
            set_religion f_nabatu rel_c                            ;;; change to Eastern Imperial "religion"
            historic_event HE_NABATU_IMPERIAL factions { f_nabatu, }
            terminate_monitor
        end_monitor
    So unless SettlementTurnStart events take place before FactionTurnStart events then it should work properly.

    Have you tried playing a few turns after the requirements were met to see if the reform fired then?

  5. #5

    Default Re: Nabatu reforms not working

    Yes, I have tried playing a few turns after. In fact, it is currently turn 232 and I finished the last requirement (building the 3rd large market) on turn 203. I've waited almost 30 turns. Do you know if the fact that all the requirements are satisfied right as the thorakitai reforms hit is causing any issues?

  6. #6

    Default Re: Nabatu reforms not working

    I'm afraid I don't know what the problem is then ... You can try sharing your save file, maybe I or someone on the team can see what's happening.

  7. #7

    Default Re: Nabatu reforms not working

    I had same issue. Save attached;
    Attached Files Attached Files

  8. #8

    Default Re: Nabatu reforms not working

    Actually, the leader had lost philhellenos by then. Has it still here
    Attached Files Attached Files

  9. #9

    Default Re: Nabatu reforms not working

    I wish there were shell commands to see the status of different counters. Something like for example "show_counter ec_poleis" for the Nabatu Reforms.

  10. #10

    Default Re: Nabatu reforms not working

    Quote Originally Posted by Shoebopp View Post
    I wish there were shell commands to see the status of different counters. Something like for example "show_counter ec_poleis" for the Nabatu Reforms.
    That would be fantastic.....

  11. #11

    Default Re: Nabatu reforms not working

    Quote Originally Posted by bartiger View Post
    Actually, the leader had lost philhellenos by then. Has it still here
    I can't load your save because I have modded my EB2 slightly, so I can't really help unfortunately..

    Edit: Found the solution, see next reply
    Last edited by Electricity; May 21, 2020 at 01:25 PM.

  12. #12

    Default Re: Nabatu reforms not working

    Great news! I have found out what the problem is.

    Apparently the monitor for SettlementTurnStart is triggered before the monitor for FactionTurnStart which results in the poleis and markets being counted and reset before the reform can be checked.

    I put this code into the campaign script:
    Code:
        monitor_event SettlementTurnStart FactionType f_rome
            log f_rome: Settlement turn
        end_monitor
    So I could see in the log what order the monitors trigger and this is what I find in the log:
    Code:
    20:11:33.551 [game.script] [always] f_rome: Faction turn pre-start
    20:11:33.622 [game.script] [always] f_rome: Settlement turn
    20:11:33.622 [game.script] [always] f_rome: Settlement turn
    20:11:33.622 [game.script] [always] f_rome: Settlement turn
    20:11:33.622 [game.script] [always] f_rome: Settlement turn
    20:11:33.623 [game.script] [always] f_rome: Settlement turn
    20:11:33.624 [game.script] [always] f_rome: Faction turn start
    20:11:44.824 [game.script] [always] f_rome: Faction turn end
    So to fix your problem you will have to modify the campaign script and make the FactionTurnStart monitor into a PreFactionTurnStart monitor so this:
    Code:
        monitor_event FactionTurnStart FactionType f_nabatu
            if I_EventCounter ecNabatu_Imperial > 0                        ; reform has happened
                terminate_monitor                                        ; kill this monitor
            end_if
            if not I_IsFactionAIControlled f_nabatu                        ; reset loop for the human player
                and I_EventCounter ecNabatu_Imperial < 1                ; reform has not happened yet
                set_counter nabatu_hel_poleis 0                         ; reset counter
                set_counter nabatu_trade_centers 0                ; reset counter
            end_if
            if I_IsFactionAIControlled f_nabatu                          ; Fallback trigger for the AI
                and I_NumberOfSettlements f_nabatu > 9                        ; have at least 10 settlements
                ;set_event_counter ecNabatu_Settled 0
                set_event_counter ecNabatu_Imperial 1
                set_religion f_nabatu rel_c                            ;;; change to Eastern Imperial "religion"
                terminate_monitor
            end_if
        end_monitor
    Becomes this instead:
    Code:
        monitor_event PreFactionTurnStart FactionType f_nabatu
            if I_EventCounter ecNabatu_Imperial > 0                        ; reform has happened
                terminate_monitor                                        ; kill this monitor
            end_if
            if not I_IsFactionAIControlled f_nabatu                        ; reset loop for the human player
                and I_EventCounter ecNabatu_Imperial < 1                ; reform has not happened yet
                set_counter nabatu_hel_poleis 0                         ; reset counter
                set_counter nabatu_trade_centers 0                ; reset counter
            end_if
            if I_IsFactionAIControlled f_nabatu                          ; Fallback trigger for the AI
                and I_NumberOfSettlements f_nabatu > 9                        ; have at least 10 settlements
                ;set_event_counter ecNabatu_Settled 0
                set_event_counter ecNabatu_Imperial 1
                set_religion f_nabatu rel_c                            ;;; change to Eastern Imperial "religion"
                terminate_monitor
            end_if
        end_monitor
    Unfortunately you will have to start a new campaign for the changes to take effect.
    Last edited by Electricity; May 21, 2020 at 01:23 PM. Reason: Fixed code

  13. #13

    Default Re: Nabatu reforms not working

    Thanks for your time and the explanation!

  14. #14

    Default Re: Nabatu reforms not working

    That is amazing, thank you so much! Hopefully this will be patched in 2.35a

  15. #15

    Default Re: Nabatu reforms not working

    Quote Originally Posted by Electricity View Post
    Great news! I have found out what the problem is.

    Apparently the monitor for SettlementTurnStart is triggered before the monitor for FactionTurnStart which results in the poleis and markets being counted and reset before the reform can be checked.

    I put this code into the campaign script:
    Code:
        monitor_event SettlementTurnStart FactionType f_rome
            log f_rome: Settlement turn
        end_monitor
    So I could see in the log what order the monitors trigger and this is what I find in the log:
    Code:
    20:11:33.551 [game.script] [always] f_rome: Faction turn pre-start
    20:11:33.622 [game.script] [always] f_rome: Settlement turn
    20:11:33.622 [game.script] [always] f_rome: Settlement turn
    20:11:33.622 [game.script] [always] f_rome: Settlement turn
    20:11:33.622 [game.script] [always] f_rome: Settlement turn
    20:11:33.623 [game.script] [always] f_rome: Settlement turn
    20:11:33.624 [game.script] [always] f_rome: Faction turn start
    20:11:44.824 [game.script] [always] f_rome: Faction turn end
    So to fix your problem you will have to modify the campaign script and make the FactionTurnStart monitor into a PreFactionTurnStart monitor so this:
    Code:
        monitor_event FactionTurnStart FactionType f_nabatu
            if I_EventCounter ecNabatu_Imperial > 0                        ; reform has happened
                terminate_monitor                                        ; kill this monitor
            end_if
            if not I_IsFactionAIControlled f_nabatu                        ; reset loop for the human player
                and I_EventCounter ecNabatu_Imperial < 1                ; reform has not happened yet
                set_counter nabatu_hel_poleis 0                         ; reset counter
                set_counter nabatu_trade_centers 0                ; reset counter
            end_if
            if I_IsFactionAIControlled f_nabatu                          ; Fallback trigger for the AI
                and I_NumberOfSettlements f_nabatu > 9                        ; have at least 10 settlements
                ;set_event_counter ecNabatu_Settled 0
                set_event_counter ecNabatu_Imperial 1
                set_religion f_nabatu rel_c                            ;;; change to Eastern Imperial "religion"
                terminate_monitor
            end_if
        end_monitor
    Becomes this instead:
    Code:
        monitor_event PreFactionTurnStart FactionType f_nabatu
            if I_EventCounter ecNabatu_Imperial > 0                        ; reform has happened
                terminate_monitor                                        ; kill this monitor
            end_if
            if not I_IsFactionAIControlled f_nabatu                        ; reset loop for the human player
                and I_EventCounter ecNabatu_Imperial < 1                ; reform has not happened yet
                set_counter nabatu_hel_poleis 0                         ; reset counter
                set_counter nabatu_trade_centers 0                ; reset counter
            end_if
            if I_IsFactionAIControlled f_nabatu                          ; Fallback trigger for the AI
                and I_NumberOfSettlements f_nabatu > 9                        ; have at least 10 settlements
                ;set_event_counter ecNabatu_Settled 0
                set_event_counter ecNabatu_Imperial 1
                set_religion f_nabatu rel_c                            ;;; change to Eastern Imperial "religion"
                terminate_monitor
            end_if
        end_monitor
    Unfortunately you will have to start a new campaign for the changes to take effect.
    You are exactly correct, that's a process sequencing error on my part. The order goes:

    PreFactionTurnStart
    CharacterTurnStart [..n]
    SettlementTurnStart [..n]
    FactionTurnStart
    (Moves, etc.)
    (For player: end turn button clicked)
    (Buildings constructed, units recruited)
    CharacterTurnEnd [..n]
    CharacterTurnEndInSettlement [..n]
    SettlementTurnEnd [..n]
    FactionTurnEnd
    I'll correct that, good catch.

  16. #16

    Default Re: Nabatu reforms not working

    Glad I could help

    Quote Originally Posted by QuintusSertorius View Post
    PreFactionTurnStart
    CharacterTurnStart [..n]
    SettlementTurnStart [..n]
    FactionTurnStart
    (Moves, etc.)
    (For player: end turn button clicked)
    (Buildings constructed, units recruited)
    CharacterTurnEnd [..n]
    CharacterTurnEndInSettlement [..n]
    SettlementTurnEnd [..n]
    FactionTurnEnd
    This is good info to have, thanks for sharing

Posting Permissions

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