执行:修订间差异

本页面所适用的版本可能已经过时,最后更新于1.9
无编辑摘要
第7行: 第7行:
! width="25%" | 示范
! width="25%" | 示范
! width="15%" | 注释
! width="15%" | 注释
! width="5%" | Version Added
! width="5%" | 添加版本
|-
|-
|on_startup
|on_startup
第48行: 第48行:
|当有国家丢核弹时触发命令
|当有国家丢核弹时触发命令
|<code>on_nuke_drop = {effect = { set_global_flag = first_nuke_dropped } }</code>
|<code>on_nuke_drop = {effect = { set_global_flag = first_nuke_dropped } }</code>
|FROM 是被炸的省份
| 目标国(FROM) 是被炸的省份
|1.0
|1.0
|-
|-
第54行: 第54行:
|当有国家的舰队荣耀被击沉时触发命令
|当有国家的舰队荣耀被击沉时触发命令
|<code>on_pride_of_the_fleet_sunk = { effect = { ... } }</code>
|<code>on_pride_of_the_fleet_sunk = { effect = { ... } }</code>
|FROM 是击沉它的国家, ROOT 是被击沉的国家
| 目标国(FROM) 是击沉它的国家, 本国(ROOT) 是被击沉的国家
|1.6
|1.6
|-
|-
|on_naval_invasion
|on_naval_invasion
|Triggers the following commands whenever a sea invasion is made.
| 当进行登陆作战时触发命令
|<code>on_naval_invasion = { effect = { ... } }</code>
|<code>on_naval_invasion = { effect = { ... } }</code>
|THIS state that is invaded, ROOT country that invades, FROM state that the invasion started
| 该省是被登陆的省份,本国( ROOT )是进行登陆的国家。目标(FROM)省份是该登陆行动开始的省份
|1.9
|1.9
|-
|-
|on_paradrop
|on_paradrop
|Triggers the following commands whenever a landing occurs.
| 当伞兵空降时触发命令
|<code>on_paradrop = { effect = { ... } }</code>
|<code>on_paradrop = { effect = { ... } }</code>
|THIS state that is invaded, ROOT country that invades, FROM state that the invasion started
| 该(THIS)省是被空降的省份,本国( ROOT )是执行空降的国家。目标(FROM)省份是该空降行动开始的省份
|1.9
|1.9
|}
|}
第72行: 第72行:
== 政治 ==
== 政治 ==
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="10%" | Name
! width="10%" | 名称
! width="20%" | Description
! width="20%" | 描述
! width="25%" | Examples
! width="25%" | 示范
! width="15%" | Notes
! width="15%" | 注释
! width="5%" | Version Added
! width="5%" | 添加版本
|-
|-
|on_coup_succeeded
|on_coup_succeeded
|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>
|<code>on_coup_succeeded = { effect = { random_other_country = { limit = { has_government = democratic original_tag = ROOT } set_politics = { elections_allowed = yes } } } }</code>
|
|
第85行: 第85行:
|-
|-
|on_government_change
|on_government_change
|Trigger the following commands whenever a country switch government.
| 当一个国家改变政府时触发命令
|<code>on_government_change = { effect = { ... } }</code>
|<code>on_government_change = { effect = { ... } }</code>
|
|
第91行: 第91行:
|-
|-
|on_ruling_party_change
|on_ruling_party_change
|Trigger the following commands whenever a country switch ideology.
| 当一个国家改变意识形态时触发命令
|<code>on_ruling_party_change = { effect = { ... } }</code>
|<code>on_ruling_party_change = { effect = { ... } }</code>
|
|
第97行: 第97行:
|-
|-
|on_new_term_election
|on_new_term_election
|Trigger the following commands whenever an election happen or is called by the '''hold_election''' command.
| 当选举开始或正在选举时触发命令
|<code>on_new_term_election = { random_events = { 100 = usa.6 } }</code>
|<code>on_new_term_election = { random_events = { 100 = usa.6 } }</code>
|
|
第103行: 第103行:
|-
|-
|on_peaceconference_ended
|on_peaceconference_ended
|Trigger the following commands whenever a peace conference ends.
| 当和谈结束时触发命令
|<code>on_peaceconference_ended = { effect = {...} }</code>
|<code>on_peaceconference_ended = { effect = {...} }</code>
|ROOT is the winner, FROM is the loser.
| 本国(ROOT)是战胜国, 目标国(FROM)是战败国
|1.0
|1.0
|}
|}
第111行: 第111行:
== 外交/战争 ==
== 外交/战争 ==
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="10%" | Name
! width="10%" | 名称
! width="20%" | Description
! width="20%" | 描述
! width="25%" | Examples
! width="25%" | 示范
! width="15%" | Notes
! width="15%" | 注释
! width="5%" | Version Added
! width="5%" | 添加版本
|-
|-
|on_send_volunteers
|on_send_volunteers
|Trigger the following commands whenever a country send volunteers to another.
| 当一个国家向外国送志愿军时触发命令
|<code>on_send_volunteers = { effect = {...} }</code>
|<code>on_send_volunteers = { effect = {...} }</code>
|ROOT is sender, FROM is receiver.
| 本国(ROOT )是送志愿军的国家,目标国(FROM )是收志愿军的
|1.9
|1.9
|-
|-
|on_border_war_lost
|on_border_war_lost
|Trigger the following commands whenever a country lose a border war.
| 当有国家打输边境战争时触发命令
|<code>on_border_war_lost = { effect = { owner = { country_event = { id = china.14 } } } }</code>
|<code>on_border_war_lost = { effect = { owner = { country_event = { id = china.14 } } } }</code>
|
|
第130行: 第130行:
|-
|-
|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>
|<code>on_declare_war = { effect = { if = { limit = { ROOT = { tag = SOV } FROM = { has_idea = anti_soviet_pact } } } } }</code>
|FROM is war target.
| 目标(FROM)是战争目标
|1.0
|1.0
|-
|-
|on_war
|on_war
|Trigger the following commands whenever a country has just entered a war.
| 当一个国家参加战争时触发命令
|<code>on_war = { effect = { = {...} }</code>
|<code>on_war = { effect = { = {...} }</code>
|#THIS is country that has just gotten into a war.
|#THIS is country that has just gotten into a war.
第142行: 第142行:
|-
|-
|on_capitulation
|on_capitulation
|Trigger the following commands whenever a country capitulates.
| 当一个国家停止抵抗时触发命令
|<code>on_capitulation = { effect = {...} }</code>
|<code>on_capitulation = { effect = {...} }</code>
|ROOT is capitulated country, FROM is winner.
| 本国(ROOT)是停止抵抗国, 目标国(FROM )战胜国.
|1.0
|1.0
|-
|-
|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>
|<code>on_uncapitulation = { effect = {...} }</code>
|ROOT is the country affected.
| 本国(ROOT)是变为非流亡状态的国家
|1.6
|1.6
|-
|-
|on_annex
|on_annex
|Trigger the following commands whenever a country is annexed.
| 当一个国家被吞并时触发命令
|<code>on_annex = { effect = { = {...} }</code>
|<code>on_annex = { effect = { = {...} }</code>
|ROOT is winner, FROM gets annexed. For civil wars '''on_civil_war_end''' is also fired.
| 本国(ROOT)是吞并者, 目标国(FROM)是被吞并者。如果是内战结束那也会被触发
|1.0
|1.0
|-
|-
|on_civil_war_end_before_annexation
|on_civil_war_end_before_annexation
|Trigger the following commands just before FROM gets annexed, meaning the country and everything it owns still exists.
| 在目标国(FROM)被吞并前就触发命令那么这个国家和它的一切将依然存在
|<code>on_civil_war_end_before_annexation = { effect = { = {...} }</code>
|<code>on_civil_war_end_before_annexation = { effect = { = {...} }</code>
|ROOT is winner, FROM gets annexed. It will also fire '''on_annex''' and '''on_civil_war_end'''.
| 本国(ROOT)是吞并者, 目标国( FROM) 是被吞并者. 这也会触发 '''on_annex'''
'''on_civil_war_end'''.
|1.6
|1.6
|-
|-
|on_civil_war_end
|on_civil_war_end
|Trigger the following commands whenever a civil war ends.
| 内战结束时触发命令
|<code>on_civil_war_end = { effect = { = {...} }</code>
|<code>on_civil_war_end = { effect = { = {...} }</code>
|ROOT is civil war winner, FROM gets annexed. This will also fire '''on_annex'''.
| 本国(ROOT) 是内战胜利的一方, 目标国(FROM) 是被吞并的一方。这也会触发'''on_annex'''.
|1.0
|1.0
|-
|-
|on_puppet
|on_puppet
|Trigger the following commands whenever a country is puppeted in a peace conference '''only'''.
| 只有当一个国家在和谈上被傀儡时触发命令
|<code>on_puppet = { effect = { = {...} }</code>
|<code>on_puppet = { effect = { = {...} }</code>
|ROOT is the nation being puppeted, FROM is the overlord.
|ROOT 是被傀儡国, FROM 是宗主国
|1.0
|1.0
|-
|-
|on_liberate
|on_liberate
|Trigger the following commands whenever a country is liberated in a peace conference '''only'''.
| 只有当一个国家在和谈上被解放时触发命令
|<code>on_liberate = { effect = { = {...} }</code>
|<code>on_liberate = { effect = { = {...} }</code>
|ROOT is the nation being liberated, FROM is the leader of the liberators.
|ROOT 是被解放国, FROM 是解放它的国家
|1.0
|1.0
|-
|-

2021年2月7日 (日) 15:06的版本


杂项

名称 描述 示范 注释 添加版本
on_startup 在新游戏的第一天触发(不包括保存与加载) on_startup = { effect = { ... } } 1.0
on_daily 每一天对每个国家触发(对性能要求高,要谨慎使用呀~) on_daily = { effect = { ... } } 对于给mod添加新机制很有用(比如说可以每天新增一个变量) 1.5.2
on_weekly 每周对每个国家触发 on_weekly = { effect = { ... } } 对于写ai的脚本很有用 1.9
on_weekly_TAG 每周对指定(TAG)的国家触发 on_weekly_TAG = { effect = { ... } } 1.9
on_monthly 每月对每个国家触发 on_monthly = { effect = { ... } } 1.9
on_monthly_TAG 每周对指定(TAG)的国家触发 on_monthly_TAG = { effect = { ... } } 1.9
on_nuke_drop 当有国家丢核弹时触发命令 on_nuke_drop = {effect = { set_global_flag = first_nuke_dropped } } 目标国(FROM)是被炸的省份 1.0
on_pride_of_the_fleet_sunk 当有国家的舰队荣耀被击沉时触发命令 on_pride_of_the_fleet_sunk = { effect = { ... } } 目标国(FROM)是击沉它的国家, 本国(ROOT) 是被击沉的国家 1.6
on_naval_invasion 当进行登陆作战时触发命令 on_naval_invasion = { effect = { ... } } 该省是被登陆的省份,本国( ROOT)是进行登陆的国家。目标(FROM)省份是该登陆行动开始的省份 1.9
on_paradrop 当伞兵空降时触发命令 on_paradrop = { effect = { ... } } 该(THIS)省是被空降的省份,本国( ROOT)是执行空降的国家。目标(FROM)省份是该空降行动开始的省份 1.9

政治

名称 描述 示范 注释 添加版本
on_coup_succeeded 政变成功时触发命令 on_coup_succeeded = { effect = { random_other_country = { limit = { has_government = democratic original_tag = ROOT } set_politics = { elections_allowed = yes } } } } 1.0
on_government_change 当一个国家改变政府时触发命令 on_government_change = { effect = { ... } } 1.0
on_ruling_party_change 当一个国家改变意识形态时触发命令 on_ruling_party_change = { effect = { ... } } 1.9
on_new_term_election 当选举开始或正在选举时触发命令 on_new_term_election = { random_events = { 100 = usa.6 } } 1.0
on_peaceconference_ended 当和谈结束时触发命令 on_peaceconference_ended = { effect = {...} } 本国(ROOT)是战胜国, 目标国(FROM)是战败国 1.0

外交/战争

名称 描述 示范 注释 添加版本
on_send_volunteers 当一个国家向外国送志愿军时触发命令 on_send_volunteers = { effect = {...} } 本国(ROOT)是送志愿军的国家,目标国(FROM)是收志愿军的 1.9
on_border_war_lost 当有国家打输边境战争时触发命令 on_border_war_lost = { effect = { owner = { country_event = { id = china.14 } } } } 1.0
on_declare_war 当有国家宣战时触发命令 on_declare_war = { effect = { if = { limit = { ROOT = { tag = SOV } FROM = { has_idea = anti_soviet_pact } } } } } 目标(FROM)是战争目标 1.0
on_war 当一个国家参加战争时触发命令 on_war = { effect = { = {...} } #THIS is country that has just gotten into a war. 1.9
on_capitulation 当一个国家停止抵抗时触发命令 on_capitulation = { effect = {...} } 本国(ROOT)是停止抵抗国, 目标国(FROM)战胜国. 1.0
on_uncapitulation 当一个停止抵抗的国家从流亡状态变为非流亡时触发命令 on_uncapitulation = { effect = {...} } 本国(ROOT)是变为非流亡状态的国家 1.6
on_annex 当一个国家被吞并时触发命令 on_annex = { effect = { = {...} } 本国(ROOT)是吞并者, 目标国(FROM)是被吞并者。如果是内战结束那也会被触发 1.0
on_civil_war_end_before_annexation 在目标国(FROM)被吞并前就触发命令那么这个国家和它的一切将依然存在 on_civil_war_end_before_annexation = { effect = { = {...} } 本国(ROOT)是吞并者,目标国( FROM) 是被吞并者. 这也会触发 on_annex

on_civil_war_end.

1.6
on_civil_war_end 内战结束时触发命令 on_civil_war_end = { effect = { = {...} } 本国(ROOT) 是内战胜利的一方, 目标国(FROM) 是被吞并的一方。这也会触发on_annex. 1.0
on_puppet 只有当一个国家在和谈上被傀儡时触发命令 on_puppet = { effect = { = {...} } ROOT 是被傀儡国, FROM是宗主国 1.0
on_liberate 只有当一个国家在和谈上被解放时触发命令 on_liberate = { effect = { = {...} } ROOT是被解放国, FROM 是解放它的国家 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.0
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.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

阵营

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 is invited in a faction. on_offer_join_faction = { effect = {...} } FROM is the country invited. 1.0
on_join_faction Trigger the following commands for a faction leader whenever a country is invited in his faction. on_join_faction = { effect = {...} } FROM is faction leader on join faction requests. 1.0
on_assume_faction_leadership Trigger the following commands whenever a country assumes leadership of a faction. on_assume_faction_leadership = { effect = {...} } FROM is the former faction leader. 1.6
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 } } 1.0

自治权

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

流亡政府

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

省份

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 = { ... } } ROOT is new controller, FROM is old controller, FROM.FROM is state ID. 1.0

战争目标

Name Description Examples Notes Version Added
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

领袖

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. 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. 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. 1.0
on_unit_leader_level_up Trigger the following commands when a leader gain a level. on_unit_leader_level_up = { effect = {...} } 1.0
on_army_leader_promoted Trigger the following commands whenever an army leader is promoted. on_army_leader_lost_combat = { effect = { add_timed_unit_leader_trait = { trait = recently_promoted days = 100 } } } 1.0

王牌飞行员

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

抵抗运动

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_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_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