命令百科

HOI4 Triggers

Triggers are boolean conditions — used in limit / available / visible blocks. All 596 documented trigger commands:

A

  • add_to_temp_arrayAdds an element to a temporary array
  • add_to_temp_variableAdds a value, a variable, or a [math expression](script_math_expression.md) to a temporary variable.
  • advisor_can_be_firedReturn true if the character has an advisor role and they can be fired.
  • agency_upgrade_numberChecks the number of upgrade done in the intelligence agency.
  • ai_has_role_divisioncheck if the ai controlled country has any fielded divisions for a specific role
  • ai_has_role_templatecheck if the ai controlled country has any template for a specific role
  • ai_irrationalitycheck the ai irrationality value
  • ai_liberate_desirecheck what liberation desire the country has towards a specified country
  • ai_wants_divisionsWill compare towards the amount of divisions an ai wants to have.
  • all_active_scientistChecks if all active scientists of the Country in scope matches the triggers.
  • all_allied_countryCheck if all allied countries meet the trigger. Does not include the country itself. tooltip=key can be defined to override title
  • all_army_leaderChecks if All Army Leader of the Country in scope match the triggers.
  • all_charactercheck if all characters meets the trigger. tooltip=key can be defined to override title
  • all_claimantChecks if the provided trigger is true for all countries that claims the state in scope.
  • all_collection_elementsChecks if the triggers are true for all of the elements in the collection.
  • all_controlled_statecheck if all of the states controlled by the scope country meets the trigger. tooltip=key can be defined to override title
  • all_core_stateCheck if all of the country core states for the scope meets the trigger. tooltip=key can be defined to override title
  • all_countrycheck if all countries meets the trigger. tooltip=key can be defined to override title
  • all_country_ofChecks if all of the provided countries fulfill the specified triggers.
  • all_country_with_original_tagcheck if all country with current scope's original tag meets the trigger. Example:
  • all_enemy_countrycheck if all enemy countries meet the trigger. tooltip=key can be defined to override title
  • all_guaranteed_countrycheck if every country with current scoped country guarantees. Example:
  • all_military_industrial_organizationChecks if all Military Industrial Organisations of the Country in scope match the triggers.
  • all_navy_leaderChecks if all Navy Leaders of the Country in scope match the triggers.
  • all_neighbor_countrycheck if all neighbor countries meet the trigger. tooltip=key can be defined to override title
  • all_neighbor_statecheck if all neighbor states meets the trigger. tooltip=key can be defined to override title
  • all_occupied_countrycheck if all occupied countries meets the trigger. tooltip=key can be defined to override title
  • all_ofRuns a loop on an array and check a trigger for each value, if any false returns false. otherwise returns true
  • all_of_scopesRuns a loop on an array and check a trigger for each scope in it, if any false returns false. otherwise returns true
  • all_operative_leadercheck if all operatives meets the trigger. tooltip=key can be defined to override title
  • all_other_countrycheck if all other countries meets the trigger. Excludes current country. tooltip=key can be defined to override title
  • all_owned_statecheck if all owned states meets the trigger. tooltip=key can be defined to override title
  • all_purchase_contractsChecks if all purchase contracts of the Country in scope matches the triggers.
  • all_scientistsChecks if all scientists of the Country in scope matches the triggers.
  • all_statecheck if all states meets the trigger. tooltip=key can be defined to override title
  • all_subject_countriescheck if all subject countries meet the trigger. tooltip=key can be defined to override title
  • all_unit_leaderChecks if all Unit Leaders of the Country in scope match the triggers.
  • alliance_naval_strength_ratioCompares the estimated naval strength between the scope country, his allies and his enemies.
  • alliance_strength_ratioCompares the estimated army strength between the scope country, his allies and his enemies.
  • alwaysalways returns specified value
  • amount_manpower_in_deployment_queueChecks for amount manpower currently in deploymentview. amount_manpower_in_training > 10
  • amount_research_slotscheck number of research current research slots
  • amount_taken_ideashas current country picked specified amount of ideas. Category and slots is optional.
  • andall inside trigger must be true
  • any_active_scientistChecks if at least one active scientist of the Country in scope matches the triggers.
  • any_allied_countryCheck if any allied country meets the trigger. Does not include the country itself. tooltip=key can be defined to override title
  • any_army_leaderChecks if at least one Army Leader of the Country in scope matches the triggers.
  • any_charactercheck if any character meets the trigger. tooltip=key can be defined to override title
  • any_claimcheck if there is a claim between a country and all others
  • any_collection_elementChecks if the triggers are true for any of the elements in the collection.
  • any_controlled_statecheck if any of the states controlled by the scope country meets the trigger. tooltip=key can be defined to override title
  • any_core_stateCheck if any of the country core states for scope meets the trigger. tooltip=key can be defined to override title
  • any_countrycheck if any country meets the trigger
  • any_country_divisioncheck if any division meets the trigger. tooltip=key can be defined to override title
  • any_country_ofChecks if any of the provided countries fulfill the specified triggers.
  • any_country_with_corecheck if any country with a core on the scoped state meets the trigger. tooltip=key can be defined to override title
  • any_country_with_original_tagcheck if any country with current scope's original tag meets the trigger. Example:
  • any_country_with_original_tag_ofChecks if any country that has an original tag that matches any of the provided countries fulfill the specified triggers.
  • any_enemy_countrycheck if any enemy country meets the trigger. tooltip=key can be defined to override title
  • any_guaranteed_countrycheck if any country with current scoped country guarantees. Example:
  • any_home_area_neighbor_countrycheck if any neighbor country in the home area meets the trigger. tooltip=key can be defined to override title
  • any_military_industrial_organizationChecks if at least one Military Industrial Organisation of the Country in scope matches the triggers.
  • any_navy_leaderChecks if at least one Navy Leader of the Country in scope matches the triggers.
  • any_neighbor_countrycheck if any neighbor country meets the trigger. tooltip=key can be defined to override title
  • any_neighbor_statecheck if any neighbor state meets the trigger. tooltip=key can be defined to override title
  • any_occupied_countrycheck if any any occupied meets the trigger. tooltip=key can be defined to override title
  • any_ofRuns a loop on an array and check a trigger for each value, if any true returns true. otherwise returns false
  • any_of_scopesRuns a loop on an array and check a trigger for each scope in it, if any true returns true. otherwise returns false
  • any_operative_leadercheck if any operatives meets the trigger. tooltip=key can be defined to override title
  • any_other_countrycheck if any other country meets the trigger. Excludes current country. tooltip=key can be defined to override title
  • any_other_country_ofChecks if any of the provided countries (except for the current country) fulfill the specified triggers.
  • any_other_country_with_original_tag_ofChecks if any country that has an original tag that matches any of the provided countries and isn't the current country fulfill the specifie…
  • any_owned_statecheck if any owned state meets the trigger. tooltip=key can be defined to override title
  • any_province_building_levelIn the current state, checks if any province within the specified limit has a building of the specified level.
  • any_purchase_contractChecks if at least one Purchase contract of the Country in scope matches the triggers.
  • any_scientistChecks if at least one scientist of the Country in scope matches the triggers.
  • any_statecheck if any state meets the trigger. tooltip=key can be defined to override title
  • any_state_divisioncheck if any division meets the trigger. tooltip=key can be defined to override title
  • any_state_incheck if any state in the given category meets the trigger.
  • any_state_ofChecks if any of the provided states fulfill the specified triggers.
  • any_subject_countrycheck if any subject country meets the trigger. tooltip=key can be defined to override title
  • any_unit_leaderChecks if at least one Unit Leader of the Country in scope matches the triggers.
  • any_war_scorecompares the warscore of all wars in a country to see if any fullfills the comparison condition 0-100 - Example: any_war_score > 40
  • areacheck state's strategic area id
  • armorCheck that average armor level of combatant is over a certain level
  • army_manpower_in_stateChecks for amount manpower currently the target state with option to specify a type.
  • attack_skill_levelCompares attack skill level of a unit leader.
  • average_statsCompares the average stats for a unit leader.

B

  • building_count_triggerChecks if the current scope has the specified amount of the specified building.
  • buyerCheck the buyer country. Example: buyer = GER

C

D

E

  • enemies_naval_strength_ratioCompares the estimated navy strength between the scope country and all its enemies
  • enemies_strength_ratioCompares the estimated army strength between the scope country and all its enemies
  • energy_ratioenergy_ratio > 0.8 - Compare current energy fulfilment to the factories, with 1 being 100% and 0 being 0%
  • estimated_intel_max_armorCompares estimated max armor based on intel. Example: estimated_intel_max_armor = { tag = ITA value > 1 }
  • estimated_intel_max_piercingCompares estimated max armor based on intel. Example: estimated_intel_max_piercing = { tag = ITA value > 1 }
  • existsCheck if the current country exist. The country of the scope you are in. Example: DEN = { exists = yes }

F

G

H

I

L

M

  • manpower_per_military_factoryNumber of available manpower per factory the country has. Excluding dockyards.
  • meta_triggermeta triggers can be used for building triggers from strings and running them. following example will test if Germany has 42 pp:
  • min_planningcheck if side has maximal planning bonus
  • mine_threatA trigger to check how dangerous enemy mines are for a country. Controlled by NAVAL_MINE_DANGER defines. Returns a value between 0 and 1. Ex…
  • modulo_temp_variablemodulos a temp variable with another. Example:
  • multiply_temp_variableMultiplies a temporary variable by a value, another variable, or a [math expression](script_math_expression.md).

N

O

  • occupation_lawChecks the occupation law for an occupied country, occupied state, or the default occupation law of an occupying country.
  • occupied_country_tagcompares occupied country that creates resistance to a tag. Example: occupied_country_tag = ITA
  • operative_leader_missionChecks whether the operative is performing the given mission:
  • operative_leader_operationChecks whether the operative is performing the given operation:
  • orat least one entry inside trigger must be true
  • original_research_slotscheck number of research slots at start of game
  • original_tagoriginal tag is ( for civil wars checks )
  • owns_any_state_ofCheck if the country owns any of the states in the list.
  • owns_statecheck owner for state(s)

P

R

  • received_expeditionary_forcesChecks that the country in scope has received the specified amount of expeditionary forces from the specified country
  • recon_advantagechecks if side has an advantage in recon level
  • regioncheck state's strategic area id
  • remove_from_temp_arrayRemoves an element from a temporary array using value or index
  • reservescheck amount of reserves
  • resistanceCompares the current resistance level of a state to a value. Example: resistance > 50
  • resistance_speedCompares the current resistance speed of a state to a value. Example: resistance_speed > 50
  • resistance_targetCompares the target resistance level of a state to a value. Example: resistance_target > 50
  • resize_temp_arrayResizes a temp array
  • resource_count_triggerChecks if the current scope has the specified amount of the specified resource.
  • round_temp_variableRounds a temporary variable

S

T

U

  • unit_organizationCheck scope unit organization status 0-1: Example unit_organization < 1
  • unit_strengthCheck scope unit strength status 0-1: Example unit_strength < 1

W

  • war_length_withCheck number of months the country has been at war with X for Y months.