Event Commands

From Hearts of Iron 3 Wiki
Jump to navigation Jump to search

Event Commands for creating and editing events in Hearts of Iron 3.


Event Scopes

When specifying a country, the three-letter country tag is used (e.g. GER for Germany). The list of country tags is defined in /common/countries.txt. If you intend to do much event modding it is a good idea to learn the country tags for most of the important nations in the game.

When specifying a province, the numeric province code is used (e.g. 2613 for Paris). The province code numbers (along with province characteristics) are defined in /history/provinces/. Be aware some mods may change province codes from the standard ones, particularly for major provinces.

Country Scopes - effects

any_country
Any available country.
Syntax: any_country = { effects… }
any_neighbor_country
Any country neighboring the current country.
Syntax: any_neighbor_country = { effects… }
any_neighbor_province
Any province neighboring the current province.
Syntax: any_neighbor_province = { effects… }
any_owned
Any owned province.
Syntax: any_owned = { effects… }
capital_scope
Capital of the current country.
Syntax: capital_scope = { effects… }
“country tag”
The specified country.
Syntax: tag = { effects… }
from
The country that triggered the current event.
Syntax: from = { effects… }
“province id”
The specified province.
Syntax: “province id” = { effects… }
random_country
Picks a random country.
Syntax: random_country = { effects… }
random_owned
Picks a random province.
Syntax: random_owned = { effects… }
“region name”
The specified region; region name as defined in /map/region.txt
Syntax: “region name” = { effects… }

Province Scopes - effects

controller
The country currently controlling the province.
Syntax: controller = { effects… }
owner
The current owner of the province.
Syntax: owner = { effects… }
random_empty_neighbor_province
Picks a random empty province neighboring the current province.
Syntax: random_empty_neighbor_province = { effects… }
random_neighbor_province
Picks a random province neighboring the current province.
Syntax: random_neighbor_province = { effects… }


Country Scopes - triggers

any_neighbor_country
Any country neighboring the current country.
Syntax: any_neighbor_country = { triggers… }
any_owned_province
Any owned province.
Syntax: any_owned_province = { triggers… }
any_core
Any province that is a core of the current country.
Syntax: any_core = { triggers… }


Province Scopes - triggers

any_neighbor_province
Any province neighboring the current province.
Syntax: any_neighbor_province = { triggers… }

Event Trigger

No Scope

and
boolean container trigger.
or
boolean container trigger.
not
boolean container trigger.
year
Syntax: year = x
Returns true if x is the current year or a later year.
month
Syntax: month = x
Returns true if x is the current month or a later month.


Country Scope

ai
Returns true if the country is handled by the AI.
Syntax: ai = yes / no
alliance_with
Returns true if the country is allied with the specified country.
Syntax: alliance_with = tag / this / from
blockade
Returns true if the blockade percentage is equal to x or above.
Syntax: blockade = x
can_create_vassals
Returns true if the current country can create a puppet state.
Syntax: can_create_vassals = yes / no
capital
Returns true if the specified capital it the current country's capital.
Syntax: capital = “province id”
check_variable
Returns true if the “variable name” has been set at an earlier stage and its value is equal to x.
Syntax: check_variable = {which = “name of variable” value = x}
controls
Returns true if the current country controls the specified province.
Syntax: controls = “province id”
country_units_in_province
Returns true if the current country has x or more units in the specified province.
Syntax: country_units_in_province = x
crude_oil
Returns true if the amount of crude oil a country has is equal to x or more.
Syntax: crude_oil = x
dissent
Returns true if a country's dissent value is equal to x or more.
Syntax: dissent = x
energy
Returns true if the amount of energy a country has is equal to x or more.
Syntax: energy = x
exists
Returns true if the specified country exists.
Syntax: exists = tag
faction
Returns true if a country belongs to the specified faction.
Syntax: faction = axis /allies / comintern
faction_progress
Returns true if the victory progress of the current faction is equal to x percent or more.
Syntax: faction_progress = x [x = 1..]
government
Returns true if the country has the specified government type; defined in /common/governments.txt)
Syntax: government = “government type”

 Valid government types in standard HoI3 (and example countries for 1936):
national_socialism            (GER) 
fascist_republic              (ITA) 
germanic_fascist_republic     (AUS) 
right_wing_republic           (ARG, BRA, HUN, POR) 
hungarian_right_wing_republic (?)
right_wing_autocrat           (CHI, SPA, TUR)
absolute_monarchy             (BUL, PER)
imperial                      (JAP, MAN)
social_conservatism           (AST, BEL, HOL, POL)
constitutional_monarchy       (ENG)
spanish_social_conservatism   (?)
market_liberalism             (CUB)
social_democracy              (MEX, NOR, SPR)
social_liberalism             (FRA, ROM, USA)
left_wing_radicals            (SIK)
socialist_republic            (CHC, MON)
federal_socialist_republic    (SOV)
government_in_exile
Returns true if the specified country has a government in exile.
Syntax: government_in_exile = yes / no
government positions
Verifies that a certain minister has been appointed to a certain position.
Syntax:
head_of_state = “minister id”
head_of_government = “minister id”
foreign_minister = “minister id”
armament_minister = “minister id”
minister_of_security = “minister id”
minister_of_intelligence = “minister id”
chief_of_staff = “minister id”
chief_of_army = “minister id”
chief_of_navy = “minister id”
chief_of_air = “minister id”
guarantee
Returns true if the specified country is guaranteeing the independence of the current country.
Syntax: guarantee = tag
has_country_flag
Returns true if the current country has the specified country.
Syntax: has_country_flag = “name of flag”
has_country_modifier
Returns true if the current country has the specified modifier.
Syntax: has_country_modifier = “name of modifier”
has_global_flag
Returns true if any country has set a global flag.
Syntax: has_global_flag = “name of flag”
has_leader
Returns true if the country has the specified leader.
Syntax: has_leader = “name of leader”
 ideology
Returns true if the country's ruling party belongs to the specified ideology; defined in /common/ideologies.txt/
Syntax: ideology = “ideology type”
 
 Valid ideologies in standard HoI3 (and example countries for 1936):
national_socialist  (GER)
fascistic           (AUS, ITA, SLO)
paternal_autocrat   (BRA, CHI, JAP, POL, SPA)
social_conservative (AUS, HOL, BEL)
market_liberal      (CUB, GUY)
social_liberal      (FRA, USA)
social_democrat     (MEX, NZL, SPR)
left_wing_radical   (SIK)
leninist            (None in 1936)
stalinist           (CHC, SOV)
ideology_group
Returns true if the country's ruling party belongs to the specified ideology group; defined in /common/ideologies.txt
Syntax: ideology_group = “ideology group name”

 Valid ideology groups in standard HoI3:
fascism
democracy
communism
is_core
Returns true if the specified province is a core of the current country.
Syntax: is_core = “province id”
is_in_any_faction
Returns true if a country is a member of a faction.
Syntax: is_in_any_faction = yes / no
is_possible_vassal
Returns true if the specified country can be released as a puppet state.
Syntax: is_possible_vassal = yes / no
is_subject
Returns true if the current country is a puppet.
Syntax: is_subject = yes / no
is_threatened
Returns true if the country feels threatened.
Syntax: is_threatened = yes / no
lost_IC
Returns true if the number of IC that a country has lost is equal to x or more.
Syntax: lost_IC = x
lost_national
Returns true if the number of core provinces that a country has lost is equal to x or more.
Syntax: lost_national = x
manpower
Returns true if the country has a manpower value equal to x or higher.
Syntax: manpower = x
manpower_percentage
Returns true if the country has a manpower percentage of x or above.
Syntax: manpower_percentage = x
max_manpower
Returns true if the country's maximum manpower is equal to x or higher.
Syntax: max_manpower = x
max_manpower_greater_than
Returns true if the country's maximum number of manpower is equal to x or more.
Syntax: max_manpower_greater_than = x
metal
Returns true if the amount of metal a country has is equal to x or more.
Syntax: metal = x
minister_alive
Returns true if the specified minister is active.
Syntax: minister_alive = “minister id”
military_access
Returns true if the specified country has military access to the current country.
Syntax: military_access = tag
money
Returns true if the amount of money a country has is equal to x or more.
Syntax: money = x
national_unity
Returns true if the country's national unity is equal to x or more.
Syntax: national_unity = x
neighbour
Returns true if the current country is a neighbour to the specified country.
Syntax: neighbour = tag
neutrality
Returns true if a country’s neutrality value is equal to x or more.
Syntax: neutrality = x
non_aggression_pact
Returns true if the specified country has a non-aggression pact with the current country.
Syntax: non_aggression_pact = tag
num_in_faction
Returns true if the number of members belonging to the same faction as the current country is equal to x or more.
Syntax: num_in_faction = x
num_of_allies
Returns true if the number of allies equals x or more.
Syntax: num_of_allies = x
num_of_cities
Returns true if the country has x or more cities.
Syntax: num_of_cities = x
num_of_convoys
Returns true if the number of convoys belonging to a country is equal to x or more.
Syntax: num_of_convoys = x
num_of_ports
Returns true if the country has x or more ports.
Syntax: num_of_ports = x
num_of_revolts
Returns true if there are x or more revolts in the country.
Syntax: num_of_revolts = x
num_of_vassals
Returns true if the number of puppets a country has is equal to x or more.
Syntax: num_of_vassals = x
organisation
Returns true if a country’s ruling party has an organisation value equal to x or more.
Syntax: organisation = x
owns
Returns true if the country owns the specified province.
Syntax: owns = “province id”
popularity
Returns true if the country’s ruling party has a popularity value equal to x or more.
Syntax: popularity = x
rare_materials
Returns true if the amount of rare materials a country has is equal to x or more.
Syntax: rare_materials = x
relation
Returns true if the specified country has a relation value equal to y or higher with the specified country.
Syntax: relation = { who = tag value = y }
revolt_percentage
Returns true if the percentage of revolts in the country is equal to x or higher.
Syntax: revolt_percentage = x
strat_allies_impact
Returns true if the strategic impact from allies is equal to x or more.
Syntax: strat_allies_impact = x
strat_bomb_impact
Returns true if the strategic impact from bombing is equal to x or more.
Syntax: strat_bomb_impact = x
strat_convoy_impact
Returns true if the strategic impact from a convoy is equal to x or more.
Syntax: strat_convoy_impact = x 
supplies
Returns true if the amount of supplies a country has is equal to x or more.
Syntax: supplies = x
tag
Returns true if the current country has a country tag that matches the specified tag.
Syntax: tag = “country tag”
threat
Returns true if the threat value is equal to x or more.
Syntax: threat = x
total_amount_of_divisions
Returns true if the number of divisions belonging to a country is equal to x or more.
Syntax: total_amount_of_divisions = x
total_amount_of_planes
Returns true if the number of planes belonging to a country is equal to x or more.
Syntax: total_amount_of_planes = x
total_amount_of_ships
Returns true if the number of ships belonging to a country is equal to x or more.
Syntax: total_amount_of_ships = x
total_defensives
Returns true if the number of defensive battles a country is currently involved in is equal to x or more.
Syntax: total_defensives = x
total_ic
Returns true if the total amount of ic a country has is equal to x or more.
Syntax: total_ic = x
total_num_of_ports
Returns true if the total number of ports a country has is equal to x or more.
Syntax: total_num_of_ports = x
total_offensives
Returns true if the number of offensive battles a country is currently involved in is equal to x or more.
Syntax: total_defensives = x
total_of_ours_sunk
Returns true if the number of sunken ships belonging to the current country is equal to x or more.
Syntax: total_of_ours_sunk = x
total_sea_battles
Returns true if the number of sea battles currently undertaken is equal to x or more.
Syntax: total_sea_battles = x
total_sunk_by_us
Returns true if the total number of ships sunk by the current country is equal to x or more.
Syntax: total_sunk_by_us = x
total_we_bomb
Returns true if the number of provinces we are currently bombing is equal to x or more.
Syntax: total_we_bomb = x
truce_with
Returns true if the current country has a truce with the specified country.
Syntax: truce_with = tag / this / from
unit_has_leader
Returns true if any unit in the current country has a leader.
Syntax: unit_has_leader = yes / no
unit_in_battle
Returns true if the country has any unit that is fighting a battle.
Syntax: unit_in_battle = yes / no
vassal_of
Returns true if the current country is a puppet state to the specified country.
Syntax: vassal_of = tag / this / from
war
Returns true if the current country is at war.
Syntax: war = yes / no
war_exhaustion
Returns true if the country’s war exhaustion is equal to x or above.
Syntax: war_exhaustion = x
war_with
Returns true if the current country is at war with the specified country.
Syntax: war_with = tag

Province Scope

continent
Returns true if the current province belongs to the specified continent.
Syntax: continent = “name of continent”
controlled_by
Returns true if the province is controlled by the specified country.
Syntax: controlled_by = tag
empty
Returns true if the current province is empty.
Syntax: empty = yes / no
has_building
Returns true if the current province has the specified building.
Syntax: has_building = “building type”
has_province_modifier
Returns true if the current province has the specified modifier.
Syntax: has_province_modifier = “name of modifer”
is_blockaded
Returns true if the province is blockaded.
Syntax: is_blockaded = yes / no
is_capital
Returns true if the current province is a capital.
Syntax: is_capital = yes / no
nationalism
Returns true if the nationalism value is equal to x or more.
Syntax: nationalism = x
owned_by
Returns true if the specified country owns the current province.
Syntax: owned_by = tag
port
Syntax: port = yes / no
Returns true if the current province has a port.
province_id
Returns true if current province has the specified ID.
Syntax: province_id = “province id”
region
Returns true if the province belongs to the specified region; defined in /map/region.txt
Syntax: region = “name of region”
units_in_province
Returns true if there are x or more units in the current province.
Syntax: units_in_province = x


Event Effects

Country Scope

add_core
Make a certain province a core of the current country.
Syntax: add_core = “province id”
add_country_modifier
Add a country modifier with certain effects to the country.
Syntax: add_country_modifier = “name of modifier”
capital
Move the capital to a new province.
Syntax: capital = “province id”
change_variable
Increases or decreases the value of an existing variable.
Syntax: change_variable = {which = “name of variable” value = x (x = +-1..)}
clr_country_flag
Removes the specified country flag.
Syntax: clr_country_flag = “name of flag” 
clr_global_flag
Removes the specified global flag.
Syntax: clr_global_flag = “name of flag”
country_event
Triggers the specified country event for the current country.
Syntax: country_event = “event id”
create_alliance
Creates an alliance with the specified country.
Syntax: create_alliance = this / from / tag
crude_oil
Increase/decrease a country’s amount of crude oil.
Syntax: crude_oil = x
dissent
Increase/decrease a country’s dissent value.
Syntax: dissent = x (x = +-1..)
end_guarantee
The current country will no longer guarantee the specified country.
Syntax: end_guarantee = tag
end_military_access
Ends the military access between the specified country, tag1 and the current country, tag2.
Syntax: tag1 = { end_military_access = tag2 }
end_non_aggression_pact
Ends a non-aggression pact between the current country and the specified country.
Syntax: end_non_aggression_pact = tag
end_war
Ends any war between the specified country, tag1 and the current country, tag2.
Syntax: tag1 = { end_war = tag2 }
energy
Increase/decrease a country’s amount of energy.
Syntax: energy = x
form_government_in_exile
Create a government in exile for the current country.
Syntax: form_government_in_exile = yes / no
government
Change the current form of government for the country.
Syntax: government = “government type”
government positions
Assign new ministers to a government positions.
Syntax:
head_of_state = “minister id”
head_of_government = “minister id”
foreign_minister = “minister id”
armament_minister = “minister id”
minister_of_security = “minister id”
minister_of_intelligence = “minister id”
chief_of_staff = “minister id”
chief_of_army = “minister id”
chief_of_navy = “minister id”
chief_of_air = “minister id”
guarantee
The current country will guarantee the specified country.
Syntax: guarantee = tag
inherit
Allow the current country to inherit the specified country.
Syntax: inherit = tag
join_faction
Makes the current country a member of the specified faction.
Syntax: join_faction = axis / allies / comintern
kill_leader
Kill the specified leader.
Syntax: kill_leader = “leader id”
leave_alliance
Remove the current country from an alliance with the specified country.
Syntax: leave_alliance = this / from / tag
leave_faction
Remove the current country from the specified faction.
Syntax: leave_faction = axis / allies / comintern
manpower
Increase/decrease the amount of manpower a country has.
Syntax: manpower = x (x = +-0..1)
metal
Increase/decrease a country’s amount of metal.
Syntax: metal = x
military_access
Gives the specified country, tag1 military access to the current country, tag2.
Syntax: tag1 = { military_access = tag2 }
money
Increase/decrease the amount of money a country has.
Syntax: money = x ( x = +-1..)
national_unity
Increase/decrease a country’s amount of national unity.
Syntax: national_unity = x (x = +-1..100)
neutrality
Increase/decrease a country’s neutrality value.
Syntax: neutrality = x (x = +-1..100)
new units
Give the current country a new unit (militia_brigade, infantry_brigade etc.).
Syntax: “province id” = { “new unit” = current }
non_aggression_pact
Creates a non-aggression pact between the current country and the specified country.
Syntax: non_aggression_pact = tag
organisation
Increase/decrease the ruling party’s organisation.
Syntax: organisation = x (x = +-1..)
popularity
Increase/decrease the ruling party’s popularity.
Syntax: popularity = x (x = +-1..)
random
Effects within the block has an “x” percents chance of taking effect.
Syntax: random = {chance = x effects…}
random_list
Effects within the block has an “x” percents chance of taking effect.
Syntax: random_list = {x = { effects... } x = { effects... } x = { effects… }} ex.
random_list = {
50 = { dissent = 4 }
20 = { dissent = 3 }
20 = { dissent = 2 }
10 = { dissent = 1 }
}
rare_materials
Increase/decrease a country’s amount of rare materials by x.
Syntax: rare_materials = x
relation
Increase/decrease the relations value between two countries by x.
Syntax: relation = { who = TAG/THIS value = x }
release
Allows the current country to release the specified country and thereby create a new independent nation.
Syntax: release = tag
release_vassal
Allows the current country to release the specified country as a vassal.
Syntax: release_vassal = this / from / random / tag
remove_core
The specified province will no longer be core province.
Syntax: remove_core = “province id”
remove_country_modifier
Removes a certain country modifier from the current country.
Syntax: remove_country_modifier = “name of modifier”
remove_minister
Removes the specified leader.
Syntax: remove_minister = “minister id”
secede_province
Cede a certain province to the specified country.
Syntax: “province id” = { secede_province = tag }
set_country_flag
Sets a flag for the current country.
Syntax: set_country_flag = “name of flag”
set_global_flag
Sets a global flag regardless of country.
Syntax: set_global_flag = “name of flag”
set_variable
Creates a new variable and assigns it the specified value.
Syntax: set_variable = {which = “name of variable” value = x (x = +-1..)}
split_troops
Gives the specified country, “x” percent of the current country’s troops.
Syntax: tag = { split_troops = x }
ex. Give Germany 10% of your troops.
GER = { split_troops = 0.10 }
supplies
Increase/decrease a country’s amount of supplies.
Syntax: supplies = x
threat
Increase/decrease the specified country’s threat value towards the current country by x.
Syntax: threat { who = tag / all value = x }
war
Start a war between the current country and the specified country.
Syntax: war = { target = tag attacker_goal = { casus_belli = conquer } }
war_exhaustion
Increase/decrease the amount of war exhaustion a country has.
Syntax: war_exhuastion = x (x = +-1..)

Province Scope

add_province_modifier
Creates a province modifier for the specified province.
Syntax: add_province_modifier = “name of modifier”
change_controller
Change the controller of a province.
Syntax: change_controller = tag
change_manpower
Increase/decrease the manpower available in a certain province.
Syntax: change_manpower = x (x = +-1..)
change_province_name
Changes the name of the current province.
Syntax: change_province_name = “new name”
create_revolt
Creates a revolt of the specified size.
Syntax: create_revolt = x (x = 1 / 2 / 3)
crude_oil
Increase/decrease a province’s max production of crude oil.
Syntax: crude_oil = x
energy 
Increase/decrease a province’s max production of energy.
Syntax: energy = x
metal
Increase/decrease a province’s max production of metal.
Syntax: metal = x
rare_materials
Increase/decrease a province’s max production of rare materials.
Syntax: rare_materials = x
remove_province_modifier
Removes a certain province modifier from the current province.
Syntax: remove_province_modifier = “name of modifier”
supplies
Increase/decrease a province’s max production of supplies.
Syntax: supplies = x

Modifiers

Modifiers are placed within a given scope to alter the effect defined within.

limit
Effects will only occur if triggers within the limit return true.
Syntax: limit = { { [limiting triggers] } [desired effects] }
duration
Applicable effects within a scope will only last for the given duration (in days).
Syntax: [defined scope] = { 
            [desired effects]
            duration = x
        }

Defunct Commands

Some commands that are used in other games based on the Clausewitz engine do not work in Hearts of Iron 3. They are listed here for the sake of completeness and in case a use happens to be found for them.

-Still working on testing commands at this time...