Diplomatic action modding
There are two methods to modifying diplomatic actions: controlling the conditions of hard-coded interactions in /Europa Universalis IV/common/diplomatic_actions, and adding new interactions in /Europa Universalis IV/common/new_diplomatic_actions
Diplomatic actions[edit | edit source]
The 00_diplomatic_actions.txt file in /Europa Universalis IV/common/diplomatic_actions controls the conditions for vanilla diplomatic actions, such as royal marriage. You can add effects to these actions, but cannot remove the ones that are present in vanilla.
To do so, you add a condition scope to the appropriate action scope, creating the action scope if it does not exist. For example, if you wanted to prevent study_technology from being used if the current country is a republic, you'd do the following:
study_technology = { condition = { tooltip = CANNOT_STUDY_TECHNOLOGY potential = { government = republic } allow = { always = no } } }
The potential here is used to limit when the condition is applied. The allow on the other hand is used to restruct when the action is blocked.
You can add a tooltip with the tooltip line, which appears when the condition is valid and is disallowing the action.
The general format is:
<action> = { condition = { tooltip = <string> potential = { <triggers> } allow = { <triggers> } } }
Hardcoded limitations[edit | edit source]
Certain diplomatic actions appear to be hardcoded and cannot be modified at all. The known ones are :
- charter_company
- fabricate_claim (Only seems to work for the province view fabricate instead of the diplomatic action)
- slander_merchants
- sabotage_recruitment
- corrupt_officials
New diplomatic actions[edit | edit source]
The 00diplomatic_actions.txt file in /Europa Universalis IV/common/new_diplomatic_actions is used to implement new diplomatic actions. You can create new files for new actions.
<action> = { category = <category> # Which diplomatic action list the action will appear in. alert_index = <int> # The alert to use for the action. Refer to static_actions for the indexes. Optional. alert_tooltip = <key> # The localisation key to display in the alert tooltip. Optional. require_acceptance = yes / no # Whether the action needs to be accepted by the target country for the accept effect to execute. # Determines when the action is visible is_visible = { <triggers> } # Determines when the action can be taken is_allowed = { <trigger> # variable_arithmetic_trigger can be used here to use export_to_variable to extract and compare values such as ruler_age, etc } # Which effects to execute on acceptance on_accept = { <effects> } # Which effects to execute on decline (if declinable). Optional. on_decline = { <effects> } # Controls the AI's acceptance of the action, if acceptable. Optional. ai_acceptance = { # Add an AI factor entry add_entry = { name = <key> # The localisation key to display for this factor # Restricts this entry to the countries that validate the triggers. Optional. limit = { <triggers> } # ai_value MUST always be created within an entry first. export_to_variable = { variable_name = ai_value value = <exportable value> # Which exportable value to export who = FROM # Who to export the value from with = THIS # Who the ai_value is for } # You can then change ai_value with effects such as multiply_variable, etc } } # Controls the AI's usage of the action ai_will_do = { <triggers> } }
is_allowed makes use of the variable arithmetic trigger, for more information see Variables. Look at the examples in the 00diplomatic_actions.txt file as well for further understanding.
ROOT is the country using the action, FROM is the country being targeted for the action.
Categories[edit | edit source]
The diplomatic action category types:
- alliance
- influence
- relation
- dynasty
- covert
- economy
- access
- emperor
- papacy
- great_powers
Localisation[edit | edit source]
New diplomatic actions need the following localisation keys defined:
<action>: "Action" <action>_title: "Action" <action>_desc: "Description" <action>_tooltip: "Description" <action>_alert_tooltip: "Action"
Documentation | Effects • Triggers • Modifiers • Scopes • Variables • Localisation • Customizable localization • Run files |
Scripting | Scripted function • Advisors • Ages • Bookmarks • Buildings • Casus belli • Colonial regions • Countries • Culture • Decisions • Defines • Diplomatic actions • Disasters • Empire of China • Estates • Events • Factions • Government • Great projects • History • Holy Roman Empire • Idea groups • Institutions • Mercenaries • Missions • Modifiers • Nation designer • On Actions • Parliament • Peace treaties • Policies • Rebel types • Religion • Subject types • Technology • Trade companies • Trade goods • Units |
Map | Map • Nation designer • Random New World • Trade nodes |
Graphics | 3D Models • Interface • Graphical Assets • Fonts • Particles • Shaders • Unit models |
Audio | Music • Sound |
Other | Console commands • Checksum • JoroDox mod making tool • Mod structure • Troubleshooting • The Validator • Run files |
Guides | Adding a province • Save-game editing |