Diplomatic action modding

From Europa Universalis 4 Wiki
Jump to navigation Jump to search

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 = {
        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 = {
        allow = {

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 = {
    # Determines when the action can be taken
    is_allowed = {
        # 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 = {
    # Which effects to execute on decline (if declinable). Optional.
    on_decline = {
    # 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 = {
            # 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 = {

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 EffectsTriggersModifiersScopesVariablesLocalisationCustomizable localizationRun files
Scripting Scripted functionAdvisorsAgesBookmarksBuildingsCasus belliColonial regionsCountriesCultureDecisionsDefinesDiplomatic actionsDisastersEmpire of ChinaEstatesEventsFactionsGovernmentGreat projectsHistoryHoly Roman EmpireIdea groupsInstitutionsMercenariesMissionsModifiersNation designerOn ActionsParliamentPeace treatiesPoliciesRebel typesReligionSubject typesTechnologyTrade companiesTrade goodsUnits
Map MapNation designerRandom New WorldTrade nodes
Graphics 3D ModelsInterfaceGraphical AssetsFontsParticlesShadersUnit models
Audio MusicSound
Other Console commandsChecksumJoroDox mod making toolMod structureTroubleshootingThe ValidatorRun files
Guides Adding a provinceSave-game editing