How to add a "force diplomacy" option.
These instructions are for vanilla RTW. If you are trying to add this to another mod, you may need to add in the advice thread and the trigger from step 1.
You need to modify two files...
data/export_descr_advice.txt
data/text/export_advice.txt
...and add one.
data/scripts/show_me/Force_Diplomacy.txt
1. data/export_descr_advice.txt
Replace the existing Help_UI_Panel_Diplomacy_Early_Advice_Thread with this:
Code:
;------------------------------------------
AdviceThread Help_UI_Panel_Diplomacy_Early_Advice_Thread
GameArea Campaign
Item Help_UI_Panel_Diplomacy_Early_Advice_Text_01
Suppressible n
Uninhibitable
Verbosity 0
Threshold 1
Attitude Normal
Presentation Default
Title Help_UI_Panel_Diplomacy_Early_Advice_Text_01_Title
Script scripts\show_me\Force_Diplomacy.txt
Text Help_UI_Panel_Diplomacy_Early_Advice_Text_01_Text1
Replace the existing 2085B_UI_Panel_Diplomacy_Help_Trigger trigger with this:
Code:
;------------------------------------------
Trigger 2085B_UI_Panel_Diplomacy_Help_Trigger
WhenToTest ScrollAdviceRequested
Condition ScrollAdviceRequested diplomacy_scroll
AdviceThread Help_UI_Panel_Diplomacy_Early_Advice_Thread 0
2. data/text/export_advice.txt (optional)
Replace the existing Help_UI_Panel_Diplomacy_Early_Advice entries with these:
Code:
¬-------------------
{Help_UI_Panel_Diplomacy_Early_Advice_Text_01_Title} Force Diplomacy
{Help_UI_Panel_Diplomacy_Early_Advice_Text_01_Text1}
You can force this faction to accept your offer by clicking on the "show me how" button.
3. data/scripts/show_me/Force_Diplomacy.txt
Here's the script itself. You will have to create this file with notepad or similar and save it in data/scripts/show_me/.
Code:
script
declare_show_me
declare_counter loop
monitor_event AbandonShowMe TrueCondition
suspend_unscripted_advice false
console_command force_diplomacy off
terminate_script
end_monitor
monitor_event ScrollClosed ScrollClosed diplomacy_scroll
ui_flash_stop
suspend_unscripted_advice false
console_command force_diplomacy off
terminate_script
end_monitor
suspend_unscripted_advice true
console_command force_diplomacy accept
while I_CompareCounter loop = 0
end_while
suspend_unscripted_advice false
end_script