Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 1.28 KB

File metadata and controls

27 lines (19 loc) · 1.28 KB

Scripted function modding

Scripted functions let modders disable hardcoded actions under given conditions. All scripted functions entries are fixed, you cannot add more. Many hardcoded actions furthermore have hardcoded conditions that are not listed in scripted functions, which unfortunately means that this limitation cannot be removed.

Scripted functions can have multiple "condition" blocks, which consist of a tooltip, a potential and an allow section. For scripted functions about province-level actions, ROOT is the province and FROM is the country doing the action.

Potential is the trigger for the condition to apply. If this is true, the country cannot do the action. Potential also defines whether the tooltip is shown.

Allow is the trigger for the condition to be ignored. If this is true, the country can do the action, despite the Potential trigger.

Example, a condition that restricts colonial nations to only colonize within their capital's colonial region:

   can_colonize_province = {
       condition = {
           tooltip = "colonial_expansion_limit_tooltip"
           potential = {
               FROM = { is_colonial_nation = yes }
           }
           allow = {
               FROM = { capital_scope = { colonial_region = ROOT } }
           }
       }
   }