Page 1 of 3 123 LastLast
Results 1 to 20 of 49

Thread: Help to change diplomacy

  1. #1

    Default Help to change diplomacy

    Where can I find the script for diplomacy? I don't like wars no one is fighting.

    I would like to change war weariness to much higher value ( to end endless wars) and higher values for winning battles (to stay in a war they are winning) if something like that is possible.

  2. #2

    Default Re: Help to change diplomacy

    The section of the script you are looking for is 25. Campaign AI Label Triggers. There is no trigger for winning battles, only for losing them. All the things that increase war weariness are losing battles, being besieged and recruiting lots of units.

    Note that the switch back to warlike is a simple random chance (8% chance a turn), so you need to increase that as well if you don't want them to spend long periods nursing their wounds.

  3. #3

    Default Re: Help to change diplomacy

    I will raise weariness for small factions to make them more reasonable. I cant make them to accept peace and I think other factions have a similar problem. How much WarWeariness they need to switch to peaceseeking?

    If I add this code for every faction and simply copy it into one of WarWearines monitors, will they get one aditional point every turn or I need to do something else?

    Code:
    if I_EventCounter faction_turn_f_nabatu > 0 ; it's the faction's turn
    and I_EventCounter f_nabatu_PeaceSeeking < 1 ; faction is in a warlike state
    inc_counter f_nabatu_WarWeariness 1 ; so increase war weariness
    end_if

    Is it safe to remove parts about ships to make naval warfare count? Most of factions stuck in wars they dont fight are at coast after failed naval invasions.

    Code:
      ;; Faction is winning/losing battles ;;
    
    
        monitor_event PostBattle TrueCondition     ; checking after a battle has been fought
            and not I_ConflictType Naval ; exclude naval battles
    
    
    ;; Faction's levels of recruitment ;;
    
        monitor_event UnitTrained TrueCondition                ; a unit has been trained
        and not TrainedUnitCategory ship                ; exclude ships

  4. #4

    Default Re: Help to change diplomacy

    Yep, safe to remove those. The threshold is 6, it's in a lower section (as > 5).

  5. #5

    Default Re: Help to change diplomacy

    Maybe I just have to lower that one to 5 to see some peace. Or I will change threshold to 40, give them one WarWearines point per turn and raise points for SiegeStress, battles and recruitment to 8,7,8. This way they should have similar stances as before + they should try to end wars after 10 years even if they dont fight it.

    Problem is that I want active wars with aggressive factions to stay. Can I remove WarWeariness points like this ?:


    Code:
     ;; Faction is winning/losing battles ;;
    
    
        monitor_event PostBattle TrueCondition     ; checking after a battle has been fought
            and not I_ConflictType Naval ; exclude naval battles
            if I_EventCounter faction_turn_f_rome > 0    ; it's the faction's turn
                and not I_WonBattle f_rome                        ; faction lost a battle they initiated
                and I_EventCounter f_rome_PeaceSeeking < 1 ; faction is in a warlike state
                inc_counter f_rome_WarWeariness 1          ; so increase war weariness
            end_if

    Code:
     ;; Faction is winning/losing battles ;;
    
    
        monitor_event PostBattle TrueCondition     ; checking after a battle has been fought
            and not I_ConflictType Naval ; exclude naval battles
            if I_EventCounter faction_turn_f_rome > 0    ; it's the faction's turn
                
                and I_EventCounter f_rome_PeaceSeeking < 1 ; faction is in a warlike state
                if  not I_WonBattle f_rome                        ; faction lost a battle they initiated
                     inc_counter f_rome_WarWeariness 7          ; so increase war weariness
                else                                                             ; faction won a battle they initiated
                      inc_counter f_rome_WarWeariness -5          ; so decrease war weariness 
                end_if
            end_if

  6. #6

    Default Re: Help to change diplomacy

    In almost 300 turns long campaign I have seen one message about peace and one alliance. Only one diplomat was send to me with trade agreement proposition and noone aked for ceasefire. Rome, Carthage, Numidia and gauls take my peace offerings as very generous, and yet they are unable to ask for it or end their own wars between each other. Switch between war and peace works correcty, but if negotiations are extremly rare, no wonder there is no political development.
    Cant there be a problem with diplomats? Where can I find changes to diplomats and what war and peace stances do?

    Another thing - in first monitor "monitor_event PreFactionTurnStart FactionIsLocal" there is section at end which changes AI stances for all factions to peacefull. This breaks some campaigns, for example as KH I made peace with Pyrrhos, alliance turn later, we captured Korinthos together (KH without much of a loss Epeiros had no army left) and then I moved on Demetrias. Makedonia and Epeiros ruined after 10 turns and I was unstoppable. I should be shaking for my life for years during that war.

  7. #7

    Default Re: Help to change diplomacy

    All the details on behaviour is in the descr_campaign_ai_db - that defines default, diplomacy and warlike states.

    The CAI does does do weird things with grouping diplomats together, and there's a cap on the maximum number per faction - see "Agent restrictions and others"

    Not all factions are changed to peaceful - just those who are supposed to start out in the peaceable stance:

    Code:
        monitor_event PreFactionTurnStart FactionIsLocal
            set_counter f_rome_WarWeariness 6
            set_counter f_carthage_WarWeariness 6
            set_counter f_baktria_WarWeariness 6
            set_counter f_hayasdan_WarWeariness 6
            set_counter f_pontos_WarWeariness 6
            set_counter f_parthia_WarWeariness 6
            set_counter f_lusotannan_WarWeariness 6
            set_counter f_saba_WarWeariness 6
            set_counter f_saka_WarWeariness 6
            set_counter f_sauromatae_WarWeariness 6
            set_counter f_numidia_WarWeariness 6
            set_counter f_pergamon_WarWeariness 6
            set_counter f_gandhara_WarWeariness 6
            set_counter f_bosporan_WarWeariness 6
            set_counter f_nabatu_WarWeariness 6
            terminate_monitor
        end_monitor
    Also note it's in a monitor that terminates on game-start, so it only sets them once. It also lines up with this section in the "startup" script (which again terminates at the start of the game):

    Code:
            ; Starting AI stance event counters
            set_event_counter f_rome_PeaceSeeking 1
            set_event_counter f_carthage_PeaceSeeking 1
            set_event_counter f_baktria_PeaceSeeking 1
            set_event_counter f_hayasdan_PeaceSeeking 1
            set_event_counter f_pontos_PeaceSeeking 1
            set_event_counter f_parthia_PeaceSeeking 1
            set_event_counter f_lusotannan_PeaceSeeking 1
            set_event_counter f_saba_PeaceSeeking 1
            set_event_counter f_saka_PeaceSeeking 1
            set_event_counter f_sauromatae_PeaceSeeking 1
            set_event_counter f_numidia_PeaceSeeking 1
            set_event_counter f_pergamon_PeaceSeeking 1
            set_event_counter f_gandhara_PeaceSeeking 1
            set_event_counter f_bosporan_PeaceSeeking 1
            set_event_counter f_nabatu_PeaceSeeking 1
            terminate_monitor

  8. #8

    Default Re: Help to change diplomacy

    I have read descr_campaign_ai_db but it only says when they want peace. I know they want peace, because they gladly accept it, but they dont send diplomats to other factions with proposal. Some time ago I suggested that assassins do nothing and they should be more active. I was told they were overactive in previous versions and there is no desire to go back. Can I ask how this change was achieved for my personal edits?

    Sorry, I didnt noticed Epeiros and Makedonia arent in that list. But still, at turn one I proposed peace to Makedonia with a pile of gold and they denied proposal as very demanding, on second turn they gladly accepted ceasefire and paid 1000x10 tribute. Why so sudden change? In my opinion they should be in war for some time at least and I dont see how they could get so much WarWeariness in starting turn or how they managed to switch stance. Same with Epeiros.

  9. #9

    Default Re: Help to change diplomacy

    No idea what's going on with the agents or the changes, that's all z3n's realm.

    There's something weird going on with diplomacy in turn 1 that we don't understand.

  10. #10

    Default Re: Help to change diplomacy

    Hmmm, now I'm looking at the diplomacy-switch script, it has all kinds of problems. Rewriting it now, there are IF loops that should be inside other ones and some logical errors. The actual switch part needs to be in a monitor of it's own and consolidated thus:

    Code:
        monitor_event FactionTurnStart TrueCondition
            if I_EventCounter faction_turn_f_rome > 0                     ; it's the faction's turn
                if I_CompareCounter f_rome_PeaceSeeking > 0               ; the faction is in a peace-seeking stance
                    generate_random_counter reset_f_rome_Weariness 1 12   ; the larger the range the lower the chance
                    if I_EventCounter reset_f_rome_Weariness = 4          ; 1 in 12, ie 8% chance of occurring
                        set_counter f_rome_WarWeariness 0                 ; remove war-weariness
                        link_faction_ai f_rome warlike                    ; change to war-making behaviour
                        set_event_counter f_rome_PeaceSeeking 0           ; an event_counter to note the change in behaviour
                    end_if
                end_if
                if I_CompareCounter f_rome_WarWeariness > 5               ; Faction is above war weariness threshold
                    and I_CompareCounter f_rome_PeaceSeeking < 1          ; the faction is in a warlike stance - to stop this triggering every turn
                    link_faction_ai f_rome diplomacy                      ; change to peace-seeking behaviour
                    set_event_counter f_rome_PeaceSeeking 1               ; an event_counter to note the change in behaviour
                end_if
            end_if
    Last edited by QuintusSertorius; November 03, 2017 at 07:10 AM.

  11. #11

    Default Re: Help to change diplomacy

    Im glad to hear it. I replaced warlike code with diplomacy code in decr_campaign_ai_dm to see if they are negotiating in peaceful mode and factions are communicating again. If that switch will be fixed I hope endless AI wars will be over.

  12. #12

    Default Re: Help to change diplomacy

    That's basically the difference between the two states. In diplomacy, they are reasonable and look to make peace. In warlike, it's standard Total War hates-everyone-war-to-the-death.

    The above makes for a really passive game if everyone is in that state all the time, which is why we devised the notion of switching between them to make for a more organic experience.

  13. #13

    Default Re: Help to change diplomacy

    Total war setting is very bad for AI as well. I have spent whole campaign in foreign territories and after first 150 turns, factions are stuck in a war on every border, with large armies tied for border defense and move remaining forces between fronts unable to do some significant move most of the time. They are also easy prey for the player when they cant focus forces.

    Carthage is worst as it took them almost two years to move their offensive army fighting against Nabatu back home to defend against Numidians and after 6 turns they went back (and Numidia captured their capital before they have returned again). And they were at war with 4 other factions.

    I'm very curious how it will go with new changes.

  14. #14

    Default Re: Help to change diplomacy

    Would you like to test the new one?

    New diplomacy switch script.txt

    Replace everything below the declarations with the above.

  15. #15

    Default Re: Help to change diplomacy

    Quote Originally Posted by QuintusSertorius View Post
    Would you like to test the new one?

    New diplomacy switch script.txt

    Replace everything below the declarations with the above.
    I thought you will never ask

  16. #16

    Default Re: Help to change diplomacy

    I've only done the campaign-startup test - that will throw out silly things like having event_counters wrongly labelled as regular counters or non-existent factions. It doesn't crash the script, but I haven't tested any more than that.

  17. #17

    Default Re: Help to change diplomacy

    1-10 turn Saka/Baktria Eperios/Rome+KH and some other factions have ended their starting wars, Ptolemaioi/Seleukea ended a war but they are fighting again. Factions still fighting have only one max 2 enemies. Getai and Seleucid diplomats are trying to bribe my settlement (I think)

    25+ turn Saka/Baktria fighting again
    Makedonia + Epeiros Alliance (Gods be merciful on us!!!)
    Eperios + KH in peace again
    Baktria Seleukea peace
    First Punic war ended

    30+ Hayastan war Sauromate
    Areuakoi war with Leusitane but they make peace after one turn
    Epeiros war with Rome
    Nabateans attacked Seleukea
    Makedonia/KH+Ptolemaioi peace

    40+ Hayastan peace Sauromate
    Areuakoi war with Leusitane but they make peace few turns later (I think this is scripted war after Leusitane captured Carpetania)
    Ptolemaioi and Seleukea peace
    Seleukea and Ptolemaioi armies crossed my territory on their way into Europe
    Ptolemaioi asked me for money or they will attack, I paid and they left


    It looks very interesting, but I'm not getting all info about politics for some reason. Sometimes I got a message about peace and I don't even know there was a war between them. It does also seem they shift their interests quickly. I will leave it to run some more to see an impact in long-term.

    Also my reputation went to distrustful and I'm doing nothing only autoresolving battles with rebels in my territory (Pergamon)

  18. #18

    Default Re: Help to change diplomacy

    Quote Originally Posted by YourMadDoc View Post
    1-10 turn Saka/Baktria Eperios/Rome+KH and some other factions have ended their starting wars, Ptolemaioi/Seleukea ended a war but they are fighting again. Factions still fighting have only one max 2 enemies. Getai and Seleucid diplomats are trying to bribe my settlement (I think)

    25+ turn Saka/Baktria fighting again
    Makedonia + Epeiros Alliance (Gods be merciful on us!!!)
    Eperios + KH in peace again
    Baktria Seleukea peace
    First Punic war ended

    30+ Hayastan war Sauromate
    Areuakoi war with Leusitane but they make peace after one turn
    Epeiros war with Rome
    Nabateans attacked Seleukea
    Makedonia/KH+Ptolemaioi peace

    40+ Hayastan peace Sauromate
    Areuakoi war with Leusitane but they make peace few turns later (I think this is scripted war after Leusitane captured Carpetania)
    Ptolemaioi and Seleukea peace
    Seleukea and Ptolemaioi armies crossed my territory on their way into Europe
    Ptolemaioi asked me for money or they will attack, I paid and they left


    It looks very interesting, but I'm not getting all info about politics for some reason. Sometimes I got a message about peace and I don't even know there was a war between them. It does also seem they shift their interests quickly. I will leave it to run some more to see an impact in long-term.
    Not so enamoured with the 1-turn wars - there are some war-triggers around the place and it sounds like the CAI is basically ignoring them when they happen.

    To be honest, I have no idea how the notifications work.

    Quote Originally Posted by YourMadDoc View Post
    Also my reputation went to distrustful and I'm doing nothing only autoresolving battles with rebels in my territory (Pergamon)
    As per another thread, there's a section that needs deleting from the descr_faction_standing.txt:

    Code:
    ; Adjust the AI relationships towards each faction based on difficulty level (AI factions have normal difficulty)
    ;------------------------------------------
    Trigger 0092_Update_Easy_Difficulty
        WhenToTest FactionTurnStart
    
        Condition CampaignDifficulty = easy
    
        FactionStanding exclude_factions { } normalise 1.0 50
    
    ;------------------------------------------
    Trigger 0093_Update_Normal_Difficulty
        WhenToTest FactionTurnStart
    
        Condition CampaignDifficulty = medium
    
        FactionStanding exclude_factions { } normalise -0.5 50
    
    ;------------------------------------------
    Trigger 0094_Update_Hard_Difficulty
        WhenToTest FactionTurnStart
    
        Condition CampaignDifficulty = hard
    
        FactionStanding exclude_factions { } normalise -0.5 50
    
    ;------------------------------------------
    Trigger 0095_Update_Very_Hard_Difficulty
        WhenToTest FactionTurnStart
    
        Condition CampaignDifficulty = very_hard
    
        FactionStanding exclude_factions { } normalise -0.5 50
    It shouldn't be there, and it's "normalising" relations towards negative over time. No idea if a change is savegame-compatible.

  19. #19

    Default Re: Help to change diplomacy

    40+ Epeiros war KH

    50+ Makedonia + Epeiros peace
    I planned to make alliance with Ptolemaioi, but Seleukea asked me to attack them when I asked them for map. I asked Ptolemaioi for map too and they asked for 3600 bribe or they will attack so I paid.

    60+ Gallatians are still asking me for money but Galatia belongs to Seleukea.
    Carthage war Leusitane
    Seleukea and Ptolemaioi failed to conquer Byzantion
    Ptolemaioi invade Sicily
    Factions are still trying to have max one enemy and they fight mostly with rebels

    70+ Boioi war Lugiones
    Pahlava war Seleukea


    It is much stable now, but I guess it ìs because everyone is busy fighting with rebels.

    I have repeatable crash after I auto_win fight with rebels through console (they besieged my only settlement and attacked). I will try to fight in manually later, but if I auto resolve it always happens
    Attached Files Attached Files

  20. #20

    Default Re: Help to change diplomacy

    I've seen this before, but no idea what it means:

    Code:
    18:28:09.844 [system.io] [info] exists:   found mods/ebii/data/ui/cul_3/portraits/portraits/dead/070.tga (from: E:\SteamGames\steamapps\common\Medieval II Total War)
    18:28:09.844 [system.io] [info] exists:   found mods/ebii/data/ui/cul_3/portraits/portraits/dead/070.tga (from: E:\SteamGames\steamapps\common\Medieval II Total War)
    18:28:09.845 [system.io] [info] exists:   found mods/ebii/data/ui/cul_3/portraits/portraits/dead/070.tga (from: E:\SteamGames\steamapps\common\Medieval II Total War)
    18:28:09.845 [system.io] [info] exists:   found mods/ebii/data/ui/cul_3/portraits/portraits/dead/070.tga (from: E:\SteamGames\steamapps\common\Medieval II Total War)
    18:28:09.845 [system.io] [info] exists:   found mods/ebii/data/ui/cul_3/portraits/portraits/dead/070.tga (from: E:\SteamGames\steamapps\common\Medieval II Total War)
    18:28:09.845 [system.io] [info] exists:   found mods/ebii/data/ui/cul_3/portraits/portraits/dead/070.tga (from: E:\SteamGames\steamapps\common\Medieval II Total War)
    18:28:09.845 [system.io] [info] exists:   found mods/ebii/data/ui/cul_3/portraits/portraits/dead/070.tga (from: E:\SteamGames\steamapps\common\Medieval II Total War)
    18:28:09.845 [system.io] [info] exists:   found mods/ebii/data/ui/cul_3/portraits/portraits/dead/070.tga (from: E:\SteamGames\steamapps\common\Medieval II Total War)
    18:28:09.845 [system.rpt] [error] Unspecified error. Please compress your error log in a zip format and upload it on the EBII technical help forum.
    Not sure if there's something in that tga file that's problematic for some machines or something.

Page 1 of 3 123 LastLast

Posting Permissions

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