命令百科

HOI4 Effects

Effects change game state — used in immediate / option blocks of events, decisions, and focuses. All 553 documented effect commands:

A

B

  • become_exiled_inBecome exile in target nation. become_exiled_in = { target = TAG legitimacy = 0-100 (optional) }
  • boost_planningBoost planning of units that are belongs to the army group/navy of this unit leader
  • break_embargobreaks an existing embargo from ROOT to the specified tag. Note this will only work if used on the sending country
  • build_railwayBuilds/adds railway level between two provinces or along a path. Example:

C

D

E

  • effect_tooltipShows just tooltip of effects
  • end_exileEnds the exile of of the current scope's country
  • end_puppetStops specefied country being a puppet of current country
  • event_option_tooltipShows the tooltip text of an event option in other tooltips(root and from scopes are swapped).
  • every_active_scientistExecutes children effects on every active scientist (or \"random_select_amount\" of random character if specified) of the country in scope, …
  • every_allied_countryExecutes children effects on every Allied Country different from the one in scope (or `random_select_amount` of random country if specified)…
  • every_army_leaderExecutes children effects on every Army Leader (or \"random_select_amount\" of random leader if specified) of the country in scope, that ful…
  • every_characterExecutes children effects on every Character (or \"random_select_amount\" of random character if specified) of the country in scope, that fu…
  • every_collection_elementApplies arbitrary effects to all elements of a collection. To learn more about collections,
  • every_controlled_stateExecutes children effects on every State controlled by the country in scope (or \"random_select_amount\" of random state if specified) that …
  • every_core_stateExecutes children effects on every core State of the country in scope (or \"random_select_amount\" of random state if specified) that fulfil…
  • every_countryExecutes children effects on every Country (or \"random_select_amount\" of random country if specified) that fulfills the \"limit\" trigger.
  • every_country_divisionExecutes children effects on every Division of the country in scope (or \"random_select_amount\" of random divisions if specified) that fulf…
  • every_country_with_original_tagExecutes children effects on a all countries with original tag (or \"random_select_amount\" of random country if specified) that fulfills th…
  • every_enemy_countryExecutes children effects on every enemy Country of the country in scope (or \"random_select_amount\" of random country if specified) that f…
  • every_faction_memberExecutes children effects on every faction member of the country's faction in scope (if country does not have a faction it will only work on…
  • every_military_industrial_organizationExecutes children effects on every Military Industrial Organisation (or \"random_select_amount\" of random MIOs if specified) of the country…
  • every_navy_leaderExecutes children effects on every Navy Leader (or \"random_select_amount\" of random leader if specified) of the country in scope, that ful…
  • every_neighbor_countryExecutes children effects on every neighbor Country of the country in scope (or \"random_select_amount\" of random country if specified) tha…
  • every_neighbor_stateExecutes children effects on every State neighboring the state in scope (or \"random_select_amount\" of random state if specified) that fulf…
  • every_occupied_countryExecutes children effects on every occupied Country by the country in scope (or \"random_select_amount\" of random country if specified) tha…
  • every_operativeExecutes children effects on every operative (or \"random_select_amount\" of random operatives if specified) that fulfills the \"limit\" tri…
  • every_other_countryExecutes children effects on every Country different from the one in scope (or \"random_select_amount\" of random country if specified) that…
  • every_owned_stateExecutes children effects on every State owned by the country in scope (or \"random_select_amount\" of random state if specified) that fulfi…
  • every_possible_countryExecutes children effects on every Country (or \"random_select_amount\" of random country if specified) that fulfills the \"limit\" trigger.
  • every_purchase_contractExecutes children effects on every purchase contract (or \"random_select_amount\" of random purchase contracts if specified) of the country …
  • every_scientistExecutes children effects on every scientist (or \"random_select_amount\" of random character if specified) of the country in scope, that fu…
  • every_stateExecutes children effects on every State (or \"random_select_amount\" of random state if specified) that fulfills the \"limit\" trigger.
  • every_state_divisionExecutes children effects on every Division currently in the state in scope (or \"random_select_amount\" of random divisions if specified) t…
  • every_subject_countryExecutes children effects on every subject Country of the country in scope (or \"random_select_amount\" of random country if specified) that…
  • every_unit_leaderExecutes children effects on every Unit Leader (or \"random_select_amount\" of random leader if specified) of the country in scope, that ful…
  • execute_operation_coordinated_strikeSpecial effect for executing the Coordinated Strike Operation. amount determines how often the simulation is run

F

  • finalize_border_warfinalizes border war between two states, wins or cancels it
  • find_highest_in_arrayRuns a loop on for each element of an array, finds the highest value and stores result in temp variables
  • find_lowest_in_arrayRuns a loop on for each element of an array, finds the lowest value and stores result in temp variables
  • for_each_loopRuns a loop on for each element of an array
  • for_each_scope_loopRuns a loop on for each element of an array and changes scope to current element in each iteration
  • for_loop_effectRuns a same effects through a loop. example will run the effects for value_name = -3, 0, 3, 6, 9 and then terminate
  • force_disable_resistanceforce disables resistance for scoped state. :
  • force_enable_resistanceforce enables resistance for scoped state. the resistance will be active even if other conditions doesn't satisfy (even if it is core or res…
  • force_operative_leader_into_hidingForce an operative into hiding, preventing him from performing mission. The specified values is subject to modifiers
  • force_update_dynamic_modifierupdates the modifiers in current scope (use if you don't want to wait for daily update to update them):
  • force_update_map_modeforce rebuilds map mode. no tooltip generated.
  • free_operativeFree an operative
  • free_random_operativeFree a random captured operative of a certain tag by a certain tag

G

  • gain_xpGrant experience to the scoped in unit leader. Cannot be used to remove experience.
  • generate_characterGenerates a character. Use in every_country in order to generates one copy of the character per country satisfying the limit conditions.
  • generate_scientist_characterGenerate a new character with a scientist role and recruit it in the country in scope.
  • get_highest_scored_countrycalculates the highest scored country that is defined in a country scorer and sets it to a temp variable. Example:
  • get_highest_scored_country_tempcalculates the highest scored country that is defined in a country scorer and sets it to a variable. Example:
  • get_sorted_scored_countriescalculates & sorts all countries in a country scorer and stores them and their scores in arrays. Example:
  • get_sorted_scored_countries_tempcalculates & sorts all countries in a country scorer and stores them and their scores in temp arrays. Example:
  • get_supply_vehiclessets a variable to the number of supply vehicles in stockpile or that are needed. example
  • get_supply_vehicles_tempsets a temp variable to the number of supply vehicles in stockpile or that are needed. example
  • give_guaranteeguarantees specified country
  • give_market_accessGives market access to the specified country.
  • give_military_accessgives military access to the specified country
  • give_resource_rightsGives rights to take resources from specified state.
  • global_every_army_leaderExecutes children effects on every Army Leader (or \"random_select_amount\" of random leader if specified) for EVERY COUNTRY, that fulfills …
  • goto_provinceGoes to stated province.
  • goto_stateGoes to stated state.

H

I

K

  • kill_country_leaderkills a country leader and removes him completely, making the next in line the new party and country leader
  • kill_ideology_leaderremoves a ideology leader as leader of his party, making the next in line the new party leader
  • kill_operativeKills an operative. This will temporarily lock the slot they occupy

L

  • launch_nukelaunch nuke at a state. usage :
  • leave_factionCountry leaves the faction
  • load_focus_treeSets what focus tree a country uses, retains finished shared focuses. Parameters:
  • load_oobImmediately loads an Order of Battle (OOB) file.
  • logPrint message to game.log, console (if visible) and history logger (if running. you can use category|log to specify a category), Can be loca…

M

N

O

P

  • party_leaderExecutes children effects on random characters that fulfills the "limit" trigger.
  • play_songPlays song from database
  • print_variablesprints all variables in scope and temp variables to a file
  • promote_characterpromotes character to the head of their political party.If this is the ruling party, the character becomes country leader.if the character h…
  • promote_leaderpromotes general to field marshal
  • promote_officer_to_generalPromote the officer of the division to a general.
  • puppetPuppets specified country. By default, cancels the puppets existing war relations.

R

S

T

U

W

  • while_loop_effectRuns the effect as long as a trigger is true
  • white_peaceMakes a white peace between the two countries if at war. ROOT is considered the winner while the target tag is considered the loser (which a…