Decisions modding
![]() |
Please help improve this article or section by expanding it with: examples, advanced uses. |
Decisions can be modded into the game. They are optional actions that count rulers or above may take.
Location[edit | edit source]
Decisions belong in .txt files in the mod's common\decisions
folder. Each text file may contain multiple decisions.
Structure[edit | edit source]
Decisions may be defined like so:
my_decision = { # Put keys, etc. here }
The part that says my_decision
is called the name or key of the decision. It can be anything you want, but it should be unique. If you define another decision with the same name, one of them will override the other (depending on which one is loaded last). It is common practice to give decisions names that end with "_decision".
Keys/blocks[edit | edit source]
The table below shows keys and blocks that may be defined. "Boolean" values may be either yes or no.
Key/block | Type | Description | Example |
---|---|---|---|
picture | String (file name) | Sets the image of the decision. |
picture = "image_name.dds" |
extra_picture | String (file name) | An extra picture, currently used by Struggle decisions | |
major | yes/no | Whether the decision will be grouped among the ones at the top of the decisions panel. Major decisions are automatically 'important', which means a notification will be shown to the player when they can be taken. | |
sort_order | Number | How high in the list of decisions this decision should be placed. Higher numbers are sorted above lower numbers. | |
is_invisible | yes/no | ||
ai_goal | yes/no | The AI will budget for this decision. ai_check_interval will be ignored if this is set.
|
|
ai_check_interval | Integer | How many months to go between each check of this decision. Has to be set, except if ai_goal = yes is set. An interval of 0 means the AI will never check this decision | |
cooldown | Block | How long the decision will be unavailable after it has been taken. Can be in years, months, or days. | cooldown = { years = 5 } |
confirm_click_sound | String | A sound file to play | confirm_click_sound = "event:/DLC/FP2/SFX/UI/fp2_struggle_ending_decision_confirm" |
selection_tooltip | Localization key or block | Overrides the default tooltip for this decision on the decision panel. The default is the decision name plus "_tooltip". It can also be a block like in event descriptions. | |
title | Localization key or block | Overrides the default localization key for the decision title, which is normally the same as the decision name. It can also be a block like in event descriptions. | |
desc | Localization key or block | Overrides the default localization key for the description, which is the decision name plus "_desc".
It can also be a block like in event descriptions. |
desc = start_hunt_decision |
confirm_text | Localization key or Block | Overrides the default localization key for the text on the confirm button, which is the decision_name plus "_confirm".
It can also be a block like in event descriptions. |
|
is_shown | Trigger | This determines the conditions required for the decision to appear in the decisions tab. | is_shown = { has_royal_court = yes } |
is_valid_showing_failures_only | Trigger | Can this decision be taken now? Both this trigger and is_valid must be satisfied. The tooltip for this trigger only shows conditions that were not met.
|
is_valid_showing_failures_only = { is_available_adult = yes is_at_war = no } |
is_valid | Trigger | Can this decision be taken now? Both this trigger and is_valid_showing_failures_only must be satisfied.
|
is_valid = { piety_level >= 3 } |
cost | Block | Sets the cost of the decision in terms of gold, piety and prestige. The default value for each resource is zero. Not every resource has to be defined. The values can be script values. |
cost = { gold = 42 piety = 42 prestige = 42 } |
minimum_cost | Block | Like cost , but the character only needs to have that much available. The cost is not deducted when the decision is taken. Useful when the real cost is scripted in events triggered from this decision, and similar cases.
| |
effect | Block | What the decision will do when it is taken. | add_character_modifier = { modifier = vow_of_poverty_modifier } |
ai_potential | Trigger | Whether the AI will consider this decision. | ai_potential = { always = yes } |
ai_will_do | Block | A calculation of the % chance the AI will take this decision when considering it. | ai_will_do = { base = 100 } |
should_create_alert | Trigger | This trigger is checked when the decision would otherwise notify the player that it can be taken. If the trigger is not satisfied, the alert is not shown. This can be good to add if there are situations where taking the decision is possible but not useful. | should_create_alert = { gold >= 50 } |
widget | String or Block | A custom widget for this decision. It must specify a gui that has a file under gui/decision_view_widgets/ and usually needs extra items to be specified for the widget. Rarely needed.
|
widget = { gui = "decision_view_widget_commission_artifact" controller = decision_option_list_controller ... } |
Values[edit | edit source]
You can define settings (usually at the top of the file) that can be used in the decisions in place of directly writing numbers. This can be useful to avoid repeating yourself, to avoid subtle errors when you change a value in one place but not in another, or simply to emphasize that the value can be adjusted for balance reasons.
For example:
@sale_of_titles_prestige_cost = 500 sale_of_titles_decision = { ... stuff ... cost = { prestige = @sale_of_titles_prestige_cost } ... stuff ... }
Basic example[edit | edit source]
custom_decision = { picture = "custom_decision.dds" desc = custom_decision_desc selection_tooltip = custom_decision_tooltip is_shown = { # Put conditions for the decision to show up here. } effect = { # Add effects of the decision here. } ai_check_interval = 0 # Change this value if you want the AI to consider this decision. }
Localization[edit | edit source]
When you create a decision, you must also add entries to the Localization files to describe the decision to the player. For example you can create a file localization/english/my_decisions_l_english.yml
to hold the entries relating to decisions you created. See the Localization page for more on how to do that.
Every decision needs at least four entries:
- One that's identical to the decisions's name, so if you have
my_decision
, you should have a keymy_decision:
in the localization file. This gives the title of the decision, shown in the list on the decisions panel. - One that's equal to the decision's name plus "_desc", so for example
my_decision_desc:
. This gives the longer description on the window that you get when you click on the decision. - One that's equal to the decision's name plus "_tooltip", so for example
my_decision_tooltip:
. This gives the tooltip that is shown when you hover over the decision's title. - One that's equal to the decision's name plus "_confirm", so for example
my_decision_confirm:
. This gives the text on the button that takes the decision.
If you want, the default names of these localization entries can be changed with the title
, desc
, selection_tooltip
, and confirm_text
entries in the decision. This can be useful if you want to make multiple decisions with the same localization.
Testing Decisions[edit | edit source]
Sometimes, when testing a mod, it is useful to automatically refresh the cooldown of a decision (for example, if testing an on-action triggered when a hunt or a feast begins). This can be done by running effect remove_decision_cooldown = decision_id
. See below for a list of ids for built-in decisions.
Decision ID[edit | edit source]
Each decision uses an internal ID for reference within the game's files. The internal name of a decision in the game's files can be found by following these steps:
- Take the decision's name.
- Turn all letters into lowercase (
A...Z->a...z
). - Replace spaces (
_
). - Add
_decision
to the end.
Decisions with in-game names that do not match their internal name are included in the table below:
Decision | Internal name |
---|---|
Call Hunt | start_hunt |
Search for Physician | hire_physician |
Borrow Gold from Holy Order | borrow_from_holy_order |
Challenge the Ruler | tribal_challenge_ruler |
Stop Gaining Weight | stop_gain_weight |
Stop Losing Weight | stop_lose_weight |
Attempt Suicide | commit_suicide |
Return Roma | return_rome |
Determine Bhakti | select_personal_deity |
Give Your Ancestor a Sky Burial | give_sky_burial |
Raise a Runestone | raise_runestone |
Found Holy Order | create_holy_order |
Revoke Holy Order Lease | cancel_holy_order_lease |
Go on a Pilgrimage | go_on_pilgrimage |
Undertake the Hajj | go_on_hajj |
Restore the Kingdom of Cornwall | restore_dumnonia |
Reclaim Constantinople | set_capital_constantinople |
Reclaim Rome | set_capital_rome |
Restore the Papacy | restore_papacy |
Form the Swiss Confederation | form_switzerland_kingdom |
Form Archduchy of Austria | form_austria_kingdom |
Dismantle the Papacy | dismantle_papacy |
Restore Carolingian Borders | reform_carolingian_empire |
Unify the Burgundies | unify_burgundy_kingdom |
Unify Italy | unify_italian_empire |
Adopt Feudalism (unused) | convert_to_feudalism |
Adopt Feudal / Clan Ways through Liege | convert_to_feudalism_liege_converted |
Adopt Feudal / Clan Ways | convert_whole_realm_to_feudalism |
Form the Outremer Empire | create_outremer_empire |
Sell Minor Titles | sale_of_titles |
Restore the Ash'ari Caliphate | restore_sunni_caliphate |
Restore Israel | create_israel_kingdom |
Restore the Faith High Priesthood | jewish_restore_high_priesthood |
Restore the Faith High Priesthood | zoroastrian_restore_high_priesthood |
Become the Saoshyant | become_saoshyant |
Dismantle German Pretenders | dismantle_holy_pretender |
Dismantle Greek Pretenders | dismantle_byz_pretender |
Form the Sultanate of Rum | form_rum_sultanate |
Revive Greater Armenia | create_armenian_empire |
Consecrate Bloodline | declare_bloodline_holy |
Build a Grand Church | build_grand_church |
Faith Cannibalism | accept_cannibalism |
Request Claim on Ireland | england_request_laudabiliter |
Inspire Opus Francigenum | promote_gothic_innovations |
Build a Glass Monument | lunatic_building |
Promote Christian Settlements | promote_hungarian_settlement |
Revive Táltosism | revive_magyar_paganism |
Unite the West Slavs | unite_the_western_slavs |
Unite the South Slavs | unite_the_southern_slavs |
Defenders of High God | defenders_of_highgod |
Found a New Kingdom | found_kingdom |
Found a New Empire | found_empire |
Amnesty for False Conversions | encourage_confession_of_false_conversions |
Restore the Holy Roman Empire | restore_holy_roman_empire |
Adopt Special Succession Type | adopt_special_succession |
Found the Kingdom of Aragon | form_the_kingdom_of_aragon |
Indulge in Drink | stress_loss_drunkard |
Consume Hashish Cakes | stress_loss_hashishiyah |
Visit a Brothel | stress_loss_rakish |
Seclude Yourself | stress_loss_reclusive |
Lash Out | stress_loss_irritable |
Flagellate | stress_loss_flagellant |
Visit the Market | stress_loss_profligate |
Donate to Charity | stress_loss_improvident |
Confess | stress_loss_contrite |
Indulge in Food | stress_loss_comfort_eater |
Shun Food | stress_loss_inappetetic |
Write Thoughts Down | stress_loss_journaller |
Talk to Confidant | stress_loss_confider |
Work off Some Stress | stress_loss_athletic |
Accuse the Krstjani of Heresy | accuse_krstjani_of_heresy |
Prepare to Cross the Carpathians | launch_hungarian_migration |
Restore the Roman Empire | restore_roman_empire (as Byzantine Emperor) restore_roman_empire_holy (as Holy Roman Emperor) restore_roman_empire_italian (as Emperor of Italia) |
Host Grand Rite | host_witch_ritual_decision |
Documentation | Effects • Triggers • Modifiers • Scopes • Variables • Data types • Localization • Customizable localization |
Scripting | AI • Bookmarks • Characters • Commands • Council • Culture • Decisions • Dynasties • Events • Governments • History • Holdings • Lifestyles • Regiments • Religions • Story cycles • Titles • Traits |
Map | Map • Terrain |
Graphics | 3D models • Exporters • Interface • Coat of arms • Graphical assets • Fonts • Particles • Shaders • Unit models |
Audio | Music • Sound |
Other | Console commands • Checksum • Mod structure • Modding tools • Troubleshooting |