Custom Commands
Jump to navigation
Jump to search
Custom Commands (also known as Scripted Effects) are used to simplify the repeated use of multi-line code into one single line.
Some Commands require a number of parameters to be set as temporary variables before their use.
This page seeks to summarise all of these commands, allowing a useful reference resource when scripting focus trees, events, decisions and the like.
Exodus Effects
Name | Description | Parameters | Example | Notes |
---|---|---|---|---|
exodus_with_set_proportion |
Sends a defined portion of a state's population as refugees across the map, removing them as state population | THIS exodus_set_portion = <float> |
20 = {
set_temp_variable = { exodus_set_portion = 0.4 }
exodus_with_set_proportion = yes
} |
exodus_set_portion > 1 |
exodus_decimate_portion |
Destroys a defined portion of a state's population and factories, removing them from the state | THIS decimation_portion = <float> |
20 = {
set_temp_variable = { decimation_portion = 0.4 }
exodus_decimate_portion = yes
} |
decimation_portion > 1 |
exodus_add_refugees |
Adds refugees to the nation's Unassimilated Refugee pool | THIS refugees_to_add = <value> |
NCR = {
set_temp_variable = { refugees_to_add = 360 }
exodus_add_refugees = yes
} |
The stability penalty for unassimilated refugees will automatically be recalculated after calling the effect, so there is no need to manually do so |
exodus_send_refugees_to_THIS |
Sends a specific number of refugees from a state to a set nation | THIS refugees_to_add = <value> refugee_origin = <state id> |
NCR = {
set_temp_variable = { refugees_to_add = 360 }
set_temp_variable = { refugee_origin = 46 }
exodus_send_refugees_to_THIS = yes
} |
Trade Node Effects
Name | Description | Parameters | Example | Notes |
---|---|---|---|---|
add_development_to_node |
Adds a defined amount of development to a trade node, increasing the node level progress | THIS development_to_add = <float> |
471 = {
set_temp_variable = { development_to_add = 0.75 }
add_development_to_node = yes
} |
This effect has a custom tooltip attached, for convenience |
disable_current_node_duration |
||||
disable_current_node |
||||
restart_current_node |
||||
move_main_node_to |
||||
add_state_as_node_partner |
||||
create_map_node |
||||
register_new_trade_node_connection |
||||
unregister_trade_node_connection |
||||
create_trade_route_between |
||||
remove_trade_route_betwen |
||||
remove_all_trade_routes_between |
Caps Commands
Name | Description | Parameters | Example | Notes |
---|---|---|---|---|
caps_to_add |
set_temp_variable = {
caps_to_add = 200
}
add_caps = yes |
|||
add_caps |
Construction Commands
Name | Description | Parameters | Example | Notes |
---|---|---|---|---|
build_random_mil_factory |
||||
build_2_random_mil_factory |
||||
build_random_civ_factory |
||||
build_2_random_civ_factory |
||||
build_random_dockyard |
Wargoal, Claim & Core Commands
Name | Description | Parameters | Example | Notes |
---|---|---|---|---|
core_owned_states_of_prev |
NCR = {
ROOT = {
core_owned_states_of_prev = yes
}
} |
|||
core_all_core_states_of_prev |
||||
claim_core_states_of_prev |
||||
grant_wargoals_on_core_states_of_prev |
||||
grant_wargoals_on_core_states_of_prev_force_ai_war |
Law Commands
Name | Description | Parameters | Example | Notes |
---|---|---|---|---|
increase_mobalisation_law |
||||
increase_conscription_law |
| |||
decrease_conscription_law |
||||
increase_trading |
Miscellaneous Commands
Name | Description | Parameters | Example | Notes |
---|---|---|---|---|
give_next_level_of_weapon_equipment |