Custom Commands

From Old World Blues Wiki
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
The state scope in which the exodus will take place
exodus_set_portion = <float>
The portion of the state's population which will be dispersed as refugees
20 = {
    set_temp_variable = { exodus_set_portion = 0.4 }
    exodus_with_set_proportion = yes
}
exodus_set_portion > 1
is valid, but will create more refugees than the state had population
exodus_decimate_portion
Destroys a defined portion of a state's population and factories, removing them from the state
THIS
The state scope in which the decimation will take place
decimation_portion = <float>
The portion of the state's population which will be destroyed
20 = {
    set_temp_variable = { decimation_portion = 0.4 }
    exodus_decimate_portion = yes
}
decimation_portion > 1
is valid, but will have no effect past removing the state's entire population
exodus_add_refugees
Adds refugees to the nation's Unassimilated Refugee pool
THIS
The country scope to whom the refugees will be added
refugees_to_add = <value>
The number of refugees that will be added to the nation's pool
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
The country scope to whom the refugees will be sent
refugees_to_add = <value>
The number of refugees that will be added to the nation's pool and removed from the old state
refugee_origin = <state id>
The state ID of the refugee's origin
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
The state scope of the node you wish to add development to
development_to_add = <float>
The amount of development you wish to add to the node
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