执行:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.12
(文本替换 - 替换“[[Category:”为“[[分类:”)
无编辑摘要
第1行: 第1行:
{{Version|1.9}}
{{Version|1.12}}


==  杂项 ==
On actions are blocks that are executed when a certain action occurs, such as a country declaring war on a different country or a state changing control. On actions are stored in {{path|common/on_actions/*.txt}} files.
 
__TOC__
 
Each on action is a separate block within the <code>on_actions = { ... }</code> block, which is the root block of the on actions file. Each on_action has up to 2 arguments:
* <code>effect = { ... }</code> is present for every single on action, being an effect block the insides of which are executed when needed.
* <code>random_events = { ... }</code> is present for on_actions where the default scope (Same as ROOT, if not specified otherwise) is a country, such as on_new_term_election. This instantly fires a random one of the specified events within with the given weights being applied. This is done with a [[wp:Sampling_(statistics)#Probability-proportional-to-size_sampling|probability-proportional-to-size sampling]] approach.
: Putting <code>0</code> instead of an event ID will ensure that nothing will happen if the chance lands on this.
: Additionally, an event cannot be fired using <code>random_events = { ... }</code> if the event's <code>trigger = { ... }</code> block evaluates as false. In this case, each scope is treated the same as on action's: on action's FROM is treated as the event's FROM, same with FROM.FROM.
: If there are multiple random_events blocks, one event will be picked from each.
 
Note that in terms of [[Scopes]], ROOT is the default assumed scope unless specified otherwise (in on_actions that have THIS as a separate entity from ROOT), while FROM and FROM.FROM can serve as secondary blocks that are provided in addition.
 
Each on action can only be executed after the game's start, ignoring any effects done within history files or the bookmark's <code>effects = { ... }</code> section that normally would trigger one, such as [[Effect#set_politics|set_politics]].
== File example ==
<pre>on_actions = {
   on_startup = {
     effect = { # NEVER FORGET! Important to include this line to distinguish it from random_events = { ... }
       every_country = {
         limit = {
           is_ai = no
         }
         country_event = welcome_event.1
       }
       ENG = {
         country_event = {
           id = new_year.1
           days = 365 # Fires on January 1 1937. Remember that leap days do not exist in-game.
         }
       }
     }
   }
   on_state_control_changed = {
     random_events = {
       1 = germany_state_control.1 # Assuming the triggers for the events are met, then
       1 = germany_state_control.2 # fires one of germany_state_control.1 or germany_state_control.2
       3 = 0            # Each has a 20% chance, and there's 60% chance nothing happens.
     }
     effect = {
       if = {
         limit = {  # Execute if Italy captures Corsica or Savoy from France
           tag = ITA
           FROM = { tag = FRA }
           FROM.FROM = {
             OR = {
               state = 1
               state = 735
             }
           }
         }
         FROM.FROM = {
           set_resistance = 60
           damage_building = {
             type = infrastructure
             damage = 2
           }
         }
       }
     }
   }
}</pre>
 
== General on actions ==
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="10%" | 名称
! width="10%" | Name
! width="20%" | 描述
! width="20%" | Description
! width="25%" | 示范
! width="25%" | Examples
! width="15%" | 注释
! width="15%" | Notes
! width="5%" | 添加版本
! width="5%" | Version Added
|-
|-id="on_startup"
|on_startup
|on_startup
| 在新游戏的第一天触发(不包括保存与加载)
|Trigger the following commands at the first day of a new game, after country selection. Doesn't work with save loading.
|<code>on_startup = { effect = { ... } }</code>
|<pre>on_startup = { 
|
   effect = {
|1.0
     ENG = {
|-
       news_event = { id = news_event.1 days = 31 random_days = 27 } # Fires a news event in February 1936
     }  # assuming the default start date
   }    # Scoping into ENG is necessary, since
}      # news_event is a country-scoped effect</pre>
|'''Has a default scope of <code>none</code>''', instead of firing for each country individually as in other Paradox games such as Europa Universalis IV. Many effects that usually can be used in any scope will not work, without manual [[scopes|scoping]] into countries, states, or elsewhere.
|1.3.3
|-id="on_daily"
|on_daily
|on_daily
| 每一天对每个国家触发(对性能要求高,要谨慎使用呀~)
|Triggers each day for '''every country separately''' (performance heavy, use carefully)
|<code>on_daily = { effect = { ... } }</code>
|<pre>on_daily = {
| 对于给mod添加新机制很有用(比如说可以每天新增一个变量)
   effect = {
     if = {
       limit = { has_variable = to_be_updated_daily }
       add_to_variable = { to_be_updated_daily = 1 }
     }
   }
}</pre>
|Useful for scripted guis and mods adding new mechanics (can increment a variable daily e.g.). '''Only use scoping if you're careful to avoid duplicate effects'''. This being executed for every country separately means that this is essentially equivalent to a single effect executed daily inside of every_country. e.g. <code>effect = { GER = { add_political_power = 1 } }</code> will add ~100 political power to {{flag|Germany}} daily, as there being ~100 countries on the world map means that this will get executed ~100 times per day.
|1.5.2
|1.5.2
|-
|-id="on_daily_TAG"
|on_daily_TAG
|Triggers each day for the specified country only
|<pre>on_daily_SOV = {
   effect = { 
     if = {
       limit = { has_war_with = GER }
       SOV_escalate_the_war_effect = yes
     }
   }
}</pre>
|Only runs the effects if the country exists.
|1.9
|-id="on_weekly"
|on_weekly
|on_weekly
| 每周对每个国家触发
|Triggers each week for every country separately
|<code>on_weekly = { effect = { ... } }</code>
|<pre>on_weekly = {
| 对于写ai的脚本很有用
   effect = {
     if = {
       limit = {
         has_intelligence_agency = yes
         is_ai = yes
       }
       update_operation_ai = yes
     }
   }
}
</pre>
|Useful for ai scripting. Runs on the beginning of the day if the [[Game variables#num_days|num_days variable]] is divisible by 7.
|1.9
|1.9
|-
|-id="on_weekly_TAG"
|on_weekly_TAG
|on_weekly_TAG
| 每周对指定(TAG)的国家触发
|Triggers each week for the specified country only
|<code>on_weekly_TAG = { effect = { ... } }</code>
|<pre>on_weekly_BHR = {
|
   if = {
     limit = {
       has_country_flag = BHR_must_control_states
       any_owned_state = {
         NOT = { is_controlled_by = ROOT }
       }
       has_stability < 0.5
     }
     country_event = BHR_event.0
     clr_country_flag = BHR_must_control_states
   }
}</pre>
|Only runs the effects if the country exists. Runs on the beginning of the day if the [[Game variables#num_days|num_days variable]] is divisible by 7.
|1.9
|1.9
|-
|-id="on_monthly"
|on_monthly
|on_monthly
| 每月对每个国家触发
|Triggers each month for every country separately
|<code>on_monthly = { effect = { ... } }</code>
|<pre>on_monthly = { 
   random_events = {
     1 = random_event.0
     99 = 0
   }
}</pre>
|
|
|1.9
|1.9
|-
|-id="on_monthly_TAG"
|on_monthly_TAG
|on_monthly_TAG
| 每周对指定(TAG)的国家触发
|Triggers each month for the specified country only
|<code>on_monthly_TAG = { effect = { ... } }</code>
|<pre>on_monthly_USA = {
|
   effect = {
|1.9
     add_to_variable = { USA_unrest = 1 }
|-
     clamp_variable = {
|on_nuke_drop
       var = USA_unrest
|当有国家丢核弹时触发命令
       max = 10
|<code>on_nuke_drop = {effect = { set_global_flag = first_nuke_dropped } }</code>
     }
|目标国(FROM)是被炸的省份
     if = {
|1.0
       limit = { 
|-
         check_variable = { USA_unrest = 10 }
|on_pride_of_the_fleet_sunk
       }
|当有国家的舰队荣耀被击沉时触发命令
       country_event = usa.rebellion.0
|<code>on_pride_of_the_fleet_sunk = { effect = { ... } }</code>
     }
|目标国(FROM)是击沉它的国家, 本国(ROOT) 是被击沉的国家
   }
|1.6
}</pre>
|-
|Only runs the effects if the country exists.
|on_naval_invasion
|当进行登陆作战时触发命令
|<code>on_naval_invasion = { effect = { ... } }</code>
|该省是被登陆的省份,本国( ROOT)是进行登陆的国家。目标(FROM)省份是该登陆行动开始的省份
|1.9
|-
|on_paradrop
|当伞兵空降时触发命令
|<code>on_paradrop = { effect = { ... } }</code>
| 该(THIS)省是被空降的省份,本国( ROOT)是执行空降的国家。目标(FROM)省份是该空降行动开始的省份
|1.9
|1.9
|}
|}


== 政治 ==
== Politics ==
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="10%" | 名称
! width="10%" | Name
! width="20%" | 描述
! width="20%" | Description
! width="25%" | 示范
! width="25%" | Examples
! width="15%" | 注释
! width="15%" | Notes
! width="5%" | 添加版本
! width="5%" | Version Added
|-
|-id="on_stage_coup"
|on_stage_coup
|For the non {{icon|lar|1}} stage coup. Trigger the following commands whenever a coup is stage.
|<pre>on_stage_coup = {
   effect = {
   }
}</pre>
| ROOT is the country that stages the coup, FROM is the target country.
|1.0
|-id="on_coup_succeeded"
|on_coup_succeeded
|on_coup_succeeded
| 政变成功时触发命令
|For the non {{icon|lar|1}} stage coup. Trigger the following commands whenever a coup succeeds.
|<code>on_coup_succeeded = { effect = { random_other_country = { limit = { has_government = democratic original_tag = ROOT } set_politics = { elections_allowed = yes } } } }</code>
|<pre>on_coup_succeeded = { 
|
   effect = { 
     random_other_country = { 
       limit = { 
         has_government = democratic
         original_tag = ROOT
      
       set_politics = { elections_allowed = yes }
     }
   }
}</pre>
|ROOT is the country that coup succeeded in, FROM is the stager of the coup
|1.0
|1.0
|-
|-id="on_government_change"
|on_government_change
|on_government_change
| 当一个国家改变政府时触发命令
|Trigger the following commands whenever a country switches its government.
|<code>on_government_change = { effect = { ... } }</code>
|<pre>on_government_change = { effect = { &hellip;  } }</pre>
|
|This includes <code>set_politics</code> and <code>start_civil_war</code> (always for both sides) and excludes being puppeted. Will always also trigger [[#on_ruling_party_change|on_ruling_party_change]].
|1.0
|1.0
|-
|-id="on_ruling_party_change"
|on_ruling_party_change
|on_ruling_party_change
| 当一个国家改变意识形态时触发命令
|Trigger the following commands whenever a country switches its ideology.
|<code>on_ruling_party_change = { effect = { ... } }</code>
|<pre>on_ruling_party_change = { effect = { &hellip;  } }</pre>
|
|<code>old_ideology_token</code> is a [[Variables#Variable types|temporary variable]] that stores the old ideology as a token. Alongside what triggers [[#on_government_change|on_government_change]], also includes being puppeted or changing the ideology via a console command.
|1.9
|1.9
|-
|-id="on_new_term_election"
|on_new_term_election
|on_new_term_election
| 当选举开始或正在选举时触发命令
|Trigger the following commands whenever an election happens or is called by the '''hold_election''' command.
|<code>on_new_term_election = { random_events = { 100 = usa.6 } }</code>
|<pre>on_new_term_election = { random_events = { 100 = usa.6 } }</pre>
|
|
|1.0
|1.0
|-
|-id="on_peaceconference_ended"
|on_peaceconference_ended
|on_peaceconference_ended
| 当和谈结束时触发命令
|Trigger the following commands whenever a peace conference ends.
|<code>on_peaceconference_ended = { effect = {...} }</code>
|<pre>on_peaceconference_ended = { effect = { &hellip; } }</pre>
| 本国(ROOT)是战胜国, 目标国(FROM)是战败国
|ROOT is the winner, FROM is the loser. Is also triggered by the <pre>white_peace</pre> effect is used or when a conditional surrender is accepted.
|1.0
|1.5
|-id="on_peaceconference_started"
|on_peaceconference_started
|Trigger the following commands whenever a peace conference starts.
|<pre>on_peaceconference_started = { effect = { &hellip; } }</pre>
|ROOT is the winner, FROM is the loser. Is also triggered by the <pre>white_peace</pre> effect is used or when a conditional surrender is accepted.
|1.12.3
|}
|}


== 外交/ 战争 ==
== Diplomacy/War ==
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="10%" | 名称
! width="10%" | Name
! width="20%" | 描述
! width="20%" | Description
! width="25%" | 示范
! width="25%" | Examples
! width="15%" | 注释
! width="15%" | Notes
! width="5%" | 添加版本
! width="5%" | Version Added
|-
|-id="on_send_volunteers"
|on_send_volunteers
|on_send_volunteers
| 当一个国家向外国送志愿军时触发命令
|Trigger the following commands whenever a country send volunteers to another.
|<code>on_send_volunteers = { effect = {...} }</code>
|<pre>on_send_volunteers = {
| 本国(ROOT )是送志愿军的国家,目标国(FROM )是收志愿军的
   effect = { &hellip; }
}</pre>
|ROOT is sender, FROM is receiver.
|1.9
|1.9
|-
<!--on_recall_volunteers isn't a real on action, despite the fact that it's listed in documentation. It's not in the binary file and trying to use it will do nothing. Note: Trying to use a non-existing on action doesn't throw an unexpected token error by itself.
|-id="on_recall_volunteers"
|on_recall_volunteers
|Trigger the following commands whenever a country recalls volunteers from another.
|<pre>on_recall_volunteers = {
   effect = { &hellip; }
}</pre>
|ROOT is recaller, FROM is originator.
| unknown - 1.9!-->
|-id="on_border_war_lost"
|on_border_war_lost
|on_border_war_lost
| 当有国家打输边境战争时触发命令
|Trigger the following commands whenever a country loses a border war.
|<code>on_border_war_lost = { effect = { owner = { country_event = { id = china.14 } } } }</code>
|<pre>on_border_war_lost = {
|
   effect = {
     owner = {
       add_ideas = lost_conflict
     }
   }
}</pre>
|"Border war" refers to the state-based border wars enabled with [[Effect#set_border_war|set_border_war]], represented with orange stripes over the state, rather than border wars that simulate combat between countries. The default scope is the state that lost the border war.
|1.0
|1.0
|-
|-id="on_war_relation_added"
|on_war_relation_added
|fired when two countries end up at war with each other (on_war is fired when a country goes to war against anyone and is not fired again when it enters war against another country unless it went to peace first)
|<pre>on_war_relation_added = {
   effect = { &hellip; }
}</pre>
|ROOT is attacker, FROM is defender
|1.9.3
|-id="on_declare_war"
|on_declare_war
|on_declare_war
| 当有国家宣战时触发命令
|Trigger the following commands whenever a country declares war.
|<code>on_declare_war = { effect = { if = { limit = { ROOT = { tag = SOV } FROM = { has_idea = anti_soviet_pact } } } } }</code>
|<pre>on_declare_war = {
| 目标(FROM)是战争目标
   effect = {
     if = {
       limit = {
         tag = GER
         FROM = { tag = SOV }
       }
       add_ideas = GER_barbarossa
     }
   }
}</pre>
|FROM is war target.
ROOT is for the country who is declaring war
|1.0
|1.0
|-
|-id="on_war"
|on_war
|on_war
| 当一个国家参加战争时触发命令
|Trigger the following commands whenever a country has just entered a state of war from initially being at peace.
|<code>on_war = { effect = { = {...} }</code>
|<pre>on_war = {
|#THIS is country that has just gotten into a war.
   effect = { &hellip; }
|1.9
}</pre>
|-
|THIS is country that has just gotten into a war.
|1.7
|-id="on_peace"
|on_peace
|Trigger the following commands whenever a country is no longer at war.
|<pre>on_peace = {
   effect = { &hellip; }
}</pre>
|THIS is country that is no longer at war.
|1.7
|-id="on_capitulation"
|on_capitulation
|on_capitulation
| 当一个国家投降时触发命令
|Trigger the following commands whenever a country capitulates, in the middle of the process.
|<code>on_capitulation = { effect = {...} }</code>
|<pre>on_capitulation = {
| 本国(ROOT)是停止抵抗国, 目标国(FROM )战胜国.
   effect = { &hellip; }
}</pre>
|ROOT is capitulated country, FROM is winner. Several processes such as the deletion of units and transfer of equipment have already been executed by this point.
|1.0
|1.0
|-
|-id="on_capitulation_immediate"
|on_capitulation_immediate
|Trigger the following commands whenever a country capitulates, at the beginning of the process.
|<pre>on_capitulation_immediate = {
   effect = { &hellip; }
}</pre>
|ROOT is capitulated country, FROM is winner.
|1.11.5
|-id="on_uncapitulation"
|on_uncapitulation
|on_uncapitulation
| 当一个投降的国家结束投降状态时触发命令
|Trigger the following commands whenever a country that was previously capitulated changes its status to no longer having capitulated.
|<code>on_uncapitulation = { effect = {...} }</code>
|<pre>on_uncapitulation = {
| 本国(ROOT)是该国家
   effect = { &hellip; }
|1.6
}</pre>
|-
|ROOT is the country affected.
|1.4
|-id="on_annex"
|on_annex
|on_annex
| 当一个国家被吞并时触发命令
|Trigger the following commands whenever a country is annexed.
|<code>on_annex = { effect = { = {...} }</code>
|<pre>on_annex = {
| 本国(ROOT)是吞并者, 目标国(FROM)是被吞并者。如果是内战结束那也会被触发
   effect = { &hellip; }
|1.0
}</pre>
|-
|ROOT is winner, FROM gets annexed. For civil wars '''on_civil_war_end''' is also fired.
|1.3.3
|-id="on_civil_war_end_before_annexation"
|on_civil_war_end_before_annexation
|on_civil_war_end_before_annexation
| 在目标国(FROM)被吞并前就触发命令那么这个国家和它的一切将依然存在
|Trigger the following commands just before FROM gets annexed, meaning the country and everything it owns still exists.
|<code>on_civil_war_end_before_annexation = { effect = { = {...} }</code>
|<pre>on_civil_war_end_before_annexation = {
| 本国(ROOT)是吞并者, 目标国( FROM) 是被吞并者. 这也会触发 '''on_annex'''
   effect = { &hellip; }
'''on_civil_war_end'''.
}</pre>
|ROOT is winner, FROM gets annexed. It will also fire '''on_annex''' and '''on_civil_war_end'''.
|1.6
|1.6
|-
|-id="on_civil_war_end"
|on_civil_war_end
|on_civil_war_end
| 内战结束时触发命令
|Trigger the following commands whenever a civil war ends.
|<code>on_civil_war_end = { effect = { = {...} }</code>
|<pre>on_civil_war_end = {
| 本国(ROOT) 是内战胜利的一方, 目标国(FROM) 是被吞并的一方。这也会触发'''on_annex'''.
   effect = { &hellip; }
}</pre>
|ROOT is civil war winner, FROM gets annexed. This will also fire '''on_annex'''.
|1.0
|1.0
|-
|-id="on_puppet"
|on_puppet
|on_puppet
| 只有当一个国家在和谈上被傀儡时触发命令
|Trigger the following commands whenever a country is puppeted in a '''peace conference only'''.
|<code>on_puppet = { effect = { = {...} }</code>
|<pre>on_puppet = {
|ROOT 是被傀儡国, FROM 是宗主国
   effect = { &hellip; }
}</pre>
|ROOT is the nation being puppeted, FROM is the overlord.
|1.0
|1.0
|-
|-id="on_liberate"
|on_liberate
|on_liberate
| 只有当一个国家在和谈上被解放时触发命令
|Trigger the following commands whenever a country is liberated in a '''peace conference only'''.
|<code>on_liberate = { effect = { = {...} }</code>
|<pre>on_liberate = {
|ROOT 是被解放国, FROM 是解放它的国家
   effect = { &hellip; }
}</pre>
|ROOT is the nation being liberated, FROM is the leader of the liberators.
|1.0
|1.0
|-
|-id="on_release_as_free"
|on_release_as_free
|on_release_as_free
| 释放国家时执行命令
|Trigger the following commands whenever a country is released.
|<code>on_release_as_free = { effect = { = {...} }</code>
|<pre>on_release_as_free = {
|ROOT 是被释放的国家,FROM 是释放者
   effect = { &hellip; }
|1.0
}</pre>
|-
|#ROOT is free nation FROM is releaser.
|1.3
|-id="on_release_as_puppet"
|on_release_as_puppet
|on_release_as_puppet
| 在和平时期通过占领区菜单释放傀儡或从占领的非核心领土上释放时触发命令
|Trigger the following commands whenever puppeting through the occupied territories menu during peace time (or when releasing from non-core but owned territory).
|<code>on_release_as_puppet = { effect = { = {...} }</code>
|<pre>on_release_as_puppet = {
|ROOT 是被释放国, FROM 是宗主国
   effect = { &hellip; }
|1.0
}</pre>
|-
|ROOT is the nation being released, FROM is the overlord.
|on_war_relation_added
|1.3
| 当两个国家彼此交战时触发(on_war一国与另一国交战时被触发,在与另外一个国家交战时则不会再被触发,除非先停战了)
|-id="on_guarantee"
原文:fired when two countries end up at war with each other (on_war is fired when a country goes to war against anyone and is not fired again when it enters war against another country unless it went to peace first)
|on_guarantee
|<code>on_war_relation_added = { effect = { = {...} } </code>
|Trigger the following commands whenever a country guarantees independence of another country.
|ROOT 是进攻国, FROM 是防御国
|
|1.9.3
|ROOT is the country which guarantees, FROM is the country that is guaranteed.
|
|-id="on_military_access"
|on_military_access
|Trigger the following commands whenever a country accepts the request for military access.
|
|ROOT is the country which requested, FROM is the country that accepted.
|
|-id="on_offer_military_access"
|on_offer_military_access
|Trigger the following commands whenever a country accepts the offer for military access.
|
|ROOT is the country which offered, FROM is the country that accepted.
|
|-id="on_call_allies"
|on_call_allies
|Trigger the following commands whenever a country accepts the call to war.
|
|ROOT is the country which called, FROM is the country that joined.
|
|-id="on_join_allies"
|on_join_allies
|Trigger the following commands whenever a country joins a war of an ally.
|
|ROOT is the country which joined, FROM is the country whose war was joined.
|
|-id="on_lend_lease"
|on_lend_lease
|Trigger the following commands whenever a country has their lend lease accepted.
|
|ROOT is the country that sent the lend lease, FROM is the country that accepted.
|
|-id="on_incoming_lend_lease"
|on_incoming_lend_lease
|Trigger the following commands whenever a country accepts a requested lend lease.
|
|ROOT is the country that accepted, FROM is the country that requested.
|
|-id="on_send_expeditionary_force"
|on_send_expeditionary_force
|Trigger the following commands whenever a country accepts sent expeditionary forces.
|
|ROOT is the country that sent, FROM is the country that accepted.
|
|-id="on_return_expeditionary_forces"
|on_return_expeditionary_forces
|Trigger the following commands whenever a country returns their expeditionary forces.
|
|ROOT is the owner of the forces, FROM is the country where the forces were sent.
|
|-id="on_request_expeditionary_forces"
|on_request_expeditionary_forces
|Trigger the following commands whenever a country guarantees independence of another country.
|
|ROOT is the country that requests, FROM is the target of the request.
|
|-id="on_ask_for_state_control"
|on_ask_for_state_control
|Trigger the following commands whenever a country accepts the request for control of a state.
|
|ROOT is the requester, FROM is the country in control of the state.
|
|-id="on_give_state_control"
|on_give_state_control
|Trigger the following commands whenever a country accepts being given control of a state.
|
|ROOT is the giver, FROM is the receiver.
|
|-id="on_peace_proposal"
|on_peace_proposal
|Trigger the following commands whenever a country accepts a conditional surrender.
|
|ROOT is sender of conditional surrender, FROM is the receiver.
|
|-id="on_send_attache"
|on_send_attache
|Triggers actions on an attache being accepted. Default scope is sender, FROM = receiver
|
|Default scope is sender, FROM = receiver
|
|}
|}


== 阵营 ==
== Faction ==
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="10%" | Name
! width="10%" | Name
第211行: 第490行:
! width="15%" | Notes
! width="15%" | Notes
! width="5%" | Version Added
! width="5%" | Version Added
|-
|-id="on_create_faction"
|on_create_faction
|on_create_faction
| 当一个国家创建一个阵营时触发命令
|Trigger the following commands whenever a country create a faction.
|<code>on_create_faction = { effect = {...} }</code>
|<pre>on_create_faction = { effect = { &hellip; } }</pre>
|FROM 是加入该阵营的国家
|FROM is the one that joins the faction.
|1.0
|1.0
|-
|-id="on_faction_formed"
|on_faction_formed
|on_faction_formed
| 当一个阵营形成时触发命令
|Trigger the following commands when a faction is formed.
|<code>on_faction_formed = { effect = { news_event = { id = news.159 } } }</code>
|<pre>on_faction_formed = { effect = { news_event = { id = news.159 } } }</pre>
|
|
|1.0
|1.0
|-
|-id="on_offer_join_faction"
|on_offer_join_faction
|on_offer_join_faction
| 当邀请一个国家加入阵营时触发命令
|Trigger the following commands whenever a country joins a faction after being invited.
|<code>on_offer_join_faction = { effect = {...} }</code>
|<pre>on_offer_join_faction = { effect = { &hellip; } }</pre>
|FROM 是被邀请的国家
|FROM is the country invited, THIS and ROOT are the faction leader.
|1.0
|1.0
|-
|-id="on_join_faction"
|on_join_faction
|on_join_faction
| 当一个国家被邀请加入阵营时对该阵营领导国家触发命令
|Trigger the following commands for a faction leader whenever a country joins after they ask to do so.
|<code>on_join_faction = { effect = {...} }</code>
|<pre>on_join_faction = { effect = { &hellip; } }</pre>
|FROM 是阵营领导者
|FROM is faction leader, ROOT and THIS are the country that joins.
|1.0
|1.0
|-
|-id="on_assume_faction_leadership"
|on_assume_faction_leadership
|on_assume_faction_leadership
| 当一个国家夺取阵营领导者时触发命令
|Trigger the following commands whenever a country assumes leadership of a faction.
|<code>on_assume_faction_leadership = { effect = {...} }</code>
|<pre>on_assume_faction_leadership = { effect = { &hellip; } }</pre>
|FROM 是前阵营领导者
| ROOT is the new faction leader FROM is the old faction leader
|1.6
|1.7
|-
|-id="on_leave_faction"
|on_leave_faction
|on_leave_faction
| 当一个国家离开阵营时触发命令
|Trigger the following commands whenever a country leave a faction.
|<code>on_leave_faction = { effect = { if = { limit = { AND = { tag = CAN NOT = { has_dlc = "Together for Victory" } } } drop_cosmetic_tag = yes } }</code>
|<pre>on_leave_faction = { effect = { if = { limit = { AND = { tag = CAN NOT = { has_dlc = "Together for Victory" } } } drop_cosmetic_tag = yes } }</pre>
|
| FROM is the faction Leader, ROOT is the country leaving the faction
|1.0
|1.0
|}
|}


== 自治权 ==
== Autonomy ==
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="10%" | Name
! width="10%" | Name
第256行: 第535行:
! width="15%" | Notes
! width="15%" | Notes
! width="5%" | Version Added
! width="5%" | Version Added
|-
|-id="on_subject_annexed"
|on_subject_annexed
|on_subject_annexed
| 当一个国家吞并了它的一个傀儡时触发命令
|Trigger the following commands when a country annex a subject.
|<code>on_subject_annexed = { effect = { ... } }</code>
|<pre>on_subject_annexed = { effect = { &hellip;  } }</pre>
|ROOT 是傀儡, FROM 是宗主国
|ROOT is the subject, FROM is the overlord.
|1.0
|1.0
|-
|-id="on_subject_free"
|on_subject_free
|on_subject_free
| 当一个国家的傀儡成为自由国家时触发命令
|Trigger the following commands when a country grants freedom to a puppet.
|<code>on_subject_free = { effect = { ... } }</code>
|<pre>on_subject_free = { effect = { &hellip;  } }</pre>
|ROOT 是傀儡, FROM 前宗主国.
|ROOT is the subject, FROM is the previous overlord.
|1.0
|1.0
|-
|-id="on_subject_autonomy_level_change"
|on_subject_autonomy_level_change
|on_subject_autonomy_level_change
| 当傀儡的自治等级改变时触发命令
|Trigger the following commands when the autonomy level of a puppet changes.
|<code>on_subject_autonomy_level_change = { effect = { ... } }</code>
|<pre>on_subject_autonomy_level_change = { effect = { &hellip;  } }</pre>
|ROOT 是傀儡, FROM 是宗主国
|ROOT is the subject, FROM is the overlord.
|1.0
|1.0
|}
|}


== 流亡政府 ==
== Governments in Exile ==
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="10%" | Name
! width="10%" | Name
第283行: 第562行:
! width="15%" | Notes
! width="15%" | Notes
! width="5%" | Version Added
! width="5%" | Version Added
|-
|-id="on_government_exiled"
|on_government_exiled
|on_government_exiled
| 当一个国家进入流亡状态时触发命令
|Trigger the following commands whenever a country becomes a government in exile.
|<code>on_government_exiled = { effect = { = {...} }</code>
|<pre>on_government_exiled = { effect = { = { &hellip; } }</pre>
|ROOT 是该流亡国家, FROM 是这个流亡政府所在的国家
|ROOT is the government in exile, FROM is the country that is hosting the government in exile.
|1.6
|1.6
|-
|-id="on_host_changed_from_capitulation"
|on_host_changed_from_capitulation
|on_host_changed_from_capitulation
| 当流亡国家所在的国家投降时触发命令
|Trigger the following commands whenever a country that is hosting a government in exile has capitulated.
|<code>on_host_changed_from_capitulation= { effect = { = {...} }</code>
|<pre>on_host_changed_from_capitulation= { effect = { = { &hellip; } }</pre>
|ROOT 是该流亡国家。  FROM 是流亡政府迁移到的新的国家。FROM:FROM 是该流亡政府之前所在的国家
|ROOT is the government in exile, FROM is the new country hosting the government in exile, FROM:FROM is the old country that was hosting the government in exile.
|1.6
|1.6
|-
|-id="on_exile_government_reinstated"
|on_exile_government_reinstated
|on_exile_government_reinstated
| 当一个流亡国家结束流亡时触发命令
|Trigger the following commands whenever a country has returned from governing in exile.
|<code>on_exile_government_reinstated = { effect = { = {...} }</code>
|<pre>on_exile_government_reinstated = { effect = { = { &hellip; } }</pre>
|ROOT 是该流亡国家, FROM 是该流亡政府曾经所在的国家
|ROOT is the government in exile, FROM is the country that was hosting the government in exile.
|1.6
|1.6
|}
|}


== 省份 ==
== States ==
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="10%" | Name
! width="10%" | Name
第310行: 第589行:
! width="15%" | Notes
! width="15%" | Notes
! width="5%" | Version Added
! width="5%" | Version Added
|-
|-id="on_state_control_changed"
|on_state_control_changed
|on_state_control_changed
| 当一个省份的控制者更改时触发命令
|Trigger the following commands when a state's controller changes.
|<code>on_state_control_changed = { effect = { ... } }</code>
|<pre>on_state_control_changed = {
|ROOT 是新控制者, FROM 旧控制者, FROM.FROM 是省份(state)ID.
   effect = {
|1.0
     if = {
       limit = {
         FROM.FROM = { state = 123 }
       }
       if =  {
         limit = {
           tag = BHR
         }
         FROM.FROM = {
           set_state_name = STATE_123_BHR
           set_province_name = {
             id = 1234
             name = VICTORY_POINTS_1234_BHR
           }
         }
       }
       else = { # Unnested else is preferred over nested
         FROM.FROM = {
           reset_state_name = yes
           reset_province_name = 1234
         }
       }
     }
   }
}</pre>
|ROOT is new controller, FROM is old controller, FROM.FROM is state ID.
|1.4
|}
|}


== 战争目标 ==
== Wargoals ==
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="10%" | Name
! width="10%" | Name
第325行: 第630行:
! width="15%" | Notes
! width="15%" | Notes
! width="5%" | Version Added
! width="5%" | Version Added
|-
|-id="on_generate_wargoal"
|on_generate_wargoal
|Trigger the following commands whenever the country generates a wargoal.
|<pre>on_generate_wargoal = {  }</pre>
|ROOT is the wargoal owner, FROM is the wargoal target
|
|-id="on_justifying_wargoal_pulse"
|on_justifying_wargoal_pulse
|on_justifying_wargoal_pulse
| 每当有国家对该国家正当化战争目标时触发命令
|Trigger the following commands whenever the country is targeted by a wargoal under justification.
|<code>on_justifying_wargoal_pulse = { random_events = { 100 = war_justification.1 } }</code>
|<pre>on_justifying_wargoal_pulse = { random_events = { 100 = war_justification.1 } }</pre>
|FROM = 目标国家。每天都进行检测
|FROM = target nation. Checked every day.
|1.0
|1.0
|-
|-id="on_wargoal_expire"
|on_wargoal_expire
|on_wargoal_expire
| 当战争借口过期时触发命令
|Trigger the following commands whenever a wargoal expire.
|<code>on_wargoal_expire = { random_events = { 100 = war_justification.301 } }</code>
|<pre>on_wargoal_expire = { random_events = { 100 = war_justification.301 } }</pre>
|FROM 是战争借口的所有国
|FROM is the wargoal owner.
|1.0
|1.0
|}
|}


== 领袖 ==
== Unit Leader ==
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="10%" | Name
! width="10%" | Name
第346行: 第657行:
! width="15%" | Notes
! width="15%" | Notes
! width="5%" | Version Added
! width="5%" | Version Added
|-
|-id="on_unit_leader_created"
|on_unit_leader_created
|on_unit_leader_created
| 当招聘一个将领时触发命令
|Trigger the following commands when an army leader is created.
|<code>on_unit_leader_created= { effect = {...} }</code>
|<pre>on_unit_leader_created = { effect = { &hellip; } }</pre>
|FROM 是该国家 ROOT 是该将领
|FROM is owner country, ROOT is the unit leader.
|1.5
|1.5
|-
|-id="on_army_leader_daily"
|on_army_leader_daily
|on_army_leader_daily
| 每天对一位将领触发命令
|Trigger the following commands on an army leader each day.
|<code>on_army_leader_daily = { effect = {...} }</code>
|<pre>on_army_leader_daily = { effect = { &hellip; } }</pre>
|FROM 是该国家
|FROM is owner country, ROOT is the unit leader.
|1.0
|1.0
|-
|-id="on_army_leader_won_combat"
|on_army_leader_won_combat
|on_army_leader_won_combat
| 当一名将领打赢一场战斗后触发命令
|Trigger the following commands whenever an army leader won a combat.
|<code>on_army_leader_won_combat = { effect = {...} }</code>
|<pre>on_army_leader_won_combat = { effect = { &hellip; } }</pre>
|FROM 是该国家
|FROM is owner country, ROOT is the unit leader.
|1.0
|1.0
|-
|-id="on_army_leader_lost_combat"
|on_army_leader_lost_combat
|on_army_leader_lost_combat
| 当一名将领打输一场战斗后触发命令
|Trigger the following commands whenever an army leader lost a combat.
|<code>on_army_leader_lost_combat = { effect = {...} }</code>
|<pre>on_army_leader_lost_combat = { effect = { &hellip; } }</pre>
|FROM 是该国家
|FROM is owner country, ROOT is the unit leader.
|1.0
|1.0
|-
|-id="on_unit_leader_level_up"
|on_unit_leader_level_up
|on_unit_leader_level_up
| 当一名将领升级时触发命令
|Trigger the following commands when a leader gain a level.
|<code>on_unit_leader_level_up = { effect = {...} }</code>
|<pre>on_unit_leader_level_up = { effect = { &hellip; } }</pre>
|
|FROM is owner country, ROOT is the unit leader.
|1.0
|1.0
|-
|-id="on_army_leader_promoted"
|on_army_leader_promoted
|on_army_leader_promoted
| 晋升将领时触发命令
|Trigger the following commands whenever a corps commander is promoted to a field marshal.
|<code>on_army_leader_lost_combat = { effect = { add_timed_unit_leader_trait = { trait = recently_promoted days = 100 } } }</code>
|<pre>on_army_leader_promoted = { effect = { add_timed_unit_leader_trait = { trait = recently_promoted days = 100 } } }</pre>
|FROM is owner country, ROOT is the unit leader.
|1.0
|-id="on_unit_leader_promote_from_ranks_veteran"
|on_unit_leader_promote_from_ranks_veteran
|Triggers the following commands whenever an unit commander gets promoted to a general.
|<pre>on_unit_leader_promote_from_ranks_veteran = { effect = { &hellip; } }</pre>
|FROM is unit, OWNER is owner country, ROOT is the unit leader.
|1.12
|-id="on_unit_leader_promote_from_ranks_green"
|on_unit_leader_promote_from_ranks_green
|Triggers the following commands whenever an unit commander gets promoted to a general.
|<pre>on_unit_leader_promote_from_ranks_green = { effect = { &hellip; } }</pre>
|FROM is unit, OWNER is owner country, ROOT is the unit leader.
|1.12
|}
 
== Military ==
{| class="wikitable sortable" width="100%"
! width="10%" | Name
! width="20%" | Description
! width="25%" | Examples
! width="15%" | Notes
! width="5%" | Version Added
|-id="on_nuke_drop"
|on_nuke_drop
|Trigger the following commands whenever a country drops a nuke.
|<pre>on_nuke_drop = {
   effect = {
     set_global_flag = first_nuke_dropped
   }
}</pre>
|ROOT is the country that launched the nuke, FROM is the nuked state.
|1.0
|-id="on_pride_of_the_fleet_sunk"
|on_pride_of_the_fleet_sunk
|Triggers when a country's pride of the fleet is sunk
|<pre>on_pride_of_the_fleet_sunk = {
   effect = {
     if = {
       limit = {
         tag = ENG
       }
       FROM = { set_country_flag = achievements_pride_and_extreme_prejudice }
     }
   }
}</pre>
|FROM is the killer country, ROOT is the country of that lost its pride of the fleet.
|1.6
|-id="on_naval_invasion"
|on_naval_invasion
|Triggers the following commands whenever a sea invasion is made.
|<pre>on_naval_invasion = {
   effect = {
     ROOT = {   # Unlike most on_actions, ROOT isn't the default scope
       add_political_power = 100
     }
   }
}</pre>
|THIS (default scope) is the invaded state, ROOT is the country that invades, FROM is the state where the invasion started
|1.9
|-id="on_paradrop"
|on_paradrop
|Triggers the following commands whenever a landing occurs.
|<pre>on_paradrop = {
   effect = {
     FROM = {
       controller = {
         add_war_support = 0.01
       }
     }
   }
}</pre>
|THIS (default scope) is the invaded state, ROOT is the country that invades, FROM is the state where the invasion started
|1.9
|-id="on_units_paradropped_in_state"
|on_units_paradropped_in_state
|This differs from on_paradrop in that it is run once per paradrop, not once per unit dropped.
|<pre>on_paradrop = {
   effect = {
     FROM = {
       controller = {
         add_war_support = 0.01
       }
     }
   }
}</pre>
|ROOT is the state that was dropped into, FROM is the dropping country.
|
|
|1.0
|-id="on_add_history"
|on_add_history
|Triggers the following commands whenever receiving a history entry.
|<pre>on_add_history = { effect = { &hellip; } }</pre>
|ROOT is the unit.
|1.12
|}
|}


== 王牌飞行员 ==
== Aces ==
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="10%" | Name
! width="10%" | Name
第391行: 第794行:
! width="15%" | Notes
! width="15%" | Notes
! width="5%" | Version Added
! width="5%" | Version Added
|-
|-id="on_ace_promoted"
|on_ace_promoted
|on_ace_promoted
| 当产生王牌时触发命令
|Trigger the following commands whenever an ace is created.
|<code>on_ace_promoted = { random_events = { 100 = ace_promoted.1 } }</code>
|<pre>on_ace_promoted = { random_events = { 100 = ace_promoted.1 } }</pre>
|FROM = 王牌
|FROM = ace.
|1.0
|1.0
|-
|-id="on_ace_killed"
|on_ace_killed
|on_ace_killed
| 当王牌阵亡时触发命令
|Trigger the following commands whenever an aces is killed.
|<code>on_ace_killed = { random_events = { 100 = ace_died.1 } }</code>
|<pre>on_ace_killed = { random_events = { 100 = ace_died.1 } }</pre>
|FROM = 王牌
|FROM = ace.
|1.0
|1.0
|-
|-id="on_ace_killed_on_accident"
|on_ace_killed_on_accident
|on_ace_killed_on_accident
| 当王牌因事故而死时触发命令
|Trigger the following commands whenever our aces died on accident.
|<code>on_ace_killed_on_accident = { random_events = { 100 = ace_died.1 } }</code>
|<pre>on_ace_killed_on_accident = { random_events = { 100 = ace_died.1 } }</pre>
|FROM = 我们的因事故而死
|FROM = our ace died in accident.
|1.9
|1.9
|-
|-id="on_non_ace_killed_other_ace"
|on_non_ace_killed_other_ace
|on_non_ace_killed_other_ace
| 当王牌击落敌军王牌时触发命令
|Trigger the following commands whenever non ace killed enemy ace.
|<code>on_non_ace_killed_other_ace = { FROM = { random_events = { 100 = ace_died.1 } } }</code>
|<pre>on_non_ace_killed_other_ace = { FROM = { random_events = { 100 = ace_died.1 } } }</pre>
|FROM = 敌军王牌
|FROM = enemy ace.
|1.9
|1.9
|-
|-id="on_ace_killed_by_ace"
|on_ace_killed_by_ace
|on_ace_killed_by_ace
| 当王牌被敌军王牌击落时触发命令
|Trigger the following commands whenever an aces is killed by another ace.
|<code>on_ace_killed_by_ace = { random_events = { 100 = ace_killed_by_ace.1 } }</code>
|<pre>on_ace_killed_by_ace = { random_events = { 100 = ace_killed_by_ace.1 } }</pre>
|FROM = 我们的王牌, PREV = 击落了 FROM 的敌军王牌.
|FROM = our ace, PREV = enemy ace, has killed FROM.
|1.0
|1.0
|-
|-id="on_ace_killed_other_ace"
|on_ace_killed_other_ace
|on_ace_killed_other_ace
| 当我们王牌击落敌军王牌时触发命令
|Trigger the following commands whenever an aces is killed by another ace (surviving ace side).
|<code>on_ace_killed_other_ace = { random_events = { 100 = ace_killed_other_ace.1 } }</code>
|<pre>on_ace_killed_other_ace = { random_events = { 100 = ace_killed_other_ace.1 } }</pre>
|FROM = 我们的王牌, PREV = FROM 击落的敌军王牌.
|FROM = our ace, PREV = enemy ace, killed by FROM.
|1.0
|1.0
|-
|-id="on_aces_killed_each_other"
|on_aces_killed_each_other
|on_aces_killed_each_other
| 当两个王牌击落了彼此时触发命令
|Trigger the following commands whenever two aces kill each other in air duel.
|<code>on_aces_killed_each_other = { random_events = { 100 = aces_killed_each_other.1 } }</code>
|<pre>on_aces_killed_each_other = { random_events = { 100 = aces_killed_each_other.1 } }</pre>
|FROM = 王牌, PREV = 敌军王牌
|FROM = ace, PREV = enemy ace.
|1.0
|1.0
|}
|}


== 抵抗运动 ==
== La Résistance ==
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="10%" | Name
! width="10%" | Name
第442行: 第845行:
! width="15%" | Notes
! width="15%" | Notes
! width="5%" | Version Added
! width="5%" | Version Added
|-
|-id="on_operation_completed"
|on_operation_completed
|on_operation_completed
| 当行动完成即触发命令
|Trigger the following commands whenever an operative completed.
|<code>on_operation_completed = { effect = {...} }</code>
|<pre>on_operation_completed = { effect = { &hellip; } }</pre>
|THIS - 这场行动, ROOT - 行动发起国, FROM - 目标国家
|THIS - the operative, ROOT - the initiating country, FROM - the target country.
|1.9
|1.9
|-
|-id="on_operative_detected_during_operation"
|on_operative_detected_during_operation
|on_operative_detected_during_operation
| 当参与行动的人员死亡时触发命令
|Trigger the following commands whenever an operative dies.
|<code>on_operative_death = { effect = {...} }</code>
|<pre>on_operative_death = { effect = { &hellip; } }</pre>
|THIS - 这场行动, ROOT - 阻止这场行动的国家( 可选), FROM - 这场行动针对的国家, FROM.FROM - 行动省份 ( 在这场行动有特定目标时才能被设置).
|THIS - the operative, ROOT - the killer country (optional), FROM - the country the operative is operating for, FROM.FROM - operation state (will only be set if the operation has a specific selection_target).
|1.9
|1.9
|-
|-id="on_operative_on_mission_spotted"
|on_operative_on_mission_spotted
|on_operative_on_mission_spotted
| 当一个特工在一个国家执行任务时触发命令
|Trigger the following commands whenever an operative performing an offensive mission in a country.
|<code>on_operative_on_mission_spotted = { effect = {...} }</code>
|<pre>on_operative_on_mission_spotted = { effect = { &hellip; } }</pre>
|THIS - 这场行动, FROM - 特工所在的国家  ROOT- 行动所针对的国家
|THIS - the operative, FROM - the country the operative was performing its mission in, ROOT - the country the operative is operating for.
|1.9
|1.9
|-
|-id="on_operative_captured"
|on_operative_captured
|on_operative_captured
| 特工被捕时触发命令
|Trigger the following commands whenever an operative is captured.
|<code>on_operative_captured = { effect = {...} }</code>
|<pre>on_operative_captured = { effect = { &hellip; } }</pre>
|THIS - the 这场行动, ROOT - 特工所在的国家, FROM - 行动所针对的国家
|THIS - the operative, ROOT - the country the operative was performing its mission in, FROM - the country the operative is operating for.
|1.9
|1.9
|-
|-id="on_operative_created"
|on_operative_created
|Trigger the following commands whenever an operative is created.
|<pre>on_operative_created = { effect = { &hellip; } }</pre>
|THIS - the operative, FROM - the country the operative is created by.
|1.9.1
|-id="on_operative_death"
|on_operative_death
|on_operative_death
|Trigger the following commands whenever an operative dies.
|Trigger the following commands whenever an operative dies.
|<code>on_operative_death = { effect = {...} }</code>
|<pre>on_operative_death = { effect = { &hellip; } }</pre>
|THIS - the operative, ROOT - the killer country (optional), FROM - the country the operative is operating for.
|THIS - the operative, ROOT - the killer country (optional), FROM - the country the operative is operating for.
|1.9
|1.9
|-
|-id="on_operative_recruited"
|on_operative_recruited
|Trigger the following commands whenever an operative is recruited.
|<pre>on_operative_recruited = { effect = { &hellip; } }</pre>
|THIS - the operative, FROM - the country the operative is created by.
|1.9.1
|-id="on_fully_decrypted_cipher"
|on_fully_decrypted_cipher
|on_fully_decrypted_cipher
|Trigger the following commands whenever a country fully decrypts cipher of a target country.
|Trigger the following commands whenever a country fully decrypts cipher of a target country.
|<code>on_fully_decrypted_cipher = { effect = {...} }</code>
|<pre>on_fully_decrypted_cipher = { effect = { &hellip; } }</pre>
|THIS - the target country that its cipher is decrypted, FROM - the decrypter country.
|THIS - the target country that its cipher is decrypted, FROM - the decrypter country.
|1.9
|1.9
|-
|-id="on_activated_active_decryption_bonuses"
|on_activated_active_decryption_bonuses
|on_activated_active_decryption_bonuses
|Trigger the following commands whenever a country activates its active cipher bonuses against a target.
|Trigger the following commands whenever a country activates its active cipher bonuses against a target.
|<code>on_activated_active_decryption_bonuses = { effect = {...} }</code>
|<pre>on_activated_active_decryption_bonuses = { effect = { &hellip; } }</pre>
|THIS - the target country, FROM - the country that activates its bonuses.
|THIS - the target country, FROM - the country that activates its bonuses.
|1.9
|1.9
|}
== Military Industrial Organization ==
{| class="wikitable sortable" width="100%"
! width="10%" | Name
! width="20%" | Description
! width="25%" | Examples
! width="15%" | Notes
! width="5%" | Version Added
|-id="on_mio_size_increased"
|on_mio_size_increased
|Trigger the following commands whenever a MIO increases in size (levels up).
|
|ROOT is the Military Industrial Organization, FROM is the owner of the MIO country
|1.13
|-id="on_mio_design_team_assigned_to_tech"
|on_mio_design_team_assigned_to_tech
|Trigger the following commands whenever a MIO is assigned to technology research.
|
|ROOT is the Military Industrial Organization, FROM is the owner of the MIO
|1.13
|-id="on_mio_design_team_assigned_to_variant"
|on_mio_design_team_assigned_to_variant
|Trigger the following commands whenever a MIO is asigned to a variant.
|
|ROOT is the Military Industrial Organization, FROM is the owner of the MIO country
|1.13
|-id="on_mio_industrial_manufacturer_assigned"
|on_mio_industrial_manufacturer_assigned
|Trigger the following commands whenever a MIO assigned to a production line.
|
|ROOT is the Military Industrial Organization, FROM is the owner of the MIO
|1.13
<!-- These do not work while still being present in the vanilla on_actions files
|-id="on_mio_tech_research_cancelled"
|on_mio_tech_research_cancelled
|Trigger the following commands whenever a technology a MIO is assigned to is canceled.
|
|ROOT is the Military Industrial Organization, FROM is the owner of the MIO
|1.13
|-id="on_mio_tech_research_completed"
|on_mio_tech_research_completed
|Trigger the following commands whenever a technology a MIO is assigned to is completed.
|
|ROOT is the Military Industrial Organization, FROM is the owner of the MIO
|1.13
-->
|-id="on_mio_industrial_manufacturer_unassigned"
|on_mio_industrial_manufacturer_unassigned
|Trigger the following commands whenever a MIO is unnasigned from a production line.
|
|ROOT is the Military Industrial Organization, FROM is the owner of the MIO
|1.13
|}
|}


{{Modding navbox}}
{{Modding navbox}}
[[ 分类:Modding]]
[[Category:Modding]]

2024年8月4日 (日) 15:35的版本


On actions are blocks that are executed when a certain action occurs, such as a country declaring war on a different country or a state changing control. On actions are stored in /Hearts of Iron IV/common/on_actions/*.txt files.

Each on action is a separate block within the on_actions = { ... } block, which is the root block of the on actions file. Each on_action has up to 2 arguments:

  • effect = { ... } is present for every single on action, being an effect block the insides of which are executed when needed.
  • random_events = { ... } is present for on_actions where the default scope (Same as ROOT, if not specified otherwise) is a country, such as on_new_term_election. This instantly fires a random one of the specified events within with the given weights being applied. This is done with a probability-proportional-to-size sampling approach.
Putting 0 instead of an event ID will ensure that nothing will happen if the chance lands on this.
Additionally, an event cannot be fired using random_events = { ... } if the event's trigger = { ... } block evaluates as false. In this case, each scope is treated the same as on action's: on action's FROM is treated as the event's FROM, same with FROM.FROM.
If there are multiple random_events blocks, one event will be picked from each.

Note that in terms of Scopes, ROOT is the default assumed scope unless specified otherwise (in on_actions that have THIS as a separate entity from ROOT), while FROM and FROM.FROM can serve as secondary blocks that are provided in addition.

Each on action can only be executed after the game's start, ignoring any effects done within history files or the bookmark's effects = { ... } section that normally would trigger one, such as set_politics.

File example

on_actions = {
    on_startup = {
        effect = { # NEVER FORGET! Important to include this line to distinguish it from random_events = { ... }
            every_country = {
                limit = {
                    is_ai = no
                }
                country_event = welcome_event.1
            }
            ENG = {
                country_event = { 
                    id = new_year.1
                    days = 365  # Fires on January 1 1937. Remember that leap days do not exist in-game.
                }
            }
        }
    }
    on_state_control_changed = {
        random_events = {
            1 = germany_state_control.1 # Assuming the triggers for the events are met, then
            1 = germany_state_control.2 # fires one of germany_state_control.1 or germany_state_control.2
            3 = 0                       # Each has a 20% chance, and there's 60% chance nothing happens.
        }
        effect = {
            if = {
                limit = {   # Execute if Italy captures Corsica or Savoy from France
                    tag = ITA
                    FROM = { tag = FRA }
                    FROM.FROM = {
                        OR = {
                            state = 1
                            state = 735
                        }
                    }
                }
                FROM.FROM = {
                    set_resistance = 60
                    damage_building = {
                        type = infrastructure
                        damage = 2
                    }
                }
            }
        }
    }
}

General on actions

Name Description Examples Notes Version Added
on_startup Trigger the following commands at the first day of a new game, after country selection. Doesn't work with save loading.
on_startup = { 
    effect = {
        ENG = {
            news_event = { id = news_event.1 days = 31 random_days = 27 } # Fires a news event in February 1936
        }  # assuming the default start date
    }      # Scoping into ENG is necessary, since
}          # news_event is a country-scoped effect
Has a default scope of none, instead of firing for each country individually as in other Paradox games such as Europa Universalis IV. Many effects that usually can be used in any scope will not work, without manual scoping into countries, states, or elsewhere. 1.3.3
on_daily Triggers each day for every country separately (performance heavy, use carefully)
on_daily = {
    effect = {
        if = {
            limit = { has_variable = to_be_updated_daily }
            add_to_variable = { to_be_updated_daily = 1 }
        } 
    }
}
Useful for scripted guis and mods adding new mechanics (can increment a variable daily e.g.). Only use scoping if you're careful to avoid duplicate effects. This being executed for every country separately means that this is essentially equivalent to a single effect executed daily inside of every_country. e.g. effect = { GER = { add_political_power = 1 } } will add ~100 political power to 德意志国的国旗 德意志国 daily, as there being ~100 countries on the world map means that this will get executed ~100 times per day. 1.5.2
on_daily_TAG Triggers each day for the specified country only
on_daily_SOV = {
    effect = {  
        if = {
            limit = { has_war_with = GER }
            SOV_escalate_the_war_effect = yes
        }
    }
}
Only runs the effects if the country exists. 1.9
on_weekly Triggers each week for every country separately
on_weekly = {
    effect = {
        if = {
            limit = { 
                has_intelligence_agency = yes
                is_ai = yes
            }
            update_operation_ai = yes
        }
    }
}
Useful for ai scripting. Runs on the beginning of the day if the num_days variable is divisible by 7. 1.9
on_weekly_TAG Triggers each week for the specified country only
on_weekly_BHR = {
    if = {
        limit = {
            has_country_flag = BHR_must_control_states
            any_owned_state = {
                NOT = { is_controlled_by = ROOT }
            }
            has_stability < 0.5
        }
        country_event = BHR_event.0
        clr_country_flag = BHR_must_control_states
    }
}
Only runs the effects if the country exists. Runs on the beginning of the day if the num_days variable is divisible by 7. 1.9
on_monthly Triggers each month for every country separately
on_monthly = { 
    random_events = {
        1 = random_event.0
        99 = 0
    }
}
1.9
on_monthly_TAG Triggers each month for the specified country only
on_monthly_USA = {
    effect = {
        add_to_variable = { USA_unrest = 1 }
        clamp_variable = {
            var = USA_unrest
            max = 10
        }
        if = {
            limit = { 
                check_variable = { USA_unrest = 10 }
            }
            country_event = usa.rebellion.0
        }
    }
}
Only runs the effects if the country exists. 1.9

Politics

Name Description Examples Notes Version Added
on_stage_coup For the non 抵抗运动抵抗运动 stage coup. Trigger the following commands whenever a coup is stage.
on_stage_coup = { 
    effect = { 
    }
}
ROOT is the country that stages the coup, FROM is the target country. 1.0
on_coup_succeeded For the non 抵抗运动抵抗运动 stage coup. Trigger the following commands whenever a coup succeeds.
on_coup_succeeded = { 
    effect = { 
        random_other_country = { 
            limit = { 
                has_government = democratic
                original_tag = ROOT
            } 
            set_politics = { elections_allowed = yes }
        }
    }
}
ROOT is the country that coup succeeded in, FROM is the stager of the coup 1.0
on_government_change Trigger the following commands whenever a country switches its government.
on_government_change = { effect = {  …  } }
This includes set_politics and start_civil_war (always for both sides) and excludes being puppeted. Will always also trigger on_ruling_party_change. 1.0
on_ruling_party_change Trigger the following commands whenever a country switches its ideology.
on_ruling_party_change = { effect = {  …  } }
old_ideology_token is a temporary variable that stores the old ideology as a token. Alongside what triggers on_government_change, also includes being puppeted or changing the ideology via a console command. 1.9
on_new_term_election Trigger the following commands whenever an election happens or is called by the hold_election command.
on_new_term_election = { random_events = { 100 = usa.6 } }
1.0
on_peaceconference_ended Trigger the following commands whenever a peace conference ends.
on_peaceconference_ended = { effect = { … } }
ROOT is the winner, FROM is the loser. Is also triggered by the
white_peace
effect is used or when a conditional surrender is accepted.
1.5
on_peaceconference_started Trigger the following commands whenever a peace conference starts.
on_peaceconference_started = { effect = { … } }
ROOT is the winner, FROM is the loser. Is also triggered by the
white_peace
effect is used or when a conditional surrender is accepted.
1.12.3

Diplomacy/War

Name Description Examples Notes Version Added
on_send_volunteers Trigger the following commands whenever a country send volunteers to another.
on_send_volunteers = {
    effect = { … }
}
ROOT is sender, FROM is receiver. 1.9
on_border_war_lost Trigger the following commands whenever a country loses a border war.
on_border_war_lost = {
    effect = {
        owner = {
            add_ideas = lost_conflict
        }
    }
}
"Border war" refers to the state-based border wars enabled with set_border_war, represented with orange stripes over the state, rather than border wars that simulate combat between countries. The default scope is the state that lost the border war. 1.0
on_war_relation_added fired when two countries end up at war with each other (on_war is fired when a country goes to war against anyone and is not fired again when it enters war against another country unless it went to peace first)
on_war_relation_added = {
    effect = { … }
}
ROOT is attacker, FROM is defender 1.9.3
on_declare_war Trigger the following commands whenever a country declares war.
on_declare_war = {
    effect = {
        if = {
            limit = {
                tag = GER
                FROM = { tag = SOV }
            }
            add_ideas = GER_barbarossa
        }
    }
}
FROM is war target.

ROOT is for the country who is declaring war

1.0
on_war Trigger the following commands whenever a country has just entered a state of war from initially being at peace.
on_war = {
    effect = { … }
}
THIS is country that has just gotten into a war. 1.7
on_peace Trigger the following commands whenever a country is no longer at war.
on_peace = {
    effect = { … }
}
THIS is country that is no longer at war. 1.7
on_capitulation Trigger the following commands whenever a country capitulates, in the middle of the process.
on_capitulation = {
    effect = { … }
}
ROOT is capitulated country, FROM is winner. Several processes such as the deletion of units and transfer of equipment have already been executed by this point. 1.0
on_capitulation_immediate Trigger the following commands whenever a country capitulates, at the beginning of the process.
on_capitulation_immediate = {
    effect = { … }
}
ROOT is capitulated country, FROM is winner. 1.11.5
on_uncapitulation Trigger the following commands whenever a country that was previously capitulated changes its status to no longer having capitulated.
on_uncapitulation = {
    effect = { … }
}
ROOT is the country affected. 1.4
on_annex Trigger the following commands whenever a country is annexed.
on_annex = {
    effect = { … }
}
ROOT is winner, FROM gets annexed. For civil wars on_civil_war_end is also fired. 1.3.3
on_civil_war_end_before_annexation Trigger the following commands just before FROM gets annexed, meaning the country and everything it owns still exists.
on_civil_war_end_before_annexation = {
    effect = { … }
}
ROOT is winner, FROM gets annexed. It will also fire on_annex and on_civil_war_end. 1.6
on_civil_war_end Trigger the following commands whenever a civil war ends.
on_civil_war_end = {
    effect = { … }
}
ROOT is civil war winner, FROM gets annexed. This will also fire on_annex. 1.0
on_puppet Trigger the following commands whenever a country is puppeted in a peace conference only.
on_puppet = {
    effect = { … }
}
ROOT is the nation being puppeted, FROM is the overlord. 1.0
on_liberate Trigger the following commands whenever a country is liberated in a peace conference only.
on_liberate = {
    effect = { … }
}
ROOT is the nation being liberated, FROM is the leader of the liberators. 1.0
on_release_as_free Trigger the following commands whenever a country is released.
on_release_as_free = {
    effect = { … }
}
#ROOT is free nation FROM is releaser. 1.3
on_release_as_puppet Trigger the following commands whenever puppeting through the occupied territories menu during peace time (or when releasing from non-core but owned territory).
on_release_as_puppet = {
    effect = { … }
}
ROOT is the nation being released, FROM is the overlord. 1.3
on_guarantee Trigger the following commands whenever a country guarantees independence of another country. ROOT is the country which guarantees, FROM is the country that is guaranteed.
on_military_access Trigger the following commands whenever a country accepts the request for military access. ROOT is the country which requested, FROM is the country that accepted.
on_offer_military_access Trigger the following commands whenever a country accepts the offer for military access. ROOT is the country which offered, FROM is the country that accepted.
on_call_allies Trigger the following commands whenever a country accepts the call to war. ROOT is the country which called, FROM is the country that joined.
on_join_allies Trigger the following commands whenever a country joins a war of an ally. ROOT is the country which joined, FROM is the country whose war was joined.
on_lend_lease Trigger the following commands whenever a country has their lend lease accepted. ROOT is the country that sent the lend lease, FROM is the country that accepted.
on_incoming_lend_lease Trigger the following commands whenever a country accepts a requested lend lease. ROOT is the country that accepted, FROM is the country that requested.
on_send_expeditionary_force Trigger the following commands whenever a country accepts sent expeditionary forces. ROOT is the country that sent, FROM is the country that accepted.
on_return_expeditionary_forces Trigger the following commands whenever a country returns their expeditionary forces. ROOT is the owner of the forces, FROM is the country where the forces were sent.
on_request_expeditionary_forces Trigger the following commands whenever a country guarantees independence of another country. ROOT is the country that requests, FROM is the target of the request.
on_ask_for_state_control Trigger the following commands whenever a country accepts the request for control of a state. ROOT is the requester, FROM is the country in control of the state.
on_give_state_control Trigger the following commands whenever a country accepts being given control of a state. ROOT is the giver, FROM is the receiver.
on_peace_proposal Trigger the following commands whenever a country accepts a conditional surrender. ROOT is sender of conditional surrender, FROM is the receiver.
on_send_attache Triggers actions on an attache being accepted. Default scope is sender, FROM = receiver Default scope is sender, FROM = receiver

Faction

Name Description Examples Notes Version Added
on_create_faction Trigger the following commands whenever a country create a faction.
on_create_faction = { effect = { … } }
FROM is the one that joins the faction. 1.0
on_faction_formed Trigger the following commands when a faction is formed.
on_faction_formed = { effect = { news_event = { id = news.159 } } }
1.0
on_offer_join_faction Trigger the following commands whenever a country joins a faction after being invited.
on_offer_join_faction = { effect = { … } }
FROM is the country invited, THIS and ROOT are the faction leader. 1.0
on_join_faction Trigger the following commands for a faction leader whenever a country joins after they ask to do so.
on_join_faction = { effect = { … } }
FROM is faction leader, ROOT and THIS are the country that joins. 1.0
on_assume_faction_leadership Trigger the following commands whenever a country assumes leadership of a faction.
on_assume_faction_leadership = { effect = { … } }
ROOT is the new faction leader FROM is the old faction leader 1.7
on_leave_faction Trigger the following commands whenever a country leave a faction.
on_leave_faction = { effect = { if = { limit = { AND = { tag = CAN NOT = { has_dlc = "Together for Victory" } } } drop_cosmetic_tag = yes } }
FROM is the faction Leader, ROOT is the country leaving the faction 1.0

Autonomy

Name Description Examples Notes Version Added
on_subject_annexed Trigger the following commands when a country annex a subject.
on_subject_annexed = { effect = {  …  } }
ROOT is the subject, FROM is the overlord. 1.0
on_subject_free Trigger the following commands when a country grants freedom to a puppet.
on_subject_free = { effect = {  …  } }
ROOT is the subject, FROM is the previous overlord. 1.0
on_subject_autonomy_level_change Trigger the following commands when the autonomy level of a puppet changes.
on_subject_autonomy_level_change = { effect = {  …  } }
ROOT is the subject, FROM is the overlord. 1.0

Governments in Exile

Name Description Examples Notes Version Added
on_government_exiled Trigger the following commands whenever a country becomes a government in exile.
on_government_exiled = { effect = { = { … } }
ROOT is the government in exile, FROM is the country that is hosting the government in exile. 1.6
on_host_changed_from_capitulation Trigger the following commands whenever a country that is hosting a government in exile has capitulated.
on_host_changed_from_capitulation= { effect = { = { … } }
ROOT is the government in exile, FROM is the new country hosting the government in exile, FROM:FROM is the old country that was hosting the government in exile. 1.6
on_exile_government_reinstated Trigger the following commands whenever a country has returned from governing in exile.
on_exile_government_reinstated = { effect = { = { … } }
ROOT is the government in exile, FROM is the country that was hosting the government in exile. 1.6

States

Name Description Examples Notes Version Added
on_state_control_changed Trigger the following commands when a state's controller changes.
on_state_control_changed = {
    effect = {
        if = {
            limit = {
                FROM.FROM = { state = 123 }
            }
            if =  {
                limit = {
                    tag = BHR
                }
                FROM.FROM = {
                    set_state_name = STATE_123_BHR
                    set_province_name = {
                        id = 1234
                        name = VICTORY_POINTS_1234_BHR
                    }
                }
            }
            else = { # Unnested else is preferred over nested
                FROM.FROM = {
                    reset_state_name = yes
                    reset_province_name = 1234
                }
            }
        }
    }
}
ROOT is new controller, FROM is old controller, FROM.FROM is state ID. 1.4

Wargoals

Name Description Examples Notes Version Added
on_generate_wargoal Trigger the following commands whenever the country generates a wargoal.
on_generate_wargoal = {  }
ROOT is the wargoal owner, FROM is the wargoal target
on_justifying_wargoal_pulse Trigger the following commands whenever the country is targeted by a wargoal under justification.
on_justifying_wargoal_pulse = { random_events = { 100 = war_justification.1 } }
FROM = target nation. Checked every day. 1.0
on_wargoal_expire Trigger the following commands whenever a wargoal expire.
on_wargoal_expire = { random_events = { 100 = war_justification.301 } }
FROM is the wargoal owner. 1.0

Unit Leader

Name Description Examples Notes Version Added
on_unit_leader_created Trigger the following commands when an army leader is created.
on_unit_leader_created = { effect = { … } }
FROM is owner country, ROOT is the unit leader. 1.5
on_army_leader_daily Trigger the following commands on an army leader each day.
on_army_leader_daily = { effect = { … } }
FROM is owner country, ROOT is the unit leader. 1.0
on_army_leader_won_combat Trigger the following commands whenever an army leader won a combat.
on_army_leader_won_combat = { effect = { … } }
FROM is owner country, ROOT is the unit leader. 1.0
on_army_leader_lost_combat Trigger the following commands whenever an army leader lost a combat.
on_army_leader_lost_combat = { effect = { … } }
FROM is owner country, ROOT is the unit leader. 1.0
on_unit_leader_level_up Trigger the following commands when a leader gain a level.
on_unit_leader_level_up = { effect = { … } }
FROM is owner country, ROOT is the unit leader. 1.0
on_army_leader_promoted Trigger the following commands whenever a corps commander is promoted to a field marshal.
on_army_leader_promoted = { effect = { add_timed_unit_leader_trait = { trait = recently_promoted days = 100 } } }
FROM is owner country, ROOT is the unit leader. 1.0
on_unit_leader_promote_from_ranks_veteran Triggers the following commands whenever an unit commander gets promoted to a general.
on_unit_leader_promote_from_ranks_veteran = { effect = { … } }
FROM is unit, OWNER is owner country, ROOT is the unit leader. 1.12
on_unit_leader_promote_from_ranks_green Triggers the following commands whenever an unit commander gets promoted to a general.
on_unit_leader_promote_from_ranks_green = { effect = { … } }
FROM is unit, OWNER is owner country, ROOT is the unit leader. 1.12

Military

Name Description Examples Notes Version Added
on_nuke_drop Trigger the following commands whenever a country drops a nuke.
on_nuke_drop = {
    effect = {
        set_global_flag = first_nuke_dropped
    }
}
ROOT is the country that launched the nuke, FROM is the nuked state. 1.0
on_pride_of_the_fleet_sunk Triggers when a country's pride of the fleet is sunk
on_pride_of_the_fleet_sunk = {
    effect = {
        if = {
            limit = {
                tag = ENG
            }
            FROM = { set_country_flag = achievements_pride_and_extreme_prejudice }
        }
    }
}
FROM is the killer country, ROOT is the country of that lost its pride of the fleet. 1.6
on_naval_invasion Triggers the following commands whenever a sea invasion is made.
on_naval_invasion = {
    effect = { 
        ROOT = {    # Unlike most on_actions, ROOT isn't the default scope
            add_political_power = 100
        }
    }
}
THIS (default scope) is the invaded state, ROOT is the country that invades, FROM is the state where the invasion started 1.9
on_paradrop Triggers the following commands whenever a landing occurs.
on_paradrop = { 
    effect = {
        FROM = {
            controller = {
                add_war_support = 0.01
            }
        }
    }
}
THIS (default scope) is the invaded state, ROOT is the country that invades, FROM is the state where the invasion started 1.9
on_units_paradropped_in_state This differs from on_paradrop in that it is run once per paradrop, not once per unit dropped.
on_paradrop = { 
    effect = {
        FROM = {
            controller = {
                add_war_support = 0.01
            }
        }
    }
}
ROOT is the state that was dropped into, FROM is the dropping country.
on_add_history Triggers the following commands whenever receiving a history entry.
on_add_history = { effect = { … } }
ROOT is the unit. 1.12

Aces

Name Description Examples Notes Version Added
on_ace_promoted Trigger the following commands whenever an ace is created.
on_ace_promoted = { random_events = { 100 = ace_promoted.1 } }
FROM = ace. 1.0
on_ace_killed Trigger the following commands whenever an aces is killed.
on_ace_killed = { random_events = { 100 = ace_died.1 } }
FROM = ace. 1.0
on_ace_killed_on_accident Trigger the following commands whenever our aces died on accident.
on_ace_killed_on_accident = { random_events = { 100 = ace_died.1 } }
FROM = our ace died in accident. 1.9
on_non_ace_killed_other_ace Trigger the following commands whenever non ace killed enemy ace.
on_non_ace_killed_other_ace = { FROM = { random_events = { 100 = ace_died.1 } } }
FROM = enemy ace. 1.9
on_ace_killed_by_ace Trigger the following commands whenever an aces is killed by another ace.
on_ace_killed_by_ace = { random_events = { 100 = ace_killed_by_ace.1 } }
FROM = our ace, PREV = enemy ace, has killed FROM. 1.0
on_ace_killed_other_ace Trigger the following commands whenever an aces is killed by another ace (surviving ace side).
on_ace_killed_other_ace = { random_events = { 100 = ace_killed_other_ace.1 } }
FROM = our ace, PREV = enemy ace, killed by FROM. 1.0
on_aces_killed_each_other Trigger the following commands whenever two aces kill each other in air duel.
on_aces_killed_each_other = { random_events = { 100 = aces_killed_each_other.1 } }
FROM = ace, PREV = enemy ace. 1.0

La Résistance

Name Description Examples Notes Version Added
on_operation_completed Trigger the following commands whenever an operative completed.
on_operation_completed = { effect = { … } }
THIS - the operative, ROOT - the initiating country, FROM - the target country. 1.9
on_operative_detected_during_operation Trigger the following commands whenever an operative dies.
on_operative_death = { effect = { … } }
THIS - the operative, ROOT - the killer country (optional), FROM - the country the operative is operating for, FROM.FROM - operation state (will only be set if the operation has a specific selection_target). 1.9
on_operative_on_mission_spotted Trigger the following commands whenever an operative performing an offensive mission in a country.
on_operative_on_mission_spotted = { effect = { … } }
THIS - the operative, FROM - the country the operative was performing its mission in, ROOT - the country the operative is operating for. 1.9
on_operative_captured Trigger the following commands whenever an operative is captured.
on_operative_captured = { effect = { … } }
THIS - the operative, ROOT - the country the operative was performing its mission in, FROM - the country the operative is operating for. 1.9
on_operative_created Trigger the following commands whenever an operative is created.
on_operative_created = { effect = { … } }
THIS - the operative, FROM - the country the operative is created by. 1.9.1
on_operative_death Trigger the following commands whenever an operative dies.
on_operative_death = { effect = { … } }
THIS - the operative, ROOT - the killer country (optional), FROM - the country the operative is operating for. 1.9
on_operative_recruited Trigger the following commands whenever an operative is recruited.
on_operative_recruited = { effect = { … } }
THIS - the operative, FROM - the country the operative is created by. 1.9.1
on_fully_decrypted_cipher Trigger the following commands whenever a country fully decrypts cipher of a target country.
on_fully_decrypted_cipher = { effect = { … } }
THIS - the target country that its cipher is decrypted, FROM - the decrypter country. 1.9
on_activated_active_decryption_bonuses Trigger the following commands whenever a country activates its active cipher bonuses against a target.
on_activated_active_decryption_bonuses = { effect = { … } }
THIS - the target country, FROM - the country that activates its bonuses. 1.9

Military Industrial Organization

Name Description Examples Notes Version Added
on_mio_size_increased Trigger the following commands whenever a MIO increases in size (levels up). ROOT is the Military Industrial Organization, FROM is the owner of the MIO country 1.13
on_mio_design_team_assigned_to_tech Trigger the following commands whenever a MIO is assigned to technology research. ROOT is the Military Industrial Organization, FROM is the owner of the MIO 1.13
on_mio_design_team_assigned_to_variant Trigger the following commands whenever a MIO is asigned to a variant. ROOT is the Military Industrial Organization, FROM is the owner of the MIO country 1.13
on_mio_industrial_manufacturer_assigned Trigger the following commands whenever a MIO assigned to a production line. ROOT is the Military Industrial Organization, FROM is the owner of the MIO 1.13
on_mio_industrial_manufacturer_unassigned Trigger the following commands whenever a MIO is unnasigned from a production line. ROOT is the Military Industrial Organization, FROM is the owner of the MIO 1.13