Hoi4 modding Wiki
Register
Advertisement

Definition[]

The operators are a special list of characters and keywords that are used in many placed to represent certain arithmatic ideas.

Base operators[]

Operator Sign Definiton
Equals = Ironically, the equals sign does not set any values, but adds any value behind it to any already existing or default modifiers or compares two different values as part of triggers.
(equals) Curly Brackets = { } This operator is used to define an object as part of another. The object is defined between the curly brackets.
Bigger than

Smaller than

>

<

Mostly used as part of triggers, these operators are used to compare numbers. Even though all modifiers are numbers, most modifiers cannot be used with these operators as part of triggers, which is an oversight by Paradox.

Special operators[]

Operator Sign Definition
YES yes Defines that something is true and enabled.
NO no Defines that something is false and disabled.
LIMIT LIMIT = { } Some operators allow limits to be placed within them. If limit is used as part of a list of effects, the effects (outside the limit) will only happen if all triggers within the limit are met.
HIDDEN_EFFECT HIDDEN_EFFECT = { } When a list of effects can be written, all those that are between the brackets will not be shown within the focus, event option and etc.
IF IF = { } Used to make a subgroup of effects. Any effects inside the brackets will only be executed if the triggers within the limit operator (see above) are met within it.
ELSE IF = { } ELSE = { } Can only be used right after IF is used, If the conditions within the LIMIT of IF aren't met, then ELSE applies.
AND AND = { } Although not used often, AND can be used instead of a single trigger to group triggers together, so that all of triggers mentioned within it must be true. AND is mostly useless, because most places except the OR operator below and the focus bypass keyword already allow mentioning multiple triggers that all must be true to continue.
OR OR = { } OR can be used instead of a single trigger, to group triggers together. If any of the triggers mentioned within the brackets are true, then OR is considered true.
NOT NOT = { } NOT allows a group of triggers within it to be used in reverse, essentially excluding countries where all conditions within it are met. It is important to understand the triggers within NOT must all be true for NOT to work and become false.

[]

Country operators[]

Operator Sign Definition
TAG [ tag ] = { } this operator is used to continue any possible triggers, effects or modifiers as another country. For example the trigger "has_war = no" by default checks if you have no war. but GER = { has_war = no } checks if Germany has no war instead.
ROOT ROOT ROOT can be used instead of a country tag, in any scenario where a country tag would be acceptable. When used, it refers to the original country before any other operators.
FROM FROM FROM is used in the same way as ROOT, but can only be used in certain actions and events. FROM denotes the "other" involved country, that instigated the effect.
PREV PREV PREV is used in the same way as ROOT, but can only be used in scripts after switching the selected country. PREV becomes the previously selected country or state within that script.
any other country any_other_country = { } Only works as part of triggers, will check if all triggers inside the brackets are applicable to any other country.
every other country every_other_country = { } Used as part of effects. all other countries will get the effects within the brackets, unless a limit is also defined within the brackets. Does NOT work as a trigger. (see above operator instead.)
every neighboring country every_neighbor_country = { } Used as part of effects. all neighboring countries will get the effects within the brackets. Does not include itself.
random other country random_other_country = { } Used as part of effects. Inside the value the limit operator is often used to find specific countries. Essentially it makes a list of a countries that fit the limit operator, and then picks a random one among them to execute the effect on.

State operators[]

Operator Definition
any_owned_state Trigger, any owned state needs to match the conditions within.
any_neighbour_state Trigger, any state that borders your country needs to match the conditions within.
random_owned_state Effect, applied to a random owned state.
random_owned_controlled_state Effect, applied to a random owned and controlled state. (in case of war, an owned state might not be under your control)
any_state Trigger, If any state worldwide meets all conditions within
random_state Effect for a random worldwide state.
every_state Effect, happens for every state worldwide.
every_owned_state Effect, happens for every owned state.
all_state Trigger, all states worldwide must meet the conditions within.
all_owned_state Trigger, all states within your country must meet the conditions within.
Advertisement