Page 1 of 4 1234 LastLast
Results 1 to 20 of 63

Thread: Forced Diplomacy v1.2

  1. #1
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Forced Diplomacy v1.2

    Forced Diplomacy (M2TW/Kingdoms)

    This was something made available in RTW but apparently nobody has written one for M2TW, so here it is.

    It forces the AI to accept any diplomacy offer/demand. NOTE: it does not work with Bribes.

    To use it just click the advise/help button on the diplomacy scroll. This activates the advisor who will tell you what to do: just click the "show me how" button (click on the advisor portrait to activate that button). If the advisor text isn't appearing then try toggling its text/speech button.

    Clicking the "Show me how" button will activate Forced Diplomacy mode. This will force the AI to accept any offers and demands made while this scroll is open, except for Bribes. Sometimes they will refuse because you have offered nothing in return: offer them something, however small, and they will accept. Bribes and Gifts do not count: you must Offer them something (anything) and Demand something other than Payment/Tribute.

    There are a couple of threads/posts about the place explaining how to do it for RTW (e.g. this one). The M2TW solution is almost identical.

    I originally wrote it as part of my Total Diplomacy submod for Third Age TW, which also includes one or two other features not included in the files and instructions here.

    The attached file is for the Kingdoms grand campaign but you can use the instructions to enable it for non-Kingdoms M2TW, Kingdoms campaigns (Brittania etc.), and mods of any of these.

    You will need to have unpacked files. This post explains it for Kingdoms.

    Instructions
    (For an unmodified Kingdoms grand campaign you can just follow the "Installation" instructions instead.)

    In export_descr_advice.txt add these two entries:

    This goes in the top section, before the trigger section:
    Code:
    ;------------------------------------------
    AdviceThread forced_diplomacy_help_clicked_thread
        GameArea Campaign
    
        Item forced_diplomacy_help_clicked_Text_01
            Uninhibitable
            Verbosity  0 
            Priority  0 
            Threshold  1 
            MaxRepeats  0 
            RepeatInterval  1 
            Attitude Normal
            Presentation Default
            Title forced_diplomacy_help_clicked_Text_01_Title
            Script scripts/show_me/ForcedDiplomacy.txt
            Text forced_diplomacy_help_clicked_Text_01_Text1
    This goes into the trigger section, the second part of the file:
    Code:
    ;------------------------------------------
    Trigger forced_diplomacy_help_clicked_trigger
        WhenToTest ScrollAdviceRequested
    
        Condition ScrollAdviceRequested diplomacy_scroll
     
        AdviceThread forced_diplomacy_help_clicked_thread  1
    In text\export_advice.txt add these to the bottom of the file:
    Code:
    {forced_diplomacy_help_clicked_Text_01_Title}Forced Diplomacy
    {forced_diplomacy_help_clicked_Text_01_Text1}Clicking the "Show me how" button will activate Forced Diplomacy mode. 
    This will force the AI to accept any offers and demands made while this scroll is open, except for Bribes.\n\nSometimes they
    will refuse because you have offered nothing in return: offer them something, however small, and they will accept.
    (NOTE: the text for {forced_diplomacy_help_clicked_Text_01_Text1} should all be one line. I have split it over multiple lines here because it was interfering with the rendering of some text in this post in Firefox.)

    In the scripts\show_me folder (create one if it doesn't exist) create a file named ForcedDiplomacy.txt and put this inside it:
    Code:
    script
    
    ;close advisor
    select_ui_element advisor_dismiss_button
    simulate_mouse_click lclick_up
    while I_AdvisorVisible
    end_while
    
    suspend_unscripted_advice true
    declare_show_me
    
    ;do nothing if diplomacy scroll not open. In case advisor still showing after scroll closed and player then clicks showme.
    if I_ScrollOpen diplomacy_scroll
    
        console_command force_diplomacy accept
    
        ;wait until scroll is closed
        while I_ScrollOpen diplomacy_scroll
        end_while
    
        console_command force_diplomacy off
    
    end_if
    
    end_script
    If you are editing the grand campaign (not a mod) then you will need to rebuild the text\export_advice.txt.strings.bin file. If you don't know how to do that then maybe using the attached download is the better way to go.

    If you are doing this for a mod (under the "mods" folder) then you might need to delete this file:
    • {M2TW}\mods\{mod name}\data\text\export_advice.txt.strings.bin



    Installation
    This is for using the attached files; Kingdoms grand campaign only. It might work on other versions/campaigns/mods but do so at your own peril. So long as you backup then you're okay: if it breaks something then restore the backups and try doing it manually instead.

    Backup the files that it replaces:
    • {M2TW}\data\export_descr_advice.txt
    • {M2TW}\data\text\export_advice.txt
    • {M2TW}\data\text\export_advice.txt.strings.bin

    Save the attachment and unzip it into your M2TW folder, overwriting the files there.


    This is save game compatible.

    See this post about a non-advisor (campaign script) alternative.

    ~~~~~~~~~~~~
    Attached Files Attached Files
    Last edited by Withwnar; May 17, 2019 at 10:46 PM.

  2. #2
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Forced Diplomacy (M2TW/Kingdoms)

    There was a bug in the above: force_diplomacy would remain "on" after use. That post and its attachment have been fixed to turn it off again when the scroll closes.

  3. #3

    Default Re: Forced Diplomacy

    My game exits and gives the general "Medieval 2 has encountered an unspecified error and will now exit" the moment I click on the little question mark in the corner. I deleted those two files and extracted the zip file to the data folder as suggested. I must've messed up somewhere... can you think of anything that might be wrong?

  4. #4
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Forced Diplomacy

    Strange. Can you confirm that these files exist...

    {M2TW}\data\export_descr_advice.txt
    {M2TW}\data\text\export_advice.txt
    {M2TW}\data\scripts\show_me\ForcedDiplomacy.txt

    ... and that the game has rebuilt this file...

    {M2TW}\data\text\export_advice.txt.string.bin

    Also, does it crash when you click the advise button (question mark) on any other scroll?

  5. #5

    Default Re: Forced Diplomacy

    Thanks for the quick reply!
    I confirmed they exist.
    My file is there; export_advice.txt.strings.bin. I tried deleting it and seeing if the game would recreate it, but it did not (I put it back afterwards). Is there any way I can force that? It might be the issue. Also, the other file that I deleted wasn't recreated either (not sure if it was supposed to be).
    It doesn't crash when I try it on other scrolls.

  6. #6
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Forced Diplomacy

    When you tested the other scrolls was that after you had put back export_advice.txt.strings.bin? If so then try deleting it first and then test other scrolls.

    And export_descr_advice.txt.strings.bin did exist did it? I can't find it anywhere on my PC and was starting to think that there is no such file.

  7. #7

    Default Re: Forced Diplomacy

    I deleted it and the other scrolls still worked.
    I can't locate export_descr_advice.txt.strings.bin either; I guess I just assumed I had deleted it.

  8. #8
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Forced Diplomacy

    Are you using Vista/Win7 by any chance? I wonder if there's another copy of export_advice.txt.strings.bin somewhere and the game is using that one.

  9. #9

    Default Re: Forced Diplomacy

    I'm on Windows 7. I searched for it (I figured this wasn't an important detail because I don't recall it doing anything to the Grand Campaign, but I have the Third Age mod) and didn't find one aside from what I'd been moving in and out of the folder to test.

  10. #10
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Forced Diplomacy

    Aha! Some success I think...

    Can you try unzipping the attached into {M2TW}\data\text ... it should be replacing export_advice.txt and - if it exists - export_advice.txt.strings.bin.

    Don't delete the strings.bin file - just run the campaign.

    My apologies. I had only tested this on a Bare_Geomod Kingdoms GC which lives under the mods folder. Apparently the strings.bin files are only rebuilt for mods and not the base M2TW/Kingdoms files - I didn't know that.

    If this works then I'll update the OP's attachment.

  11. #11

    Default Re: Forced Diplomacy

    That worked! Many thanks Withwnar!

  12. #12
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Forced Diplomacy v1.2

    Excellent. Thanks for letting me know. The OP has been updated.

  13. #13
    Mr_Nygren's Avatar Berserkir
    Join Date
    Mar 2009
    Location
    Sweden
    Posts
    4,351

    Default Re: Forced Diplomacy v1.2

    Quote Originally Posted by Withwnar View Post
    Excellent. Thanks for letting me know. The OP has been updated.

    Hi, why can´t you make it force the AI into accepting bribes? I am playing "Hyrule Total War" and i can't get the character "Vordna" to join me and my Twilight army.. She has a big Twiliarmy so i want to force her.. But she won't accept..

  14. #14
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Forced Diplomacy v1.2

    The question is really "why doesn't the force_diplomacy command affect bribes?". That I don't know.

  15. #15

    Default Re: Forced Diplomacy v1.2

    I cant get this to work with De bello mundi. The text is there when the advisor pops up but the show me how button is greyed out
    "To say of what is that it is not, or of what is not that it is, is false, while to say of what is that it is, and of what is not that it is not, is true" ~ Aristotle

  16. #16
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Forced Diplomacy v1.2

    Check that the filename is correct and in the right place:

    {M2TW}\mods\{mod}\scripts\show_me\ForcedDiplomacy.txt

    Also beware of Windows' "brilliant" idea of hiding filename extensions by default. Make sure it is actually named ForcedDiplomacy.txt and not ForcedDiplomacy.txt.txt

  17. #17
    Withwnar's Avatar Script To The Waist
    Join Date
    Oct 2008
    Location
    Earth
    Posts
    6,329

    Default Re: Forced Diplomacy v1.2

    P.S. Also check the log. If the problem is due to a wrong filename/location then it will say so: "Couldn't open the script file scripts/show_me/ForcedDiplomacy.txt"

  18. #18

    Default Re: Forced Diplomacy v1.2

    Quote Originally Posted by Withwnar View Post
    {M2TW}\mods\{mod}\scripts\show_me\ForcedDiplomacy.txt
    Ah that was it, i just had it in the scripts folder and not in show_me folder. Cant believe i overlooked that.

    Cheers.
    "To say of what is that it is not, or of what is not that it is, is false, while to say of what is that it is, and of what is not that it is not, is true" ~ Aristotle

  19. #19
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Forced Diplomacy v1.2

    I haven't really played with the show_me scripts before - but I think I may be able to use it for the display of mission goals. Not the vanilla missions but something like 'conquer region A, B and C to be crowned king of New Foundland'










  20. #20

    Default Re: Forced Diplomacy v1.2

    Well I was gonna right this differently, until I realized to my shock there was actually activity today on it. The original mod didn't work for me (also the file links don't work) so I'll just link to Post Hoc's mod which worked fine for me (even though I'm not using DBM)
    http://www.twcenter.net/forums/showt...rced-Diplomacy


    PS. Returned to a year old med campaign today, started looking for a forced diplomacy mod. Can't believe there is activity in a thread on it TODAY, what a lucky coincidence! Worked like a charm!
    Summary: A pagan red byzantine Empire rebuilds the legacy of old Rome, Liberating Europe from the Christian Barbarians, and liberating the Middle east from Islam (including Mecca, which returned to idol worship ). The Romans appreciate the Paganism of these strange Aztecs, but find their gods unsuitable and quickly replace them. Unfortunately, the AI, particularly the Catholic factions became obstinate despite my perfectly reasonable and justified goals of liberation, and force_diplomacy was required.

Page 1 of 4 1234 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
  •