Effects

Effects (also known as Commands) are used in order to affect the game dynamically from within a specific scope.

Effects are used throughout the game in numerous scopes, most commonly National Focuses, Events and Decisions.

See Variables for information on the variable effects.

Note that certain effects may take a value from a variable, i.e.

.

This is noted by   in an effect's parameters.

Any Scope
Can be used in country, state or unit leader scopes.

Country Scope
The effects here must be used within a country scope.

State Scope
The effects here must be used within a state scope.

Unit Leader Scope
The effects here must be used within a unit leader scope.

Flow Control
These scopes are used within effect scopes to control the execution of effects.

If, Else If and Else
These scopes allow effects to be conditionalized, so they only occur when the requisite triggers are met.

For example, if you only have an effect to occur for Germany, you'd do the following:

if = { limit = { original_tag = GER }      add_stability = 0.1 }

If you then wanted England to have a similar effect, and everyone else to have something else, you do the following:

if = { limit = { original_tag = GER }      add_stability = 0.1 } else_if = { limit = { original_tag = ENG }   add_stability = 0.25 } else = { add_stability = 0.05 }

As you can see, this allows for flexibility in how effects occur and cuts down on duplication.

Hidden Effect
This scope hides the presence of the effects within it in the player's tooltip. This is used to execute effects without the player seeing them. For example, you may want to manipulate some variables in an event. Showing them to the player may confuse them, so it is best to hide the effects within an hidden effect scope, like so:

hidden_effect = { set_variable = { my_var = 100 } }

Random List
This scope allows the creation of a random selection of effects. For example, if you wanted an effect to randomly given the player one out of four bonuses, you'd do the following:

random_list = { 25 = {       add_stability = 0.5 }   25 = {        add_manpower = 10000 }   25 = {        add_war_support = 0.5 }   25 = {        army_experience = 100 } }

Note that if you want to create a repeatable decision including a random list, by default the same decision will pick the same random result every time it is triggered in a game. You can reverse this behaviour by including the following line in the decision block: fixed_random_seed = no

Effect Tooltip
This scope will display the tooltip information of the effects within, without actually executing the effects. This is useful when you want to show what the effect may look like to the player. Here is an example:

effect_tooltip = { every_owned_state = { add_manpower = 10000 } }