效果
原页面:Effect
效果(也称指令,Commands)用于在特定作用域内动态影响游戏。它们是对游戏当前状态的一次性改动,无法产生持久影响。与之相对,修正 用于对游戏状态施加可量化的持续、永久影响。效果块不能直接施加修正,但可以添加能够施加修正的东西,最常见的是通过 add_ideas。
效果在游戏中用于众多作用域,最常见的可编辑效果块是 国策奖励、事件选项 和 决议效果。
请注意,某些效果可以从变量取值,即 add_manpower = var:my_var 这在效果参数中由 <variable> 标明。有关变量效果的信息,请参见变量。
效果列表可能已经过时。完整但未排序的效果列表可在 /Hearts of Iron IV/documentation/effects_documentation.html 或 /Hearts of Iron IV/documentation/effects_documentation.md 中找到。
作用域
- 主条目:作用域
Scopes serve as special effect types that modify the entity that serves as the context for the effects being executed, such as GER = { add_political_power = 150 } adding 150 political power to
德国.
效果作用域
这些只能作为效果使用;把它们当作 触发器 使用将不会产生任何效果。
| 名称 | 用法 | 目标类型 | 示例 | 描述 | 加入版本 |
|---|---|---|---|---|---|
| every_possible_country | 始终可用 | 国家 | every_possible_country = { ... }
|
对符合限制条件的每个国家执行子效果,包括不存在的国家。 | 1.11 |
| every_country | 始终可用 | 国家 | every_country = { … }
|
对符合限制条件的每个国家执行其中包含的效果。 | 1.0 |
| random_country | 始终可用 | 国家 | random_country = { … }
|
对符合限制条件的一个随机国家执行其中包含的效果。 | 1.0 |
| every_other_country | 仅限国家作用域内 | 国家 | every_other_country = { … }
|
对符合限制条件且与包含此效果的所在国家不同的每个国家执行其中包含的效果。 | 1.0 |
| random_other_country | 仅限国家作用域内 | 国家 | random_other_country = { … }
|
对符合限制条件且与包含此效果的所在国家不同的一个随机国家执行其中包含的效果。 | 1.0 |
| every_country_with_original_tag | 始终可用 | 国家 | every_country_with_original_tag = {
original_tag_to_check = TAG #required
… #effects to run
}
|
对符合限制条件且拥有指定原始标签的每个国家执行其中包含的效果。 | 1.9 |
| random_country_with_original_tag | 始终可用 | 国家 | random_country_with_original_tag = {
original_tag_to_check = TAG #required
… #effects to run
}
|
对符合限制条件且拥有指定原始标签的一个随机国家执行其中包含的效果。 | |
| every_neighbor_country | 仅限国家作用域内 | 国家 | every_neighbor_country = { … }
|
对符合限制条件且与包含此效果的所在国家接壤的每个国家执行其中包含的效果。 | 1.0 |
| random_neighbor_country | 仅限国家作用域内 | 国家 | random_neighbor_country = { … }
|
对符合限制条件且与包含此效果的所在国家接壤的一个随机国家执行其中包含的效果。 | 1.0 |
| every_occupied_country | 仅限国家作用域内 | 国家 | every_occupied_country = { … }
|
对符合限制条件且其核心州中有被包含此效果的所在国家控制的每个国家执行其中包含的效果。 | 1.9 |
| random_occupied_country | 仅限国家作用域内 | 国家 | random_occupied_country = { … }
|
对符合限制条件且其核心州中有被包含此效果的所在国家控制的一个随机国家执行其中包含的效果。 | 1.9 |
| every_allied_country | 仅限国家作用域内 | 国家 | every_allied_country = { … }
|
对符合 `limit` 触发器的每个同盟国家执行子效果,该国家须与当前作用域中的国家不同(若指定了 `random_select_amount`,则为该数量的随机国家)。 | 1.15 |
| random_allied_country | 仅限国家作用域内 | 国家 | random_allied_country = { … }
|
对符合 `limit` 触发器、且与当前作用域中的国家不同的一个随机同盟国家执行子效果。 | 1.15 |
| every_enemy_country | 仅限国家作用域内 | 国家 | every_enemy_country = { … }
|
对符合限制条件且与包含此效果的所在国家处于战争状态的每个国家执行其中包含的效果。 | 1.0 |
| random_enemy_country | 仅限国家作用域内 | 国家 | random_enemy_country = { … }
|
对符合限制条件且与包含此效果的所在国家处于战争状态的一个随机国家执行其中包含的效果。 | 1.0 |
| every_subject_country | 仅限国家作用域内 | 国家 | every_subject_country = { … }
|
对符合限制条件且为包含此效果的所在国家的附属国的每个国家执行其中包含的效果。 | 1.11 |
| random_subject_country | 仅限国家作用域内 | 国家 | random_subject_country = { … }
|
对符合限制条件且为包含此效果的所在国家的附属国的一个随机国家执行其中包含的效果。 | 1.11 |
| every_faction_member | 仅限国家作用域内 | 国家 | every_faction_member = { … }
|
对当前作用域国家所在阵营的每个阵营成员执行子效果;若该国没有阵营,则仅对自身生效。 | 1.17 |
| every_state | 始终可用 | 州 | every_state = { … }
|
对符合限制条件的每个州执行其中包含的效果。 | 1.0 |
| random_state | 始终可用 | 州 | random_state = {
prioritize = { 123 321 } #optional
… #effects to run
}
|
对符合限制条件的一个随机州执行其中包含的效果。 | 1.0 |
| every_neighbor_state | 仅限州作用域内 | 州 | every_neighbor_state = { … }
|
对符合限制条件且与包含此效果的所在州相邻的每个州执行其中包含的效果。 | 1.0 |
| random_neighbor_state | 仅限州作用域内 | 州 | random_neighbor_state = { … }
|
对符合限制条件且与包含此效果的所在州相邻的一个随机州执行其中包含的效果。不支持 prioritizing。 | 1.0 |
| every_owned_state | 仅限国家作用域内 | 州 | every_owned_state = { … }
|
对符合限制条件且由包含此效果的所在国家拥有的每个州执行其中包含的效果。 | 1.0 |
| random_owned_state | 仅限国家作用域内 | 州 | random_owned_state = {
prioritize = { 123 321 } #optional
… #effects to run
}
|
对符合限制条件且由包含此效果的所在国家拥有的一个随机州执行其中包含的效果。 | 1.0 |
| every_core_state | 仅限国家作用域内 | 州 | every_core_state = { … }
|
对符合限制条件且为包含此效果的所在国家核心州的每个州执行其中包含的效果。 | 1.11 |
| random_core_state | 仅限国家作用域内 | 州 | random_core_state = {
prioritize = { 123 321 } #optional
… #effects to run
}
|
对符合限制条件且为包含此效果的所在国家核心州的一个随机州执行其中包含的效果。 | 1.11 |
| every_controlled_state | 仅限国家作用域内 | 州 | every_controlled_state = { … }
|
对符合限制条件且由包含此效果的所在国家控制的每个州执行其中包含的效果。 | 1.9 |
| random_controlled_state | 仅限国家作用域内 | 州 | random_controlled_state = {
prioritize = { 123 321 } #optional
… #effects to run
}
|
对符合限制条件且由包含此效果的所在国家控制的一个随机州执行其中包含的效果。 | 1.9 |
| random_owned_controlled_state | 仅限国家作用域内 | 州 | random_owned_controlled_state = {
prioritize = { 123 321 } #optional
… #effects to run
}
|
对符合限制条件且由包含此效果的所在国家拥有并控制的一个随机州执行其中包含的效果。 | 1.3 |
| every_unit_leader | 仅限国家作用域内 | 单位指挥官 | every_unit_leader = { … }
|
对符合限制条件且由包含此效果的所在国家招募的每个单位指挥官(军长、元帅、海军上将)执行其中包含的效果。 | 1.5 |
| random_unit_leader | 仅限国家作用域内 | 单位指挥官 | random_unit_leader = { … }
|
对符合限制条件且由包含此效果的所在国家招募的一个随机单位指挥官(军长、元帅、海军上将)执行其中包含的效果。 | 1.5 |
| every_army_leader | 仅限国家作用域内 | 单位指挥官 | every_unit_leader = { … }
|
对符合限制条件且由包含此效果的所在国家招募的每个陆军将领执行其中包含的效果。 | 1.5 |
| random_army_leader | 仅限国家作用域内 | 单位指挥官 | random_army_leader = { … }
|
对符合限制条件且由包含此效果的所在国家招募的一个随机陆军将领执行其中包含的效果。 | 1.5 |
| global_every_army_leader | 始终可用 | 单位指挥官 | global_every_army_leader = { … }
|
对符合限制条件的每个陆军将领执行其中包含的效果。除非确有必要使用 global_every_army_leader,否则优先使用 every_army_leader。 | 1.5 |
| every_navy_leader | 仅限国家作用域内 | 单位指挥官 | every_navy_leader = { … }
|
对符合限制条件且由包含此效果的所在国家招募的每个海军将领执行其中包含的效果。 | 1.5 |
| random_navy_leader | 仅限国家作用域内 | 单位指挥官 | random_navy_leader = { … }
|
对符合限制条件且由包含此效果的所在国家招募的一个随机海军将领执行其中包含的效果。 | 1.5 |
| every_operative | 仅限国家作用域或行动内 | 特工 | every_operative = { … }
|
对符合限制条件且由包含此效果的所在国家招募的每个特工执行其中包含的效果。 | 1.9 |
| random_operative | 仅限国家作用域或行动内 | 特工 | random_operative = { … }
|
对符合限制条件且由包含此效果的所在国家招募的一个随机特工执行其中包含的效果。 | 1.9 |
| every_character | 仅限国家作用域内 | 角色 | every_character = { … }
|
对符合限制条件且由包含此效果的所在国家招募的每个角色执行其中包含的效果。 | 1.11 |
| random_character | 仅限国家作用域内 | 角色 | random_character = { … }
|
对符合限制条件且由包含此效果的所在国家招募的一个随机角色执行其中包含的效果。 | 1.11 |
| every_country_division | 仅限国家作用域内 | 师 | every_country_division = { … }
|
对符合限制条件且由当前国家拥有的每个师执行其中包含的效果。 | 1.12 |
| random_country_division | 仅限国家作用域内 | 师 | random_country_division = { … }
|
对符合限制条件且由当前国家拥有的一个随机师执行其中包含的效果。 | 1.12 |
| every_state_division | 仅限州作用域内 | 师 | every_state_division = { … }
|
对符合限制条件且位于当前州内的每个师执行其中包含的效果。 | 1.12 |
| random_state_division | 仅限州作用域内 | 师 | random_state_division = { … }
|
对符合限制条件且位于当前州内的一个随机师执行其中包含的效果。 | 1.12 |
| every_military_industrial_organization | 仅限国家作用域内 | 军工组织 | every_military_industrial_organization = { … }
|
对当前国家内符合限制条件的每个军工组织执行其中包含的效果。 | 1.13 |
| random_military_industrial_organization | 仅限国家作用域内 | 军工组织 | random_military_industrial_organization = { … }
|
对当前国家内符合限制条件的一个随机军工组织执行其中包含的效果。 | 1.13 |
| every_purchase_contract | 仅限国家作用域内 | 采购合同 | every_purchase_contract = { … }
|
对当前国家内符合限制条件的每份采购合同执行其中包含的效果。 | 1.13 |
| random_purchase_contract | 仅限国家作用域内 | 采购合同 | random_purchase_contract = { … }
|
对当前国家内符合限制条件的一份随机采购合同执行其中包含的效果。 | 1.13 |
| every_scientist | 仅限国家作用域内 | 角色 | every_scientist = { … }
|
对当前作用域国家中符合 "limit" 触发器的每个科学家执行子效果(若指定了 "random_select_amount",则为该数量的随机角色)。 | 1.15 |
| random_scientist | 仅限国家作用域内 | 角色 | random_scientist = { … }
|
对符合 "limit" 触发器的随机科学家执行子效果。 | 1.15 |
| every_active_scientist | 仅限国家作用域内 | 角色 | every_active_scientist = { … }
|
对当前作用域国家中符合 "limit" 触发器.title 的每个在职科学家执行子效果(若指定了 "random_select_amount",则为该数量的随机角色)。 | 1.15 |
| random_active_scientist | 仅限国家作用域内 | 角色 | random_active_scientist = { … }
|
对符合 "limit" 触发器的随机科学家执行子效果。 | 1.15 |
| party_leader | 仅限国家作用域内 | 角色 | party_leader = {
limit = {
has_ideology = liberalism
}
set_nationality = BHR
}
|
对具有指定意识形态类型的政党领袖执行效果。limit 中必须包含 has_ideology,且其指向具体的意识形态类型(例如 Despotic),而非包含该类型的组(例如 Non-Aligned)。所选角色必须是对应该意识形态组的政党领袖。 |
1.11 |
| every_collection_element | 始终可用 | 集合/任意 | every_collection_element = {
input = {
input = collection_id # This can be a collection name or an inline definition of a collection
limit = {
# Trigger - limit effect execution to a subset of elements
}
}
# Effects to be executed
}
|
对集合的所有元素施加任意效果。要了解更多关于集合的信息,请参见 /Hearts of Iron IV/common/collections 中的文档。 | 1.17 |
注意: 其中一些作用域可能没有符合条件的国家/州。
会改变作用域的效果
会改变作用域的效果包括以下几种:
- start_civil_war,它将作用域改为叛乱中的动态国家。
- create_dynamic_country,它将作用域改为新创建的动态国家。
双重作用域
以下作用域既可用作效果作用域,也可用作触发器作用域;有些还可作为某些效果和触发器的右侧目标使用。若可作为目标使用,会在表中标注。
部分双重作用域的作用域会随使用位置而变化,例如变量可被设为任何内容。
| 名称 | 用法 | 目标类型 | 示例 | 描述 | 可作为目标使用 | 加入版本 |
|---|---|---|---|---|---|---|
| TAG | 始终可用 | 国家作用域 | SOV = { country_event = my_event.1 }
|
由标签或标签别名定义的国家。标签别名定义在 /Hearts of Iron IV/common/country_tag_aliases 中,用于在国家的实际标签之外指代特定国家(例如内战中的一方)。若使用确切标签的国家不存在,但存在源自该指定标签的动态国家,则作用域将指向该动态国家。 | ✓ | 1.0 |
| <state_id> | 始终可用 | 州作用域 | 123 = { transfer_state_to = SCO }
|
由此id定义的州。 | ✓ | 1.0 |
| <character> | 不在角色作用域内 | 角色作用域 | ENG_theodore_makhno = { set_nationality = UKR }
|
在1.12.8之前的游戏版本中,该角色必须已被此作用域所属国家招募。 | ✓ | 1.11 |
| mio:<MIO> | 仅限国家作用域内 | 军工组织作用域 | mio:AST_cockatoo_doe_organization = { … }
|
由该ID标识的军工组织,定义于 /Hearts of Iron IV/common/military_industrial_organization/organizations/*.txt 文件中。 | ✓ | 1.13 |
| sp:<special_project> | 仅限国家作用域内 | 特殊项目作用域 | sp:sp_land_flamethrower_tank = { … }
|
由该ID标识的特殊项目,定义于 /Hearts of Iron IV/common/special_projects/projects/*.txt 文件中。 | ✓ | 1.15 |
| ROOT | 始终可用 | 取决于用法 | ENG = {
FRA = {
GER = {
declare_war_on = {
target = ROOT
type = annex_everything
}
}
}
} #GER declares war on ENG (if there is no scope before ENG)
|
指向所在块的根节点,这是每个块固有的属性。最常见的情况是,它就是默认作用域:例如 ROOT 在国策内 始终指向执行该焦点的国家,ROOT 在事件内 始终指向收到该事件的国家。不过,某些块会区分默认作用域与 ROOT,例如 某些脚本化GUI上下文 或 某些 on actions。若某个块没有定义 ROOT(例如 on actions 中的 on_startup),则无法使用它。 | ✓ | 1.0 |
| THIS | 始终可用 | 取决于用法 | set_temp_variable = { target_country = THIS }
|
以使用它的当前位置为目标作用域。例如,在 every_state 中使用时,它将指代当前正在求值的州。主要用于变量(如示例中所示,省略它将无法工作)或用于 内置本地化指令,此时必须指定某个作用域。更少见地,在使用 PREV 时,这可能有助于作用域操作。由于省略它不会改变代码的解释方式,因此在这些情况之外几乎没有用处。 | ✓ | 1.0 |
| PREV | 始终可用 | 取决于用法 | FRA = {
random_country = {
GER = {
declare_war_on = {
target = PREV
type = annex_everything
}
}
}
} #Germany declares war on random_country
|
以当前作用域所隶属的作用域为目标。在假定默认作用域与 ROOT 不同的情况下可以有更多用途,例如在州事件或某些 on_action 中。可以无限链接为 PREV.PREV。通常会导致提示框显示异常:向玩家显示的内容并不总是与现实相符。 另见:PREV 用法。 |
✓ | 1.0 |
| FROM | 始终可用 | 取决于用法 | declare_war_on = {
target = FROM
type = annex_everything
}
FROM = {
load_oob = defend_ourselves
}
|
可以无限链接为 FROM.FROM。用于指向块固有的各种硬编码作用域,通常是在 ROOT 之外的一个次级作用域。例如: 在 事件 中,这指代发送该事件的国家(即若该事件是 使用效果 触发的,则它是当时触发所在的 ROOT 作用域)。在 有目标决议 或外交脚本触发器中,这指代被作为目标的作用域。 |
✓ | 1.0 |
| 宗主国 | 仅限国家作用域内 | 国家作用域 | 宗主国={…}
|
如果该国是附庸国,则为其宗主国。会触发「invalid event target」错误。 | X | 1.3 |
| faction_leader | 仅限国家作用域内 | 国家作用域 | faction_leader = { add_to_faction = FROM }
|
该国所属阵营的阵营领袖。会触发「invalid event target」错误。 | X | 1.10.1 |
| owner | 仅限州、角色或参战方作用域内 | 国家作用域 | owner = { add_ideas = owns_this_state }
|
在州作用域中,指拥有该州的国家。在参战方作用域中,指拥有这些师的国家。在角色作用域中,指已招募该角色的国家。用于州时为会触发「invalid event target」错误。 | X | 1.0 |
| controller | 仅限州作用域内 | 国家作用域 | controller = {
ROOT = {
create_wargoal = {
target = PREV
type = take_state_focus
generator = { 123 }
}
}
}
|
当前州的控制者。会触发「invalid event target」错误。 | X | 1.0 |
| capital_scope | 仅限国家作用域内 | 州作用域 | capital_scope = { … }
|
当前国家首都所在的州。少数情况下为会触发「invalid event target」错误。 | X | 1.0 |
| event_target:<event_target_key> | 始终可用 | 取决于用法 | event_target:my_event_target = { … }
|
已保存的事件目标或全局事件目标,冒号后不加空格。会触发「invalid event target」错误。 | ✓ | 1.0 |
| var:<variable> | 始终可用 | 取决于用法 | var:my_variable = { … } add_to_faction = my_variable 或 add_to_faction = var:my_variable |
把变量设置为某个作用域。 当用作目标而非作用域时,在大多数情况下可以省略 |
✓ | 1.5 |
任意作用域
可以在 国家、州 或 角色 作用域中使用。
通用
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_dynamic_modifier | modifier = <modifier_string> 修正的名称。scope = <country> 若指定,动态修正将被限定到该作用域。可选。days = x 经过 x 天后,这些修正将被移除。可选。 |
add_dynamic_modifier = {
modifier = example_dynamic_modifier
scope = GER
days = 14
}
|
向指定作用域添加一个动态修正(默认作用域为 ROOT)。它每天更新一次,除非通过 force_update_dynamic_modifier 效果强制提前更新。 | 示例可在/Hearts of Iron IV/common/dynamic_modifiers/*.txt中找到。动态修正中任何使用变量的修正项都不会显示在此效果的工具提示中,而设为静态值的修正项则会显示。支持州、国家、角色和特殊项目作用域。 | 1.6 |
| remove_dynamic_modifier | modifier = <modifier_string> 修正的名称。 |
remove_dynamic_modifier = { modifier = sabotaged_ressources }
|
从当前作用域移除一个动态修正 | 示例可在/Hearts of Iron IV/common/dynamic_modifiers/*.txt中找到 | 1.6 |
| force_update_dynamic_modifier | <bool> 布尔值。 |
force_update_dynamic_modifier = yes |
强制更新动态修正中由变量给出的效果。 | 默认每天更新一次;当应用的值需要紧急变更时可以使用,例如之后在效果块中检查或使用这些修正时。 | 1.6 |
| add_state_resistance_compliance_modifier | modifier = <resistance_compliance_modifier>要应用的修正。州=<州>受影响的州。 |
add_state_resistance_compliance_modifier = {
modifier = dynamic_modifier_name
state = 738
}
|
向某个州添加抵抗度或顺从度修正。只能使用/Hearts of Iron IV/common/resistance_modifiers.txt/compliance_modifiers.txt中标记为is_dynamic = yes的修正项 |
1.17 | |
| remove_state_resistance_compliance_modifier | modifier = <resistance_compliance_modifier>要移除的修正。州=<州>受影响的州。 |
remove_state_resistance_compliance_modifier = {
modifier = dynamic_modifier_name
state = 738
}
|
从某个州移除抵抗度或顺从度修正。只能使用/Hearts of Iron IV/common/resistance_modifiers.txt/compliance_modifiers.txt中标记为is_dynamic = yes的修正项 |
1.17 | |
| set_global_flag | <flag> 用于标识该全局标记的唯一字符串。OR |
set_global_flag = my_flag set_global_flag = {
flag = my_flag
days = 123
value = 1
}
|
定义一个全局旗标。 | 不显示工具提示。此效果中的 flag 是「布尔旗标」的含义,用于存储信息。 | 1.0 |
| play_song | <来自 .asset 的歌曲标题> 位于 music 文件夹和 .asset 中的音乐文件 |
play_song = "general_peace_1" |
播放一段音轨 | 该歌曲必须在某个音乐电台中定义才能生效。更多信息可在 Music模组制作 页面中找到。若你只想播放一个音效,则应改用 sound_effect 效果。 若执行该效果,该歌曲将开始为每个国家播放。若只应让一个国家拥有该歌曲,请参见 scoped_play_song。 |
1.9.3 |
| clr_global_flag | <flag> 要清除的全局旗标的唯一字符串。 |
clr_global_flag = my_flag |
清除已定义的全局旗标。 | 不显示工具提示 | 1.0 |
| modify_global_flag | flag = <flag> 要修改的标记。
|
modify_global_flag = {
flag = my_flag
value = 3
}
|
为旗标增加一个整数值。 | 该旗标必须已被设置。 | 1.3 |
| custom_effect_tooltip | <string> 要在工具提示中显示的本地化字符串。 |
custom_effect_tooltip = my_tooltip_tt custom_effect_tooltip = {
localization_key = my_loc
NESTEDLOC = myotherloc/string
}
|
在效果工具提示中显示一个本地化键。 | 也支持本地化#可绑定本地化。 | 1.0 |
| custom_override_tooltip | tooltip = <string> 用于在提示框中显示的本地化字符串。
|
custom_override_tooltip= {
tooltip = my_tt
not_tooltip = my_tt_NOT
<effects>
}
|
执行所提供的效果,但使用自定义工具提示,抑制此块内所有其他效果的工具提示。 | 也可用作触发器。
也支持本地化#可绑定本地化。 |
1.15 |
| effect_tooltip | <string> |
effect_tooltip = {
declare_war_on = {
target = FRA
}
}
|
在工具提示中显示这些效果,但不执行它们。 | ||
| log | <string> 要写入 game.log 的字符串 |
log = "myVariable: [?myVariable]" |
执行时在用户目录的/Hearts of Iron IV/logs/game.log文件中显示字符串;若执行该记录效果时控制台处于打开状态,也会显示在控制台中。 | 接受所有本地化指令(例如 [Root.GetName]、[GetDateText] 等) |
1.5 |
| save_event_target_as | <string> 用于标识该事件目标的唯一字符串。 |
capital_scope = {
save_event_target_as = my_state
}
|
将当前作用域保存为一个键。执行结束时(即事件结束时)被清除。 | 使用 event_target:<key> 访问该作用域。不要在脚本化 GUI 中使用。 | 1.0 |
| save_global_event_target_as | <string> 用于标识该全局事件目标的唯一字符串。 |
random_other_country = {
save_global_event_target_as = my_country
}
|
将当前作用域保存为一个键。执行后持续存在,直到通过效果清除。 | 使用 event_target:<key> 访问该作用域。不要在脚本化 GUI 中使用。 | 1.0 |
| clear_global_event_target | <string> 要清除的全局事件目标的唯一字符串。 |
clear_global_event_target = my_country |
清除指定的全局事件目标。 | 1.0 | |
| clear_global_event_targets | yes 布尔值。 |
clear_global_event_targets = yes |
清除所有全局事件目标。 | 1.0 | |
| sound_effect | <string> 来自 .asset 文件的音效引用。 |
sound_effect = "boom" |
播放指定的音效一次。 | 音效必须在 /Hearts of Iron IV/sound/ 中正确设置。另见:Sound模组制作。 若执行该效果,该音效将为每个国家播放。若只应让一个国家听到,请参见 scoped_sound_effect。 |
1.0 |
| randomize_weather | <int> 一个种子整数。 |
randomize_weather = 12345 |
使用指定的种子随机化天气。 | 1.0 | |
| set_province_name | id = <id> 要更改的省份 id。
|
set_province_name = {
id = 325
name = LOC_KEY
}
set_province_name = { id = 325 name = "New Name" }
|
将指定省份/胜利点的名称更改为指定名称。 | 本地化键需在/Hearts of Iron IV/localisation/*_l_<language>.yml中定义 | 1.3 |
| reset_province_name | <id> 要重置的省份 id。 |
reset_province_name = 325 |
重置指定省份的名称。 | 1.3 | |
| damage_units | province = <id> 要对其单位造成伤害的省份。
|
damage_units = {
province = 42
state = 5
region = 5
limit = { has_country_flag = TAG_test }
damage = 0.5
org_damage = 0.5
str_damage = 0.5
ratio = yes
template = "template_name"
army = no
navy = yes
}
|
对指定区域内的单位造成伤害。 | 1.11 | |
| create_entity | entity = <gfx_entry> 要生成的实体,在 /Hearts of Iron IV/gfx/entities/*.asset 文件中定义。
|
create_entity = {
entity = entity_name
id = 123
var = var_name
x = 42
y = 21
z = 3
province = 123
state = 42
rotation = 1.2
scale = 10.0
min_zoom = 100.0
visible = scripted_trigger_name
}
|
创建一个实体。 | 使用地图所使用的同一坐标系。 旋转角度的正变化会导致逆时针旋转,完整的 360 度旋转约为 6.28 弧度。作为对比,默认最小缩放级别(最接近地图)为 50 单位,而默认最大缩放级别为 3000 单位。 | 1.11 |
| destroy_entity | <id> 要销毁的实体的 ID。 |
destroy_entity = 123 |
删除一个实体 | ID 由create_entity 效果设置。 | 1.11 |
| set_entity_movement | id = <ID> 要修改的实体的 ID。
|
set_entity_movement = {
id = 123
start = {
x = 42
y = 21
z = 3
}
target = {
province = 124
}
ratio = 0.5
rotation = 1.2
}
|
使用两个坐标设置实体的位置和旋转角度。 | ID 由create_entity 效果设置。使用地图所使用的同一坐标系。 旋转角度的正变化会导致逆时针旋转,完整的 360 度旋转约为 6.28 弧度。 | 1.11 |
| set_entity_position | id = <id>x = <int>y = <int>z = <int>province = <int>state = <int>
|
set_entity_position = {
id = 123
x = 42
y = 21
z = 3
province = 123
state = 42
}
|
设置现有实体的位置 | ID 由create_entity 效果设置。使用地图所使用的同一坐标系。 | 1.11 |
| set_entity_rotation | id = <ID> 要修改的实体的 ID。
|
set_entity_rotation = {
id = 123
rotation = 0.23
}
|
设置现有实体的当前朝向角度。 | ID 由create_entity 效果设置。正变化会导致逆时针旋转,完整的 360 度旋转约为 6.28 弧度。 | 1.11 |
| set_entity_scale | id = <ID> 要修改的实体的 ID。
|
set_entity_scale = {
id = 123
scale = 5.0
}
|
设置现有实体的尺寸。 | ID 由create_entity 效果设置。 | 1.11 |
| set_entity_animation | id = <int> 要修改的实体的 ID。
|
set_entity_animation = {
id = 123
animation = "shoot_lasers"
}
|
设置指定实体的动画。 | ID 由create_entity 效果设置。动画在/Hearts of Iron IV/gfx/models/**/*.asset文件中定义。 | 1.11 |
| build_railway | level = <int> 默认为 1
|
build_railway = {
level = 1
build_only_on_allied = yes
controller_priority = {
base = 1
modifier = {
tag = MAN
add = 2
}
}
fallback = yes
path = { 42 10 20 30 40 84 }
start_province = 42
target_province = 84
}
build_railway = {
level = 1
build_only_on_allied = yes
controller_priority = {
base = 1
modifier = {
tag = MAN
add = 2
}
}
fallback = yes
path = { 50 10 20 30 40 100 }
start_state = 50
target_state = 100
}
|
在两个省份之间或沿预定义路径增加一级铁路。 | 1.11 | |
| event_option_tooltip | <option> 选项的名称。 |
event_option_tooltip = mtg_usa_civil_war_fascists.1.a |
显示将鼠标悬停在指定名称的事件选项上时通常会看到的工具提示。 | ROOT 与 FROM 作用域互换。 | 1.13 |
| create_purchase_contract | seller = <country> 合同中的卖方。
|
create_purchase_contract = {
seller = ROOT
buyer = FROM
civilian_factories = 2
equipment = {
type = artillery_equipment
amount = 300
}
}
|
创建带有指定参数的采购合同。 | 允许多次使用equipment = { ... }。 |
1.13 |
边境战争
这些效果指的是模拟两国边境作战的边境战争,发生战斗的省份会以白色高亮显示。关于以州上的橙色条纹表示的、基于州的边境战争,请参见州作用域中的set_border_war。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| start_border_war | change_state_after_war = <bool> 该州在战后是否易手。攻击方或防御方作用域 |
start_border_war = {
change_state_after_war = no
attacker = {
state = 527
num_provinces = 4
on_win = japan_border_conflict.2
on_lose = japan_border_conflict.3
on_cancel = japan_border_conflict.4
modifier = 0.1
dig_in_factor = 0
terrain_factor = 0
}
defender = {
state = 408
num_provinces = 4
on_win = japan_border_conflict.3
on_lose = japan_border_conflict.2
on_cancel = japan_border_conflict.4
}
}
|
为指定的攻击方和防御方开启一场边境战争。参战国家为指定州的拥有者。 | 1.5 | |
| set_border_war_data | attacker = <id> / <variable> 进攻方州。
|
set_border_war_data = {
attacker = 527
defender = 408
defender_modifier = 0.15
combat_width = 100
}
|
设置进行中的边境战争中攻击方和防御方的加成或惩罚。在start_border_war之后使用。 | 1.5 | |
| cancel_border_war | attacker = <id> / <variable> 进攻方州。
|
cancel_border_war = {
dont_fire_events = yes
defender = 408
attacker = 527
}
|
在没有获胜者的情况下取消进行中的边境战争。 | 1.5 | |
| finalize_border_war | attacker = <id> / <variable> 进攻方州。
|
finalize_border_war = {
attacker_win = yes
attacker = 527
defender = 408
}
|
结束进行中的边境战争。 | 1.5 |
变量
以下是与变量相关的效果和触发器列表。修改变量的效果都有对应的临时变量版本,只是用temp_variable代替variable,且这些临时变量运算符同样可作为触发器使用,如上所述。每个运算符都可以用于不存在的变量,此时假定其值为 0,除非使用了空值合并运算符。
| 名称 | 参数 | 示例 | 描述 | 备注 | |
|---|---|---|---|---|---|
| set_variable | var = <variable> 要修改或创建的变量。
|
set_variable = {
var = my_variable
value = 100
tooltip = set_var_to_100_tt
}
set_temp_variable = { temp_var = ROOT.overlord }
|
将变量的值设为指定数值,若未定义则创建该变量。 | 存在使用set_variable = { <variable> = <value> }的简写版本。 | |
| set_variable_to_random | var = <variable> 要修改或创建的变量。
|
set_variable_to_random = {
var = random_num
max = 11
integer = yes
}
set_temp_variable_to_random = my_var |
将变量的值设为指定数值,若未定义则创建该变量。结果将大于或等于最小值,且严格小于最大值。 | 存在使用set_variable_to_random = <variable>的简写版本,会将其设为 0 到 1 之间的小数。可用于触发器。 | |
| clear_variable | <variable> 要清除的变量。 |
clear_variable = my_variable |
将该值从内存中完全清除。 | 只能用于常规变量。 | |
| add_to_variable | var = <variable> 要加到其上的变量。
|
add_to_variable = {
var = my_variable
value = 100
tooltip = add_100_to_var_tt
}
add_to_temp_variable = { temp_var = num_owned_states }
|
将变量的值增加指定数值,若未定义则创建该变量。 | 存在使用add_to_variable = { <variable> = <value> }的简写版本。 | |
| subtract_from_variable | var = <variable> 要从中减去的变量。
|
subtract_from_variable = {
var = my_variable
value = 100
tooltip = sub_100_from_var_tt
}
subtract_from_temp_variable = { temp_var = num_owned_states }
|
将变量的值减少指定数值,若未定义则创建该变量。 | 存在使用subtract_from_variable = { <variable> = <value> }的简写版本。等同于加上一个负值。 | |
| multiply_variable | var = <variable> 要相乘的变量。
|
multiply_variable = {
var = my_variable
value = 100
tooltip = multiply_var_by_100_tt
}
multiply_temp_variable = { temp_var = num_owned_states }
|
将变量的值乘以指定数值。 | 存在使用multiply_variable = { <variable> = <value> }的简写版本。 | |
| divide_variable | var = <variable> 要被除的变量。
|
divide_variable = {
var = my_variable
value = 100
tooltip = divide_var_by_100_tt
}
divide_temp_variable = { temp_var = num_owned_states }
|
将变量的值除以指定数值。 | 存在使用divide_variable = { <variable> = <value> }的简写版本。 | |
| modulo_variable | var = <variable> 要取模的变量。
|
modulo_variable = {
var = my_variable
value = 50
tooltip = get_modulo_of_var_by_50_tt
}
modulo_temp_variable = { temp_var = num_controlled_states }
|
使变量变为该变量除以指定值后欧几里得除法的余数。 | 存在使用modulo_variable = { <variable> = <value> }的简写版本。 | |
| round_variable | <variable> 要取整的变量。 |
round_variable = my_variable round_temp_variable = temp |
将变量舍入到最接近的整数值。 | 若恰好位于两个整数之间(例如 1.5),则选择绝对值更大的那个(如 -1.5 将变为 -2)。 | |
| clamp_variable | var = <variable> 要限制的变量。
|
clamp_variable = {
var = my_var
min = 0
}
clamp_temp_variable = {
var = my_var
min = 0
}
|
将变量限制在两个指定数值之间:若更小则提升到最小值,若更大则降低到最大值。 | min 或 max 可以省略,此时不会检查该项。若变量已处于 min 与 max 之间的范围内,则不做任何操作。这只会改变变量的当前值,限制后它仍可能超出最小值或最大值。 | |
| career_profile_set_temp_playthrough_variable | var = <variable> 要修改或创建的变量。
|
career_profile_set_temp_playthrough_variable = {
sum = rocket_sites_built_1936
}
|
将一个临时变量设为一个值或另一个变量。 | ??? | |
| career_profile_set_temp_variable | var = <variable> 要修改或创建的变量。
|
career_profile_set_temp_variable = {
var = num_dogs
value = num_dogs_in_career_profile
}
|
将一个临时变量设为一个值或另一个变量。 | ??? |
数组
| 名称 | 参数 | 示例 | 描述 | 备注 |
|---|---|---|---|---|
| add_to_array | array = <array> 要修改的数组。
|
add_to_array = {
array = global.my_countries
value = THIS.id
}
add_to_temp_array = { temp_states = THIS }
|
向数组添加一个元素,可指定索引位置,否则默认添加到末尾。 | 存在使用add_to_array = { <array> = <value> }的简写版本。 |
| remove_from_array | array = <array> 要修改的数组。
|
remove_from_array = {
array = global.my_countries
index = 0
}
remove_from_temp_array = { temp_states = THIS }
|
从数组中移除具有指定值或索引的元素。 | 存在使用remove_from_array = { <array> = <value> }的简写版本。若既未指定 value 也未指定 index,则删除最后一个元素。 |
| clear_array | <array> 要清空的数组。 |
clear_array = global.my_countries clear_temp_array = temp_states |
清空数组,移除其中的所有元素。 | |
| resize_array | array = <array> 要修改的数组。
|
resize_array = {
array = global.countries_by_states
value = 10
size = global.countries^num
}
resize_temp_array = { temp_states = 20 }
|
调整数组大小,必要时在末尾移除或添加元素。 | 存在使用resize_array = { <array> = <size> }的简写版本。 |
| find_highest_in_array | array = <array> 要修改的数组。
|
find_highest_in_array = {
array = global.countries_by_states
value = temp_largest_country
index = temp_country_index
}
|
找出数组中的最大值,并将其值与索引赋给一个临时变量。 | value 和 index 均为可选指定。 |
| find_lowest_in_array | array = <array> 要修改的数组。
|
find_lowest_in_array = {
array = global.countries_by_states
value = temp_largest_country
index = temp_country_index
}
|
找出数组中的最小值,并将其值与索引赋给一个临时变量。 | value 和 index 均为可选指定。 |
国家作用域
此处的效果必须在国家作用域内使用。
通用
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| set_country_flag | <flag> 用于标识该国家标记的唯一字符串。OR |
set_country_flag = my_flag set_country_flag = {
flag = my_flag
days = 123
value = 1
}
|
定义一个国家旗标。 | 不显示工具提示。此效果中的 flag 是「布尔旗标」的含义,用于存储信息。 要更改代表国家的旗帜,请参见外观标签。 | 1.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| clr_country_flag | <flag> 要清除的国家旗标的唯一字符串。 |
clr_country_flag = my_flag |
清除已定义的国家旗标。 | 1.0 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| modify_country_flag | flag = <flag> 要修改的标记。
|
modify_country_flag = {
flag = my_flag
value = 3
}
|
为旗标增加一个整数值。 | 该旗标必须已被设置。 | 1.3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| country_event | id = <event> 要触发的事件。
|
country_event = {
id = my_event.1
days = 10
random_hours = 12
random_days = 10
}
country_event = my_event.1 |
为当前国家触发指定事件。 | 在触发器无需反复检查的情况下,random 可作为比 mean_time_to_happen 更轻量的排定事件方式。若使用事件 ID 而非参数,则存在简写形式。 |
1.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| news_event | id = <event> 要触发的事件。
|
news_event = {
id = my_event.1
days = 10
random_hours = 12
random_days = 10
}
news_event = my_event.1 |
为当前国家触发指定新闻事件。 | 新闻事件使用与国家事件不同的界面。 在触发器无需反复检查的情况下, |
1.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set_cosmetic_tag | <string> 要切换到的外观标签。 |
set_cosmetic_tag = SAF_SOV_communism |
使当前作用域使用指定的外观标签,更改名称与旗帜。 | 1.3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| drop_cosmetic_tag | <bool> 布尔值。 |
drop_cosmetic_tag = yes |
使当前作用域放弃其正在使用的外观标签。 | 1.3 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set_rule | <rule> 布尔值。
|
set_rule = {
desc = TAG_my_rule_description
can_create_factions = yes
}
|
切换当前作用域的特殊游戏规则。注意:每条规则只能切换少数几次,之后需要重新载入。 |
|
1.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set_party_rule | ideology = <ideology group> 该党派的意识形态集团。
|
set_party_rule = {
ideology = democratic
desc = TAG_my_rule_description
can_create_factions = yes
}
|
切换当前作用域政党专属游戏规则。 | 1.12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| add_relation_rule_override | target = <country> 该规则的目标。
|
add_relation_rule_override = {
target = SOV
usage_desc = TAG_my_rule_description
trigger = my_scripted_trigger
can_access_market = yes
}
|
在满足触发器条件时,仅针对指定国家切换当前作用域在外交中的专属游戏规则。 | 目前支持 can_access_market 与 can_send_volunteers。若出现重叠,优先采用限制行动的一方(例如 can_send_volunteers = no 或 can_not_declare_war = yes 优先于对应的替代项)。在脚本化触发器中,ROOT 是拥有该覆盖的国家,FROM 是目标。 |
1.13 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| remove_relation_rule_override | target = <country> 该规则的目标。
|
remove_relation_rule_override = {
target = SOV
usage_desc = TAG_my_rule_description
can_access_market = yes
}
|
移除通过 add_relation_rule_override 添加的切换项。 | 1.13 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| scoped_sound_effect | <string> 来自 .asset 文件的音效引用。 |
scoped_sound_effect = "boom" |
仅对当前国家播放一次指定音效。 | 音效必须在 /Hearts of Iron IV/sound/ 中正确定义。更多信息见 Sound模组制作 条目。 | 1.6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| scoped_play_song | <来自 .asset 的歌曲标题> 位于 music 文件夹和 .asset 中的音乐文件 |
scoped_play_song = "general_peace_1" |
仅对指定国家播放一段音乐。 | 歌曲必须定义在音乐电台中才能生效。更多信息见 Music模组制作 页面。若只想播放音效,应改用 scoped_sound_effect 效果。 | 1.9.3 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| goto_province | <id> 要跳转到的省份 id。 |
goto_province = 325 |
将镜头移动到指定省份。 | 1.0 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| goto_state | <州> / <变量> 要跳转到的州 id。 |
goto_state = 1 goto_state = var:some_state |
将镜头移动到指定州。 | 1.0 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| change_tag_from | <国家> / <变量> 要变更出的国家。 |
change_tag_from = ROOT change_tag_from = var:from.country |
将玩家从目标作用域切换为当前作用域。若目标作用域由 AI 控制,则不会发生任何变化。 | 玩家将要扮演的国家必须是使用该指令的作用域。 例如,ABC = { change_tag_from = XYZ } 会让控制 XYZ 的玩家改为扮演 ABC。 |
1.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| reserve_dynamic_country | <bool>
|
reserve_dynamic_country = yes |
保留动态国家,确保即使它不存在也不会被内战回收复用。 | 通常与 create_dynamic_country 配合使用。 | 1.9 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| force_update_map_mode | limit = { ... } 地图模式刷新所需的触发器。可选。
|
force_update_map_mode = {
limit = {
is_ai = no
}
mapmode = my_map_mode
}
|
为玩家强制刷新指定地图模式,而不必等待每日更新。 | 地图模式定义于 /Hearts of Iron IV/common/map_modes/*.txt | 1.11 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| add_ai_strategy | type = <type> 该策略的类型。
|
add_ai_strategy = {
type = alliance
id = GER
value = 200
}
|
为当前作用域设置 AI 策略。 | 更多详情见 AI 模组制作。 | 1.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| create_dynamic_country | original_tag = <tag> 该国家要使用的原始 tag。
|
create_dynamic_country = {
original_tag = POL
copy_tag = SOV
add_political_power = 100
transfer_state = 123
}
|
创建一个新的动态国家,类似内战中使用的那些。 | 若动态国家尚不存在,可以使用 reserve_dynamic_country 效果来确保它不会被其他动态国家的创建所覆盖。若不这样做,且在同一作用域内没有移交任何州,该动态国家将立即停止存在。 原属国的每个州都会立即被设为某个动态国家的核心:若不需要这样,则需要在创建后移除这些核心。 |
1.9 |
州
这些效果特别是与州相关的、以国家为作用域的效果,而非州作用域内的效果。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_state_core | <州> / <变量> 要添加核心的州。 |
add_state_core = 345 |
为指定州添加当前作用域的核心。 | 1.0 | |
| remove_state_core | <州> / <变量> 要移除核心的州。 |
remove_state_core = 345 |
从指定州移除当前作用域的核心。 | 1.0 | |
| set_capital | state = <state> / <variable> 要设为首都的州。
|
set_capital = {state = 345}
set_capital = {
state = 345
remember_old_capital = no
}
|
将指定州设为当前作用域的首都州。 | 语法已在 1.11 中更改。 它原本是 "set_capital = 345"。若未另行指定,原首都会被记住。 |
1.0 |
| add_state_claim | <州> / <变量> 要添加宣称的州。 |
add_state_claim = 345 |
为当前作用域添加对指定州的宣称。 | 1.0 | |
| remove_state_claim | <州> / <变量> 要移除宣称的州。 |
remove_state_claim = 345 |
移除当前作用域对指定州的宣称。 | 1.0 | |
| set_state_owner | <州> / <变量> 要变更所有权的州。 |
set_state_owner = 345 |
使当前作用域成为指定州的所有者。 | 这可能无法一并转移控制权,因此除非只想转移所有权而不转移控制权,建议改用 transfer_state。 | 1.0 |
| set_state_controller | <州> / <变量> 要变更控制者的州。 |
set_state_controller = 345 |
使当前作用域成为指定州的控制者。 | 1.0 | |
| add_contested_owner | <州> / <变量> 要争夺的州。 |
add_contested_owner = 42 |
为州添加争夺所有者。该效果既可在国家作用域使用,也可在州作用域使用,并接受另一方作为参数。 | 也可在州作用域使用。 | 1.15 |
| remove_contested_owner | <州> / <变量> 要停止争夺的州。 |
remove_contested_owner = 42 |
移除州的一个争夺所有者。该效果既可在国家作用域使用,也可在州作用域使用,并接受另一方作为参数。 | 也可在州作用域使用。 | 1.15 |
| transfer_state | <州> / <变量> 要变更所有者和控制者的州。 |
transfer_state = 345 |
使当前作用域成为指定州的所有者和控制者。 | transfer_state_to 存在州作用域的变体。 | 1.0 |
| set_province_controller | <id> 要变更控制者的省份。 |
set_province_controller = 2999 |
将指定省份的控制者变更为当前作用域。 | 和平会议或控制者处于和平状态时,会把该省份的控制权重置为所有者,除非控制者正与所有者交战。 | 1.0 |
魔力
此处的 Mana 指政治点数、稳定度、战争支持度以及顶栏中的其他数值。燃料则位于 资源栏 中,而运输船队可通过 add_equipment_to_stockpile 添加或移除。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_political_power | <整数> / <变量> 要添加的数量。 |
add_political_power = 100 add_political_power = var:my_var |
为当前作用域添加指定数量的政治点数。 | 1.0 | |
| set_political_power | <整数> / <变量> 要添加的数量。 |
set_political_power = 100 |
将当前作用域的政治点数设为指定数量。 | 1.0 | |
| add_stability | <整数> / <变量> 要添加的数量。 |
add_stability = 0.1 |
增加当前作用域的稳定度数值。 | 稳定度数值介于 0 与 1 之间。 | 1.5 |
| set_stability | <整数> / <变量> 要添加的数量。 |
set_stability = 0.5 |
设置当前作用域的稳定度数值。 | 稳定度数值介于 0 与 1 之间。 | 1.5 |
| add_war_support | <整数> / <变量> 要添加的数量。 |
add_war_support = 0.1 |
增加当前作用域的战争支持度数值。 | 战争支持度数值介于 0 与 1 之间。 | 1.5 |
| set_war_support | <整数> / <变量> 要设置的数量。 |
set_war_support = 0.5 |
设置当前作用域的战争支持度数值。 | 战争支持度数值介于 0 与 1 之间。 | 1.5 |
| add_command_power | <整数> / <变量> 要添加的数量。 |
add_command_power = 100 |
为当前作用域添加指定数量的指挥点数。 | 1.5 | |
| add_manpower | <整数> / <变量> 要添加的数量。 |
add_manpower = 100000 add_manpower = var:my_var |
为当前作用域添加指定数量的人力。 | 1.0 | |
| army_experience | <浮点数> / <变量> 要添加的数量。 |
army_experience = 10 |
为当前作用域添加指定数量的陆军经验。 | 1.0 | |
| navy_experience | <浮点数> / <变量> 要添加的数量。 |
navy_experience = 10 |
为当前作用域添加指定数量的海军经验。 | 1.0 | |
| air_experience | <浮点数> / <变量> 要添加的数量。 |
air_experience = 10 |
为当前作用域添加指定数量的空军经验。 | 1.0 |
政治
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| set_politics | ruling_party = <ideology> 要设置的党派。
|
set_politics = {
ruling_party = democratic
elections_allowed = no
last_election = "1935.12.17"
election_frequency = 48
long_name = TAG_party_long
name = TAG_party
}
|
设置该国的政治状态,包括执政党与选举。 | 1.7 之前包含用于指派政党支持率的 parties = { ... },该功能已移至 set_popularities |
1.0(1.7 更新) |
| set_popularities | <ideology> = <int>/<variable> 要设置的支持率。 |
set_popularities = {
democratic = 50
neutrality = 15
fascism = 30
communism = 5
}
|
设置当前作用域各政党的支持率。 |
各支持率之和必须为 100,否则该指令不会生效。 |
1.7 |
| add_popularity | ideology = <ideology/tag> 要更改的党派。若使用标签,则使用该标签的执政党。
|
add_popularity = {
ideology = fascism
popularity = -0.5
}
|
调整当前作用域中指定政党的支持率。 | 使用的数值为 0 到 1。 你可以使用 ideology = ROOT 来提高当前执政党的支持率。 |
1.0 |
| set_political_party | ideology = <ideology> 要更改的党派。
|
set_political_party = {
ideology = fascism
popularity = 50
}
|
设置当前作用域中指定政党的支持率。 | 1.0 | |
| set_party_name | ideology = <ideology> 要更改的党派。
|
set_party_name = {
ideology = neutrality
long_name = GER_neutrality_party_kaiserreich_long
name = GER_neutrality_party_kaiserreich
}
|
更改当前作用域中指定政党的名称。 | 名称显示在国家政治/外交视图中,全名则在悬停于该政党时显示在提示框中。 | 1.0 |
| hold_election | <国家> 要为其举行选举的国家。 |
hold_election = ROOT |
为当前作用域执行 on_new_term_election 的 on action 中的事件。 | 1.0 |
力量均势
权力平衡定义于 /Hearts of Iron IV/common/bop/*.txt 文件中。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| set_power_balance | id = <BoP ID> 要设置/修改的权力平衡。
|
set_power_balance = {
id = my_bop
left_side = my_bop_left_side
right_side = my_bop_right_side
}
|
设置新的权力平衡或编辑已有的权力平衡。 | 这是权力平衡得以显示的必要条件。对于默认状态,会直接读取权力平衡内的 initial_value、left_side 和 right_side。 |
1.12 |
| remove_power_balance | id = <BoP ID> 要修改的权力平衡。 |
remove_power_balance = {
id = my_bop
}
|
完全移除该权力平衡。 | 1.12 | |
| add_power_balance_value | id = <BoP ID> 要修改的权力平衡。
|
add_power_balance_value = {
id = my_bop
value = -0.1
tooltip_side = my_bop_side
}
|
将权力平衡推向某一侧。 | 1.12 | |
| add_power_balance_modifier | id = <BoP ID> 要修改的权力平衡。
|
add_power_balance_modifier = {
id = my_bop
modifier = my_static_modifier
}
|
应用一个权力平衡修正。 | 1.12 | |
| remove_power_balance_modifier | id = <BoP ID> 要修改的权力平衡。
|
remove_power_balance_modifier = {
id = my_bop
modifier = my_static_modifier
}
|
取消一个权力平衡修正。 | 1.12 | |
| remove_all_power_balance_modifiers | id = <BoP ID> 要修改的权力平衡。 |
remove_all_power_balance_modifiers = {
id = my_bop
}
|
取消所有权力平衡修正。 | 1.12 | |
| set_power_balance_gfx | id = <BoP ID> 要修改的权力平衡。
|
set_power_balance_gfx = {
id = my_bop
side = my_bop_side
gfx = GFX_my_bop_side_new
}
|
更改权力平衡中某一侧的外观。 | Sprite 定义于 /Hearts of Iron IV/interface/*.gfx 文件中。 | 1.12 |
外交
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| set_major | <bool> 布尔值。 |
set_major = yes |
使当前作用域成为主要国家。 | 1.0 | |
| release | <国家> 目标国家。 |
release = GER |
在当前国家拥有的州内,将指定的不存在国家释放为自由国家。 | 若该国家已存在,该效果不会产生任何作用。指定国家拥有核心的所有州都会交给它。若当前国家在转移给该获释国家的州上拥有核心,该核心将会失去。若想把附庸国变为独立国家,请使用 set_autonomy。拥有但未控制的州会转移给该获释国家,但不会由其控制。 | 1.0 |
| release_on_controlled | <国家> 目标国家。 |
release_on_controlled = GER |
在当前国家控制的州内,将指定的不存在国家释放为自由国家。 | 若该国家已存在,该效果不会产生任何作用。指定国家拥有核心的所有州都会交给它。若当前国家在转移给该获释国家的州上拥有核心,该核心将会失去。 | 1.9.1 |
| release_puppet | <国家> 目标国家。 |
release_puppet = GER |
在当前国家拥有的州内,将指定的不存在国家释放为当前作用域的傀儡国。 | 若该国家已存在,该效果不会产生任何作用。指定国家拥有核心的所有州都会交给它。若当前国家在转移给该获释国家的州上拥有核心,该核心将会失去。拥有但未控制的州会转移给该获释国家,但不会由其控制。 | 1.0 |
| release_puppet_on_controlled | <国家> 目标国家。 |
release_puppet_on_controlled = GER |
在当前国家控制的州内,将指定的不存在国家释放为当前作用域的傀儡国。 | 若该国家已存在,该效果不会产生任何作用。指定国家拥有核心的所有州都会交给它。若当前国家在转移给该获释国家的州上拥有核心,该核心将会失去。 | 1.9.1 |
| release_autonomy | target = <country> / <variable> 该附属国。
|
release_autonomy = {
target = VIN
autonomy_state = autonomy_puppet
freedom_level = 0.5
}
|
在当前国家拥有的州内,将指定的不存在国家释放为当前作用域指定自治状态的附庸国。 | 若该国家已存在,该效果不会产生任何作用。指定国家拥有核心的所有州都会交给它。若当前国家在转移给该获释国家的州上拥有核心,该核心将会失去。拥有但未控制的州会转移给该获释国家,但不会由其控制。自治状态见 /Hearts of Iron IV/common/autonomous_states/*.txt。 | 1.3 |
| give_guarantee | <国家> 目标国家。 |
give_guarantee = GER |
当前作用域保障目标国家的独立。 | 可使用 diplomatic_relation 效果将其移除。 | 1.0 |
| give_military_access | <国家> 目标国家。 |
give_military_access = GER |
当前作用域给予目标国家军事通行权。 | 可使用 diplomatic_relation 效果将其移除。 | 1.0 |
| recall_attache | <国家> 派驻有武官的目标国家。 |
recall_attache = GER |
从指定国家召回当前作用域的武官。 | 1.5 | |
| diplomatic_relation | 国家=<国家> 要更改与 ROOT 关系的目标国家。
|
diplomatic_relation = {
country = SOV
relation = guarantee
active = no
}
|
用于定义当前作用域与目标作用域国家之间的外交关系。 | 可能的关系:
|
1.0 |
| add_opinion_modifier | target = <country> 目标国家。
|
add_opinion_modifier = {
target = GER
modifier = faction_traitor
}
|
当前作用域获得指定的舆论修正 对目标作用域。也可在 /Hearts of Iron IV/common/opinion_modifiers/*.txt 中的舆论 |
舆论修正见 /Hearts of Iron IV/common/opinion_modifiers/*.txt。 | 1.0 |
| remove_opinion_modifier | target = <country> 目标国家。
|
remove_opinion_modifier = {
target = GER
modifier = faction_traitor
}
|
当前作用域失去指定的舆论修正 对目标作用域。 | 舆论修正见 /Hearts of Iron IV/common/opinion_modifiers/*.txt。 | 1.0 |
| reverse_add_opinion_modifier | target = <country> 目标国家。
|
reverse_add_opinion_modifier = {
target = GER
modifier = faction_traitor
}
|
目标作用域获得指定的舆论修正 对当前作用域。 | 舆论修正见 /Hearts of Iron IV/common/opinion_modifiers/*.txt。当你不确定当前作用域会是什么时很有用。 | 1.0 |
| add_relation_modifier | target = <country> 目标国家。
|
add_relation_modifier = {
target = SWE
modifier = HUN_dynastic_ties_license
}
|
当前作用域获得指定的关系修正 对目标作用域。 | 关系修正见 /Hearts of Iron IV/common/modifiers/*.txt 文件,用于施加带有非固定目标的 目标修正。若要改变某国的外交舆论,见 add_opinion_modifier。 | 1.4 |
| remove_relation_modifier | target = <country> 目标国家。
|
remove_relation_modifier = {
target = SWE
modifier = HUN_dynastic_ties_license
}
|
当前作用域失去对 对目标作用域 的指定关系修正。 | 关系修正见 /Hearts of Iron IV/common/modifiers/*.txt,用于施加带有非固定目标的 目标修正。若要改变某国的外交舆论,见 remove_opinion_modifier。 | 1.4 |
| add_collaboration | target = <country> 目标国家。
|
add_collaboration = {
target = TAG
value = 0.3
}
|
增加 TAG 与当前作用域国家的合作度。 | 1.9 | |
| set_collaboration | target = <country> 目标国家。
|
set_collaboration = {
target = TAG
value = 0.3
}
|
设置 TAG 与当前作用域国家的合作度。 | 1.9 | |
| recall_volunteers_from | <tag> 目标国家。 |
recall_volunteers_from = SPR |
将派往指定国家的志愿军召回当前国家。 | 1.9 | |
| set_occupation_law | <法令 ID> 由前一作用域或 default_law 颁布的新占领法令。 |
USA = {
GER = {
set_occupation_law = foreign_civilian_oversight
}
}# 更改美国对德国的占领法令。USA = {
USA = {
set_occupation_law = default_law
}
}# 把美国的默认占领法令更改为默认值。 |
设置该国的占领法令。 | PREV 将是更改占领法令所针对的国家。若 PREV 不是国家,则不发生任何改变。若 PREV 是同一国家,则更改默认占领法令。若 PREV 不同,default_law 会把该国家专属法令重置为全局默认值,否则会把默认法令重置为定义中带有 starting_law = yes 的占领法令。 |
1.12 |
| set_occupation_law_where_available | <法令 ID> 由前一作用域或 default_law 颁布的新占领法令。 |
USA = {
GER = {
set_occupation_law_where_available = foreign_civilian_oversight
}
}# 在可能的地方更改美国对德国的占领法令。USA = {
USA = {
set_occupation_law_where_available = default_law
}
}# 在可能的地方把美国的默认占领法令更改为默认值。 |
设置该国的占领法令。 | 与 set_occupation_law 相同,区别在于若该法令无法设置,则会尝试每一个更小的子集:若默认值不可行,则尝试每一个被占领国家;若该国法令无法更改,则尝试该国境内的每一个州。 | 1.12 |
| send_embargo | <tag> 目标国家。 |
send_embargo = ITA |
对目标国家实施禁运。 | 1.12 | |
| break_embargo | <tag> 目标国家。 |
break_embargo = ITA |
停止对目标国家实施禁运。 | 自 1.14.7 起,该效果忽略国家作用域,始终作用于 ROOT,因此可改用 diplomatic_relation 效果来解除其他国家的禁运。 | 1.12 |
| give_market_access | <tag> 目标国家。 |
give_market_access = ITA |
开放两国之间的市场准入。 | 1.13 |
阵营
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| create_faction | <loc_key> 阵营的名称。 |
create_faction = MY_FACTION_NAME |
为当前作用域创建一个指定名称的阵营。当前作用域及其所有附庸国自动加入该阵营。 | 已过时,请使用 create_faction_from_template。 | 1.0 |
| create_faction_from_template | <string> 阵营模板 id。OR |
create_faction_from_template = faction_template_GER_mitteleuropa_alliance create_faction_from_template = {
template = faction_template_defensive_democratic
name = AUS_alpine_federation
icon = GFX_faction_logo_generic_2
color = { 100 100 150 }
}
|
从模板创建阵营,可选择自定义名称、图标和颜色。 | 1.17 | |
| add_to_faction | <TAG> 要加入当前作用域阵营的国家 TAG。 |
add_to_faction = GER |
将该国家加入当前作用域的阵营。 | 1.0 | |
| dismantle_faction | <bool> 布尔值。 |
dismantle_faction = yes |
解散当前作用域的阵营。 | 1.0 | |
| leave_faction | <bool> 布尔值。 |
leave_faction = yes |
使当前作用域退出其所属的阵营。 | 1.5 | |
| remove_from_faction | <scope> 目标国家。 |
remove_from_faction = GER |
将指定作用域从当前作用域领导的阵营中移除。 | 1.0 | |
| set_faction_name | 将某个本地化名称设为阵营名称。 | set_faction_name = SOME_LOC_KEY |
更改阵营名称。 | 1.6 | |
| set_faction_leader | <bool>布尔值。 |
set_faction_leader = yes |
将当前国家设为阵营领袖。 | 1.0 | |
| set_faction_spymaster | <bool>布尔值。 |
set_faction_spymaster = yes |
将当前国家设为阵营特工大师。 | 1.9 | |
| set_faction_rule | <string> 阵营规则 id。 |
set_faction_rule = rule_id |
在该国所属阵营上设置一条规则。 | 1.17 | |
| set_faction_manifest | <string> 阵营宣言 id。 |
set_faction_manifest = faction_manifest_id |
更改当前国家的阵营宣言,原有宣言会被移除。 | 1.17 | |
| add_faction_goal | <string> 阵营的目标。 |
add_faction_goal = faction_goal_an_armored_fist |
为当前国家的阵营添加一个目标。 | 1.17 | |
| remove_faction_goal | <string> 阵营的目标。 |
remove_faction_goal = faction_goal_secure_the_oil_supply |
从当前国家的阵营中移除一个目标。 | 1.17 | |
| add_faction_goal_slot | category = <string> 该阵营目标的类别。
|
add_faction_goal_slot = {
category = short_term
value = 1
}
|
为阵营的特定类别添加额外的目标槽位。 | 1.17 | |
| add_faction_influence_ratio | <浮点数> / <变量> 要添加的数量。 |
add_faction_influence_ratio = 0.075 |
按给定比例(占阵营总影响力的比例)为国家增加影响力。 | 1.17 | |
| add_faction_influence_score | <整数> / <变量> 要添加的数量。 |
add_faction_influence_score = 5 |
为阵营中的该国家增加影响力。 | 1.17 | |
| add_faction_initiative | <整数> / <变量> 要添加的数量。 |
add_faction_initiative = 1 |
为当前国家所在的阵营增加阵营主动权点数。 | 1.17 | |
| add_faction_power_projection | <整数> / <变量> 要添加的数量。 |
add_faction_power_projection = 100 |
为该阵营增加实力投射。 | 1.17 | |
| set_faction_upgrade | <string> 阵营升级项 id。 |
set_faction_upgrade = token |
为指定 tag 设置一项成员升级。 | 1.17 | |
| set_faction_member_upgrade_min | upgrade = <string> 阵营升级项 id。 |
set_faction_member_upgrade_min = {
upgrade = TOKEN_TO_FACTION_MEMBER_UPGRADE
}
|
为某个阵营成员升级组设置阵营的最低要求。 | 1.17 | |
| set_faction_military_unlocked | <bool> 布尔值。 |
set_faction_military_unlocked = yes |
设置当前国家所在阵营能否对阵营科研部分做出更改。 | 1.17 | |
| set_faction_research_unlocked | <bool> 布尔值。 |
set_faction_research_unlocked = yes |
设置当前国家所在阵营能否对阵营科研部分做出更改。 | 1.17 |
自治度
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| 傀儡国 | <国家> 目标国家。OR |
puppet = GER puppet = {
target = ITA
end_wars = no
}
|
使指定国家成为当前作用域的附属国。 | 所选取的自治状态是满足以下条件的那一个:其中包含 default = yes,且 allowed = { ... } 在 /Hearts of Iron IV/commmon/autonomous_states/ 定义内得到满足,而不必是 autonomy_puppet。如果游戏找不到任何此类自治状态,将导致游戏崩溃至桌面。 |
1.0 |
| end_puppet | <国家> 目标国家。 |
end_puppet = GER |
解除目标与当前作用域之间的附属关系。 | 必须在宗主国的作用域内使用。 | 1.0 |
| add_autonomy_ratio | value = <float> 要添加的自由分数。
|
add_autonomy_ratio = {
value = 0.1
localization = AST_adopt_westminster
}
|
为当前作用域添加一个自由度分数比例修正。 | 在附属国的作用域中使用。 | 1.3 |
| add_autonomy_score | value = <float> 要添加的自由分数。
|
add_autonomy_score = {
value = 10
localization = EXAMPLE
}
|
为当前作用域添加一个确切的自由度分数修正。 | 在附属国的作用域中使用。 | 1.3 |
| set_autonomy | target = <country> / <variable> 该附属国。
|
set_autonomy = {
target = AST
autonomous_state = autonomy_free
end_wars = no
end_civil_wars = no
}
|
设置指定国家的自治等级,包括独立。 | autonomy_free 状态将释放该附属国,不过该效果必须在目标国家当前宗主国的作用域内执行 方能生效。自治状态可在 /Hearts of Iron IV/common/autonomous_states/*.txt 文件中找到。尽管 end_wars 是可选参数且默认为 no,但省略它会导致该国被占领的州归还其控制,从而使敌方单位滞留。在历史文件中设置自治等级时,最好在附属国历史文件的政治效果之前进行,并将作用域指向宗主国的 tag,以免被覆盖。 | 1.3 |
流亡政府
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_legitimacy | 为流亡政府增加合法性。 | add_legitimacy = 10 |
增加合法性。 | 1.6 | |
| set_legitimacy | 设置流亡政府的合法性。 | set_legitimacy = 10 |
设置合法性。 | 1.6 | |
| become_exiled_in | 使某国在指定国家成为流亡政府,并设定初始合法性。 | become_exiled_in = { target = <Host tag> legitimacy = <0-100>(初始合法性,可选) }
|
创建流亡政府。 | 必须从 ROOT(即应流亡的国家)触发,或必须使用 TAG 指定。该效果不会自动迫使国家投降。 | 1.6 |
| end_exile | 结束流亡政府。 | end_exile = yes |
结束流亡政府。 | 1.6 |
战争
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_threat | <int> 要改变的数量。 |
add_threat = 10 |
调整世界紧张度水平。 | 1.0 | |
| add_named_threat | threat = <int> 要更改的数值。
|
add_named_threat = {
threat = 5
name = GER_rhineland
}
|
调整世界紧张度水平,并在世界紧张度提示框中添加一条记录。 | 1.0 | |
| annex_country | target = <country> 要吞并哪个国家。
|
annex_country = {
target = GER
transfer_troops = yes
}
|
为当前作用域吞并指定国家。 | 若不转移部队,被吞并国家的师所拥有的装备将丢失。 | 1.0 |
| add_to_war | targeted_alliance = <country> 要援助的国家。
|
add_to_war = {
targeted_alliance = PREV
enemy = HUN
hostility_reason = asked_to_join
}
|
强制当前作用域加入指定盟友对抗指定敌人的战争。 | 1.0 | |
| declare_war_on | target = <country> / <variable> 要攻击的国家。
|
declare_war_on = {
target = GER
type = annex_everything
}
|
使当前作用域以指定的战争目标向指定国家宣战。 | 战争目标类型可在 /Hearts of Iron IV/common/wargoals/*.txt 中找到。另见 add_civil_war_target,以将不同国家之间的战争指定为内战。 | 1.0 |
| white_peace | <国家> / <变量> 要白色和平的作用域。OR |
white_peace = GER white_peace = {
tag = GER
message = my_peace_tt
}
|
使当前作用域与指定作用域白色和平。 | 1.0 | |
| start_peace_conference | tag = <country> / <variable> 要与其和平的作用域。
|
start_peace_conference = {
tag = GER
score_factor = 0.4
message = my_peace_tt
}
|
使当前作用域与指定作用域开启一场和平会议,双方各居一侧。 | 当前作用域为胜利方,目标及其附属国为失败方。仅在与目标处于战争状态时可用。score_factor 为 0.0 相当于白色和平。winner_scope 和 loser_scope 具有以下可能取值:
|
1.12 |
| set_truce | target = <country> 要与其停战的作用域。
|
set_truce = {
target = GER
days = 90
}
|
使当前作用域与指定作用域停战。 | 1.0 | |
| create_wargoal | target = <country> / <variable> 要作为目标的国家。
|
create_wargoal = {
type = puppet_wargoal_focus
target = ROOT
}
create_wargoal = {
type = take_state_focus
target = PREV
generator = { 123 321 }
expire = 90
}
|
授予当前作用域对指定国家的战争目标。 | 战争目标类型可在 /Hearts of Iron IV/common/wargoals/*.txt 中找到 | 1.0 |
| remove_wargoal | target = <country> / <variable> 要作为目标的国家。
|
remove_wargoal = {
type = all
target = ROOT
}
|
移除当前作用域对指定国家的战争目标。 | 战争目标类型可在 /Hearts of Iron IV/common/wargoals/*.txt 中找到 | 1.10.2 |
| start_civil_war | ideology = <ideology> 脱离出来的国家的意识形态。
|
start_civil_war = {
ruling_party = communism
# Original country's ideology changes to communism
ideology = ROOT
# Breakaway gets old ideology of ROOT
size = 0.8
capital = 282
states = {
282 533 536 555 529 530 528
}
keep_unit_leaders = {
750 751 752
}
keep_political_leader = yes
keep_political_party_members = yes
}
start_civil_war = {
ideology = democratic
size = 0.1
states = all
states_filter = {
is_on_continent = europe
is_capital = no
}
set_country_flag = TAG_my_country_tag_alias_trigger
# Sets a country flag that gets used in a country tag alias.
}
(参见国家标签别名) start_civil_war = {
ideology = neutrality
size = 0.1
army_ratio = 0.5
navy_ratio = 0
air_ratio = 1
keep_unit_leaders_trigger = {
has_trait = my_trait_name
}
keep_all_characters = yes
PREV = { # Original country
TAG_airforce_leader = { # Character
set_nationality = PREV.PREV
# Transfers to breakaway
}
}
promote_character = TAG_airforce_leader
}
|
按指定参数为当前作用域发动一场内战。 | states = all 会包含该国控制的每一个州。若该国当前的首都州被设为叛乱可能获得的州之一,则不会触发。可以事先用 set_capital 更改首都,并在内战结束后用 on_civil_war_end 将其设回默认值。分离国家将始终被禁止选举。若使用了 通过此效果发起的内战不能超过两方,且该效果不能在 历史文件 或 书签的 effect = { ... } 中使用。要添加更多方或在游戏开始前发起内战,可以通过把一场已有的战争(通常源自通过 create_dynamic_country 创建的动态国家)用 add_civil_war_target 设置为内战来模拟。 |
1.0 |
| add_civil_war_target | <国家> - 要设为目标的国家。 |
add_civil_war_target = TAG |
设置 ROOT 与 TAG 之间的战争为内战,其结果是胜利方吞并另一方,并对干预设置世界紧张度限制。 | ROOT 与 TAG 必须已处于相互交战状态,该效果才会生效。 | 1.9 |
| remove_civil_war_target | <国家> - 要设为目标的国家。 |
remove_civil_war_target = TAG |
解除这对国家之间的战争的内战状态。 | 正在进行的战争必须已被标记为内战,无论它是由 start_civil_war 发动的,还是使用 add_civil_war_target 将其标记为内战的。 | 1.12.13 |
| transfer_units_fraction | target = <country> 应从当前作用域接收这些单位的国家。
|
transfer_units_fraction= {
target = SPD
size = 0.5
stockpile_ratio = 0.8
army_ratio = 0.8
navy_ratio = 0.5
air_ratio = 0.5
keep_unit_leaders_trigger = {
has_trait = trait_SPA_nationalist_sympathies
}
}
|
将一部分军事力量转移给目标,包括部队(陆、海、空任一类型)、装备和部队领袖。 | 1.9 | |
| add_nuclear_bombs | 向 TAG 的库存中添加核弹。 | add_nuclear_bombs = 100 |
向该国的库存中添加指定数量的核弹 | 需要拥有核科技才能使用。 | 1.6 |
| launch_nuke | province = <ID> 要核击的特定省份。
|
launch_nuke = {
province = 1234
}
launch_nuke = {
state = 42
controller = GER
use_nuke = yes
nuke_type = nuclear_bomb
}
|
对指定省份或所需州内的某个省份实施核击。若设置的是州而非特定省份,则优先选择 controller 中设置的国家,其次优先选择与当前作用域交战的国家,然后选择中立国家。 |
若设置为使用核弹,则库存中至少需要一枚核弹。 | 1.6 |
资源
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_resource | type = <resource> 要添加的资源。
|
add_resource = {
type = oil
amount = 50
state = 88
}
|
向指定州添加指定数量的指定资源。 | 也可在州作用域使用。 | 1.0 |
| create_import | 资源=<资源> 要进口的资源。
|
create_import = {
resource = steel
amount = 100
exporter = GER
}
|
为当前作用域创建一项进口,使用指定资源并来自指定出口国。 | 1.0 | |
| give_resource_rights | receiver = <tag> 将获得资源权的国家。
|
give_resource_rights = { receiver = ENG state = 291 }
give_resource_rights = {
receiver = POL
state = 321
resources = { oil }
}
|
将某个州的所有资源给予目标国家 | 只要当前国家控制着拥有资源开采权的州,资源开采权就会持续提供。 | 1.6 |
| remove_resource_rights | <州> 要移除当前国家资源开采权的州。 |
ENG = { remove_resource_rights = 477 }
|
移除给定的资源开采权 | 1.6 | |
| add_fuel | <int> 燃料数量 |
add_fuel = 400 |
为当前国家增加燃料。 | 1.6 | |
| set_fuel | <int> 燃料数量。 |
set_fuel = 400 |
设置该国当前的燃料数量。 | 1.6 | |
| set_fuel_ratio | <decimal> 所需的燃料比例。 |
set_fuel_ratio = 0.5 |
设置该国当前燃料占其容量的比例。 | 1.6 |
建筑
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_offsite_building | type = <building> 要添加的建筑。
|
add_offsite_building = { type = arms_factory level = 1 }
|
为当前作用域添加一座地图外(offmap)建筑,其效果无需存在于某个州中即可产生。 | 1.5 | |
| modify_building_resources | building = <building> 要修改的建筑。
|
modify_building_resources = {
building = synthetic_refinery
resource = oil
amount = 1
}
|
修改指定建筑为当前作用域提供的资源产出。 | 1.5 | |
| damage_building | type = <building> 要损坏的建筑。
|
damage_building = {
type = infrastructure
state = 123
damage = 1
}
damage_building = {
tags = dam_building
damage = 1
repair_speed_modifier = -0.8
province = 3488
}
|
破坏目标州或省份中的一座建筑。 | 建筑的生命值由建筑定义中的 value 属性决定。它乘以建筑等级即得到总生命值。 | 1.3 |
国策
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| load_focus_tree | <国策树> 要加载的国策树。OR |
load_focus_tree = china_communist_focus load_focus_tree = {
tree = british_focus
keep_completed = yes
copy_completed_from = ENG
}
|
为当前作用域加载新的国策树,若设置则保留所有共有的焦点。 | 新加载的国策树中不存在的焦点将不会保持为已完成状态,无论是对于 has_completed_focus 检查,还是在重新加载旧国策树时。 | 1.5 |
| unlock_national_focus | <focus> 要解锁的焦点。 |
unlock_national_focus = my_focus |
为当前作用域跳过指定焦点(标记为已完成,但不触发该焦点的 complete_effect)。 |
1.0 | |
| complete_national_focus | <focus> 要完成的焦点。OR |
complete_national_focus = my_focus complete_national_focus = {
focus = GER_autonomous_organization_todt
use_side_message = yes
originator_name = GER_fritz_todt
}
|
为当前作用域完成指定焦点。 | 在 1.15 中加入了 block 版本,'originator_name' 可以是 TAG、人物、州或任何其他本地化键。 | 1.0 |
| uncomplete_national_focus | focus = <focus> uncomplete_children = <bool> 默认为 "no"。可选。refund_political_power = <bool> 默认为 "no"。可选。 |
uncomplete_national_focus = {
focus = GER_oppose_hitler
uncomplete_children = yes
refund_political_power = no
}
|
从已完成焦点列表中移除一个焦点,并可能移除所有以它为前置条件的焦点。若该焦点拥有 'on_uncomplete' 效果,则会在每个被取消完成的焦点上执行该效果。 | 1.11 | |
| mark_focus_tree_layout_dirty | <bool> 布尔值。 |
mark_focus_tree_layout_dirty = yes |
刷新指定国家的国策树,重新开始 allow_branch 中的检查以及焦点的位置偏移。 |
若放在焦点的完成奖励中,该焦点在效果执行时不会被标记为已完成,导致指定该焦点的 has_completed_focus 检查被标记为 false。可以通过在焦点内立即触发的隐藏事件中放入一个效果,或在把 |
1.9 |
| activate_shine_on_focus | <focus> 要激活闪光效果的焦点。 |
activate_shine_on_focus = my_focus
|
在具有给定 id 的焦点上激活闪光效果。已完成的焦点无法拥有已激活的闪光效果。 | 提示框仅在调试模式中显示。 可用于模拟同时推进多个焦点。 |
1.15 |
| deactivate_shine_on_focus | <focus> 要取消闪光效果的焦点。 |
deactivate_shine_on_focus = my_focus
|
在具有给定 id 的焦点上取消闪光效果。当前正在研究的焦点无法移除其闪光效果。 | 提示框仅在调试模式下显示。 | 1.15 |
| reduce_focus_completion_cost | focus = <focus> 要减少成本时间的焦点。
|
reduce_focus_completion_cost = {
focus = focus_id
cost = 35
}
reduce_focus_completion_cost = {
focus = {focus_id_1 focus_id_2}
cost = 35
}
|
减少完成特定焦点所需的成本。该成本接受脚本常量。焦点可以是统一列表或单个 token。 | 1.17 |
决议
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| activate_decision |
|
activate_decision = my_decision |
为当前作用域激活指定决议,忽略该决议的触发条件。 | 决议可在 /Hearts of Iron IV/common/decisions/*.txt 中找到 | 1.0 |
| activate_targeted_decision | target = <country> 要作为目标的国家。
|
activate_targeted_decision = {
target = GER
decision = my_decision
}
|
为当前作用域对指定目标激活指定的目标决议。 | 决议可在 /Hearts of Iron IV/common/decisions/*.txt 中找到仅对任务有效;以此方式作为目标的普通决议会变为可见,但不会激活。 | 1.5 |
| remove_targeted_decision | <decision> 要移除的决议。 |
remove_targeted_decision = {
target = FROM
decision = my_decision
}
|
为当前作用域移除指定的目标决议。 | 决议可在 /Hearts of Iron IV/common/decisions/*.txt 中找到 | 1.5 |
| unlock_decision_tooltip | <decision> 要显示的决议。
显示决议效果(默认为 no)
显示决议修正。(默认为 no) |
unlock_decision_tooltip = my_decision unlock_decision_tooltip = {
decision = my_decision
show_effect_tooltip = yes
show_modifiers = yes
}
|
在效果提示框中为指定决议显示特殊提示框。 | 决议可在 /Hearts of Iron IV/common/decisions/*.txt 中找到 | 1.5 |
| unlock_decision_category_tooltip | <category> 要显示的决议类别。 |
unlock_decision_category_tooltip = my_category |
在效果提示框中为指定决议类别显示特殊提示框。 | 决议类别可在 /Hearts of Iron IV/common/decisions/catergories/*.txt 中找到 | 1.5 |
| add_days_remove | decision = <decision> 要为其添加天数的决议。
|
add_days_remove = {
decision = decision_here
days = 30
}
|
为决议的 days_remove 所创建的计时器增加天数。不适用于变量。 | 决议可在 /Hearts of Iron IV/common/decisions/*.txt 中找到 | 1.9 |
| remove_decision | 允许在不运行 remove_effect 的情况下移除指定决议。 | remove_decision = GER_MEPO |
移除一个决议。 | 1.6 | |
| remove_decision_on_cooldown | <decision> 要移除的决议。 |
remove_decision_on_cooldown = TAG_my_decision |
若该决议处于冷却中,则将其移除,以便重新激活或彻底移除。 | 1.11 |
任务
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| activate_mission | <mission> 要激活的任务。 |
activate_mission = my_mission |
为当前作用域激活指定任务,忽略该决议的任何触发条件。 | 任务可在 /Hearts of Iron IV/common/decisions/*.txt 中找到 | 1.5 |
| activate_mission_tooltip | <mission> 要显示的任务。 |
activate_mission_tooltip = my_mission |
在效果提示框中为指定任务显示特殊提示框。 | 任务可在 /Hearts of Iron IV/common/decisions/*.txt 中找到 | 1.5 |
| remove_mission | <mission> 要移除的任务。 |
remove_mission = my_mission |
为当前作用域移除指定任务。 | 任务可在 /Hearts of Iron IV/common/decisions/*.txt 中找到 | 1.5 |
| add_days_mission_timeout | mission = <mission> 要为其添加天数的任务。
|
add_days_mission_timeout = {
mission = my_mission
days = 20
}
|
为指定任务增加天数。 | 任务可在 /Hearts of Iron IV/common/decisions/*.txt 中找到 | 1.9 |
科技
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_research_slot | <int> 要添加或移除的科研槽数量。 |
add_research_slot = 1 |
调整当前作用域拥有的科研槽数量。可用负值移除科研槽。 | 1.0 | |
| set_research_slots | <int> 要设置的科研槽数量。 |
set_research_slots = 4 |
设置当前作用域拥有的科研槽数量。 | 1.0 | |
| add_tech_bonus | bonus = <float> 给予的科技加成,默认为 0。
在科研标签页中显示的提示框,可选。 |
add_tech_bonus = {
bonus = 0.5
uses = 1
category = radar_tech
}
|
按指定参数为当前作用域授予科研加成。 | 科研加成类别定义在 /Hearts of Iron IV/common/technology_tags/*.txt 文件中,而科技定义在 /Hearts of Iron IV/common/technologies/*.txt 文件中。 | 1.0 |
| set_technology | <technology> = <int> 要添加的科技。popup = no 添加科技后不显示弹出窗口 |
set_technology = {
suicide_craft = 1
}
|
为当前作用域授予指定科技。 | 值为 1 时设置该科技。值为 0 时移除该科技,但若它是可研究的科技,其研究所需时长不会被重置,意味着它可以在 1 天内研究完成。与其他科技互斥的科技无法通过此效果移除。科技在 /Hearts of Iron IV/common/technologies/*.txt 文件中定义。 要显示科技的效果,请使用 |
1.0 |
| add_to_tech_sharing_group | <string> 要将当前作用域加入的组。 |
add_to_tech_sharing_group = us_research |
将当前作用域加入指定的科技共享组。 | 科技共享组可在 Hearts of Iron IV\common\technology_sharing\*.txt 中找到 |
1.3 |
| remove_from_tech_sharing_group | <string> 要将当前作用域移出的组。 |
remove_from_tech_sharing_group = us_research |
将「当前作用域」从指定的科技共享组中移除。 | 科技共享组可在 Hearts of Iron IV\common\technology_sharing\*.txt 中找到 |
1.3 |
| modify_tech_sharing_bonus | id = <string> 要修改的组。
|
modify_tech_sharing_bonus = {
id = us_research
bonus = 0.5
}
|
修改指定的科技共享组。 | 科技共享组可在 Hearts of Iron IV\common\technology_sharing\*.txt 中找到 |
1.3 |
| inherit_technology | <tag> 要继承其科技的国家。 |
inherit_technology = CAN |
使当前国家已研究的科技从指定国家复制而来。 | 在使一个国家独立时很有用。 | 1.6 |
| mark_technology_tree_layout_dirty | <bool> 布尔值。 |
mark_technology_tree_layout_dirty = yes |
强制刷新作用域国家的隐藏科技。 | 1.15 |
理念
包括国家精神、法令、设计商和顾问。(使用 idea_token)
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_ideas | <idea> 要添加的理念。 |
add_ideas = my_idea add_ideas = {
my_idea_1
my_idea_2
}
|
将指定的理念添加到「当前作用域」。 | 可作为作用域一次添加多个。如果用于添加仅有单个槽位的类别中的理念,会替换掉任何已存在的理念。 | 1.0 |
| add_timed_idea | idea = <idea> 要添加的理念。
|
add_timed_idea = {
idea = my_idea
days = 180
}
|
将指定的理念添加到「当前作用域」,持续指定的天数。 | days、months、years 三者中必须指定一个。提示框将使用与属性中完全相同的年/月/日措辞。 |
1.0 |
| modify_timed_idea | idea = <idea> 要修改的理念。
|
modify_timed_idea = {
idea = my_idea
days = 60
}
|
按指定数值延长或缩短限时理念的持续时间。 | 正值增加时间,负值缩短时间。days、months、years 三者中必须指定一个。提示框将使用与属性中完全相同的年/月/日措辞。 |
1.0 |
| swap_ideas | add_idea = <idea> 要添加的理念。
|
swap_ideas = {
remove_idea = my_idea_1
add_idea = my_idea_2
}
|
交换两个理念,并在提示框中显示两者之间的任何修正差异。 | 若这些理念在本地化中同名,它将显示为修改该理念,而非将它们互换。 添加操作将在移除旧理念之前发生。 |
1.3 |
| remove_ideas | <idea> 要移除的理念。 |
remove_ideas = my_idea remove_ideas = {
my_idea_1
my_idea_2
}
|
从「当前作用域」移除指定的理念。 | 可作为作用域一次移除多个。 | 1.0 |
| remove_ideas_with_trait | <trait> 要作为目标的特质。 |
remove_ideas_with_trait = motorized_equipment_manufacturer |
移除「当前作用域」中所有使用指定特质的理念。 | 1.0 | |
| show_ideas_tooltip | <idea> 要显示的理念。 |
show_ideas_tooltip = my_idea |
在「当前效果作用域」的提示框中显示指定的理念。不会添加该理念。 | 1.0 |
单位
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| load_oob | <oob> 要加载的战斗序列文件名,不含 .txt 扩展名。 |
load_oob = "GER_default" |
为「当前作用域」加载指定的战斗序列,并应用其中的效果。省略 .txt 扩展名的文件名被用作该效果的目标。 |
战斗序列存储在 /Hearts of Iron IV/history/units/*.txt 中。主要用于在指定位置生成师。 | 1.0 |
| division_template | name 该师的名称。regiments = {
<unit> = { x = 0 y = 0 }
}
regimental_support = {
<unit> = { x = 0 y = 0 }
}
support = {
<unit> = { x = 0 y = 0 }
}
该师的编制。子单位在 /Hearts of Iron IV/common/units/*.txt 文件中定义。 |
division_template = {
name = "Test"
is_locked = yes
division_cap = 3
division_names_group = USA_INF_01
priority = 0
template_counter = 0
regiments = {
infantry = { x = 0 y = 0 }
infantry = { x = 0 y = 1 }
infantry = { x = 0 y = 2 }
infantry = { x = 0 y = 3 }
}
regimental_support = {
field_guns = { x = 0 y = 0 }
}
support = {
military_police = { x = 0 y = 0 }
}
}
|
创建指定的师编制并将其添加到「当前作用域」。 | x 和 y 属性代表师设计器中的行和列,从 0 开始。不显示提示框。 | 1.0 |
| create_colonial_division_template | 附属国=<国家> 某个宗主国附属国的国家标签。
|
create_colonial_division_template = {
subject = RAJ
division_template = {
name = "Infantry Division"
division_names_group = RAJ_INF_01
...
regiments = {
infantry = { x = 0 y = 0 }
infantry = { x = 0 y = 1 }
}
}
}
|
为宗主国/所有者创建殖民地师编制。 | 在宗主国的国家作用域中,例如 ROOT = ENG。 | 1.15 |
| add_units_to_division_template | template_name = <string> 要更改的模板。若在师作用域中使用则可选。regiments = {
<unit> = <column>
}
regimental_support = {
<unit> = <column>
}
support = {
<unit> = <column>
} 要添加到模板的单位。子单位在 /Hearts of Iron IV/common/units/*.txt 文件中定义。 |
add_units_to_division_template = {
template_name = "Test"
regiments = {
infantry = 2
infantry = 2
}
regimental_support = {
field_guns = 2
}
support = {
military_police = 0
}
}
|
将指定的旅添加到模板中指定列的第一个可用槽位(如果可能)。 | 列从左到右以 0 开始编号。也可在师作用域中使用。 | 1.0 |
| set_division_template_lock | division_template = <string> 该师模板的名称。
|
set_division_template_lock = {
division_template = "Infantry Division"
is_locked = yes
}
|
切换「当前作用域」某个师编制的锁定状态,锁定后无法编辑或删除。 | 1.5 | |
| country_lock_all_division_template | <bool> 布尔值。OR |
country_lock_all_division_template = yes country_lock_all_division_template = {
is_locked = yes
desc = loc_key
}
|
锁定「当前作用域」的所有师编制。 | 用于阻止训练、解散和编辑单位。 | 1.9 |
| set_division_force_allow_recruiting | division_template = <string> 要修改的模板。
|
set_division_force_allow_recruiting = {
division_template = "My locked template"
}
|
更改是否可以在不解锁模板的情况下招募锁定模板的师。 | 1.12 | |
| set_division_template_cap | division_template = <string> 该师模板的名称。
|
set_division_template_cap = {
division_template = "Swiss Citizen Militia"
division_cap = SWI_militia_division_cap
}
|
设置师编制的数量上限。该模板必须首先处于锁定状态。 | 1.12 | |
| clear_division_template_cap | division_template = <string> 师编制的名称。 |
clear_division_template_cap = {
division_template = "Swiss Citizen Militia"
}
|
清除模板的数量上限,使其可拥有无限数量的师。 | 1.12 | |
| delete_unit_template_and_units | division_template = <string> 师编制的名称。 |
delete_unit_template_and_units = { division_template = "Infantry Division" disband = yes #将返还装备和人力 }
|
删除「当前作用域」指定的师编制以及所有使用它的单位。 | 1.5 | |
| delete_unit | state = <number id> 该单位必须所在州的 id 编号。
|
delete_unit = {
state = 787
disband = yes #will refund equipment and manpower
}
delete_unit = {
division_template = "Infantry Division"
}
delete_unit = {} # Will delete all units
|
删除所有符合筛选条件的单位。 | 不会生成提示框。如果要删除某个特定模板的所有单位,可以使用 delete_units。 | 1.5 |
| delete_units | division_template = <string> 单位必须使用才能被删除的模板。
|
delete_units = {
division_template = "Infantry Division"
disband = yes
}
|
删除所有使用某个模板的单位。 | 与 delete_unit 不同,会生成提示框。必须指定 division_template。 | 1.9 |
| create_railway_gun | equipment = <type> 列车炮使用的装备类型。
|
create_railway_gun = {
equipment = railway_gun_equipment_1
name = TAG_new_railway_gun
location = 12406
}
|
创建一门列车炮。 | 1.11 | |
| teleport_railway_guns_to_deploy_province | <bool> 布尔值。 |
teleport_railway_guns_to_deploy_province = yes |
将所有列车炮传送到它们被部署的省份。 | 1.11 | |
| add_unit_bonus | <子单位> = { ... } |
add_unit_bonus = {
category_light_infantry = {
soft_attack = 0.05
}
cavalry = {
soft_attack = 0.05
hard_attack = 0.05
}
}
|
为国家添加永久的子单位与子单位类别加成。 | ??? |
装备
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| set_equipment_fraction | <浮点数> / <变量> 要移除的装备比例。 |
set_equipment_fraction = 0.5 |
按指定比例减少整体装备库存。 | 在内战中 不 应使用此效果来模拟库存分配。start_civil_war 会根据各自的规模自动分配库存。 |
1.0 |
| add_equipment_to_stockpile | type = <equipment> 要添加的装备。接受类型和原型。
|
add_equipment_to_stockpile = {
type = infantry_equipment
amount = -100
producer = GER
}
add_equipment_to_stockpile = {
type = medium_tank_chassis_1
amount = 100
variant_name = "Panzer III"
}
|
编辑「当前作用域」的装备库存,添加或移除指定类型或原型的装备。 | 使用负数时,可选地指定生产国将确保只移除该生产国生产的装备。该装备必须已由该生产国解锁,效果才会成功。 | 1.0 |
| send_equipment | type = <equipment> 要添加的装备。可以是原型。
|
send_equipment = {
equipment = infantry_equipment
amount = 100
target = GER
}
|
向指定目标发送指定数量的装备,并从「当前作用域」移除这些装备。 | 不能将装备移除至负数,在这种情况下目标将完全收不到装备。 | 1.0 |
| send_equipment_fraction | value = <0-1> 要发送多少装备。
|
send_equipment_fraction = {
value = 0.3
target = GER
}
|
向指定目标发送指定比例的装备,并从「当前作用域」移除这些装备。 | 1.9 | |
| create_production_license | target = <country> 哪个国家获得该许可。
|
create_production_license = {
target = HUN
equipment = {
type = fighter_equipment_1
version = 0
}
new_prioritised = no
cost_factor = 0
}
|
向指定国家授予从「当前作用域」生产指定装备的许可。 | 1.4 | |
| add_equipment_subsidy | cic = <int> 该补贴所需的经济产能数量。
|
add_equipment_subsidy = {
cic = 300
equipment_type = support_equipment
seller_tags = { BHR }
}
add_equipment_subsidy = {
cic = 1000
equipment_type = infantry_equipment
seller_trigger = my_scripted_trigger
}
|
在 国际市场 上创建一个装备补贴。 | seller_tags 和 seller_trigger 互斥。在脚本化触发器中,ROOT 是接受补贴的国家,FROM 是卖方。 |
1.13 |
| add_cic | <int> 要添加的经济产能数量。 |
add_cic = 300 |
修改 国际市场 上的经济产能储备。 | 如果效果生效后的总值为负数,经济产能将被限制为 0。 | 1.13 |
| create_equipment_variant | name = <string> 该变体的名称。
|
create_equipment_variant = {
name = "Vetehinen Class"
type = ship_hull_submarine_1
name_group = FIN_SS_HISTORICAL
role_icon_index = 1
modules = {
fixed_ship_torpedo_slot = ship_torpedo_sub_1
fixed_ship_engine_slot = sub_ship_engine_1
rear_1_custom_slot = ship_mine_layer_sub
}
}
create_equipment_variant = {
name = "He 112"
type = fighter_equipment_0
obsolete = yes
upgrades = {
plane_gun_upgrade = 1
plane_range_upgrade = 1
}
}
create_equipment_variant = {
name = "Light Tank Mk. IV"
type = light_tank_chassis_1
parent_version = 1
modules = {
main_armament_slot = tank_heavy_machine_gun
}
upgrades = {
tank_nsb_engine_upgrade = 2
}
icon = "GFX_ENG_basic_light_tank_medium"
model = ENG_MKIV_light_tank_entity
design_team = mio:ENG_vauxhall_organization
}
|
为「当前作用域」创建指定的装备变体。 | 舰船的角色图标在 /Hearts of Iron IV/gfx/army_icons/army_icons.txt 中定义。 升级在 /Hearts of Iron IV/common/units/equipment/upgrades/*.txt 中定义。装备类型(包括其模块槽位)在 /Hearts of Iron IV/common/units/equipment/*.txt 中定义。装备模块在 /Hearts of Iron IV/common/units/equipment/modules/*.txt 中定义。 |
1.0 |
| add_equipment_production | amount = <int> 自动停止前要生产的数量。可选。
|
add_equipment_production = {
equipment = {
type = light_cruiser_2
}
requested_factories = 1
progress = 0.95
amount = 1
}
|
为「当前作用域」启动指定装备的生产线。 | 1.0 | |
| add_design_template_bonus | name = <loc_key> 名称。
|
add_design_template_bonus = {
name = air_equipment
uses = 1
cost_factor = 0.75
equipment = small_plane_airframe
equipment = medium_plane_airframe
equipment = large_plane_airframe
}
|
为指定类型的装备添加带使用次数的免费设计折扣。 | uses 和 cost_factor 的值可以是绝对值或脚本常量。可使用多个装备类型,其中 1 个为必填。 |
1.15 |
| add_equipment_bonus | project = <> 可选,用于使用特殊项目名称的特殊项目作用域。若未设置,将使用该名称。
|
add_equipment_bonus = {
project = FROM
bonus = {
armor = { # Type of equipment
armor_value = 3
soft_attack = 3
instant = yes
}
small_plane_naval_bomber_airframe = {
air_range = 0.1
naval_strike_attack = 0.1
}
}
}
|
为国家添加指定的装备加成。描述将使用给定的本地化键或给定特殊项目的名称。用法与理念/国家精神中相同。 | 1.15 | |
| set_equipment_version_number | type = <equipment> 装备类型。
|
set_equipment_version_number = {
type = small_plane_airframe_1
version = 4
}
|
将给定装备类型的当前版本号更改为 N。由该类型创建的下一个装备变体将具有版本号 N+1。 | 把「变体最高版本」设置为指定版本。 不提供提示框。 |
1.16 |
军事
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| destroy_ships | type = <ship> 要摧毁的舰船类型。
|
destroy_ships = {
type = destroyer
count = all
}
|
摧毁「当前作用域」控制的指定类型和数量的舰船。 | 1.5 | |
| transfer_navy |
|
transfer_navy = {
target = GER
}
|
将「当前作用域」的海军移交给指定国家。 | 1.5 | |
| transfer_ship | type = <ship> 要移交的舰船类型。
|
transfer_ship = {
prefer_name = "HMS Achilles"
type = light_cruiser
target = NZL
exclude_refitting = no
}
|
将「当前作用域」指定类型的舰船移交给指定国家。 | 1.4 | |
| create_ship | type = <ship> 要创建的舰船类型。
|
FRA = {
create_ship = {
type = ship_hull_submarine_1
equipment_variant = "S Class"
creator = ENG
name = "My ship name"
}
}
|
创建一艘来自其他国家的舰船并将其编入预备舰队。如果未设置,则使用作用域国家。 | 1.9 | |
| add_mines | 为「当前国家」向某个战略区域添加水雷。 | add_mines = { region = 42 amount = 100 }
|
向某个战略区域添加水雷。 | 1.6 | |
| add_ace | name = <string> 该王牌的姓名。
|
add_ace = {
name = "Amelia"
surname = "Earhart"
callsign = "Revenant"
type = fighter_genius
is_female = yes
}
|
为「当前作用域」添加一名王牌飞行员。 | 王牌飞行员类型可在 /Hearts of Iron IV/common/aces/*.txt 中找到。 | 1.0 |
| unlock_tactic | <string> 要解锁的战术。 |
unlock_tactic = tactic_masterful_blitz |
为该国家解锁指定的战斗战术。 | 1.17 |
学说
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_doctrine_cost_reduction | name = <loc_key> 可选提示框,显示该学说在学说菜单中成本降低的原因。
|
add_doctrine_cost_reduction = {
cost_reduction = 0.5
uses = 2
category = land_doctrine
}
|
为学说添加有限次使用的费用降低。 | 关于通用的学说费用降低,请参见 修正项 中的 " |
1.11 |
| add_mastery | amount = <int> 要添加的精通度数量。
|
add_mastery = {
amount = 100
# FILTERS:
folder = land
grand_doctrine = mobile_warfare
sub_doctrine = mobile_infantry
track = infantry
index = 1
}
|
添加学说掌握度。 | 你可以使用灵活的筛选器,使该效果作用于所有匹配指定文件夹、宏学说、子学说或具体路线的路线。如果某个筛选器不存在,则视为通过。例如,完全不指定任何筛选器即可为所有文件夹中的所有已激活路线添加掌握度。 | 1.17 |
| add_daily_mastery | amount = <float> 每天要添加的精通度数量。
|
add_daily_mastery = {
amount = 0.5
days = 90
name = CHI_military_affairs_commission_sea
# FILTERS:
folder = land
grand_doctrine = mobile_warfare
sub_doctrine = mobile_infantry
track = infantry
index = 1
}
|
在特定持续时间内每天添加学说掌握度。 | 你可以使用灵活的筛选器,使该效果作用于所有匹配指定文件夹、宏学说、子学说或具体路线的路线。如果某个筛选器不存在,则视为通过。例如,完全不指定任何筛选器即可为所有文件夹中的所有已激活路线添加掌握度。 | 1.17 |
| add_mastery_bonus | bonus = <float> 加成系数,例如 0.1 = +10%
|
add_mastery_bonus = {
bonus = 0.5
days = 90
name = CHI_military_affairs_commission_sea
# FILTERS:
folder = land
grand_doctrine = mobile_warfare
sub_doctrine = mobile_infantry
track = infantry
index = 1
}
|
在特定持续时间内获得学说掌握度获取加成。 | 你可以使用灵活的筛选器,使该效果作用于所有匹配指定文件夹、宏学说、子学说或具体路线的路线。如果某个筛选器不存在,则视为通过。例如,完全不指定任何筛选器即可为所有文件夹中的所有已激活路线添加掌握度。 | 1.17 |
| set_grand_doctrine | <string> 宏学说 id。 |
set_grand_doctrine = mobile_warfare |
激活(解锁并指定)指定的宏学说。 | 1.17 | |
| set_sub_doctrine | <string> 子学说 id。OR |
set_sub_doctrine = mobile_infantry set_sub_doctrine = {
sub_doctrine = mobile_infantry
folder = land
track = 1
}
|
激活(解锁并指定)指定的子学说。 | 默认情况下,子学说会被指定给系统能找到的第一条匹配路线。不过,你也可以指定特定的文件夹和路线索引来指定子学说,以防同一条路线出现在多个文件夹中,或在同一文件夹中多次出现。 | 1.17 |
情报
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| create_intelligence_agency | name = <string> 情报机构的名称。(可选)
|
create_intelligence_agency = {
name = "A.G.E.N.C.Y"
icon = GFX_intelligence_agency_logo_agency
}
create_intelligence_agency = yes |
创建一个情报机构。 | 两个参数都不是必需的,因此你可以只用 create_intelligence_agency = yes 调用该效果。这会检查是否有任何针对该国的特定情报机构外观应被使用,如果没有则使用默认外观。 |
1.9 |
| upgrade_intelligence_agency | 允许自动解锁一项情报机构升级 | upgrade_intelligence_agency = upgrade_form_department upgrade_intelligence_agency = <upgrade> |
解锁一项情报机构升级。 | 升级可在 common/intelligence_agency_upgrades 中找到 | 1.9 |
| add_decryption | target = <tag> 对哪个国家添加解密。
|
add_decryption = {
target = GER
amount = 300
}
add_decryption = {
target = GER
ratio = 0.5
}
|
添加针对目标国家的解密 | target 和 ratio 参数互斥。 |
1.9 |
| add_intel | target = <tag> 对哪个国家添加情报。
|
add_intel = {
target = GER
civilian_intel = 3
army_intel = 2
navy_intel = 1
airforce_intel = 2
}
|
向指定国家添加指定数量的情报。 | 如果省略某个情报参数,则视为 0。 | 1.9 |
| add_operation_token | tag = <tag> 对哪个国家添加标记。
|
add_operation_token = {
tag = GER
token = token_test
}
|
向该国添加一个行动令牌,从而可以获取更多情报或施加针对性修正。 | 行动令牌定义于 /Hearts of Iron IV/common/operation_tokens/* 中。 | 1.9 |
| remove_operation_token | tag = <tag> 对哪个国家移除标记。
|
remove_operation_token = {
tag = GER
token = token_test
}
|
从该国移除一个行动令牌。 | 行动令牌定义于 /Hearts of Iron IV/common/operation_tokens/* 中。 | 1.9 |
| capture_operative | operative = <tag> 要俘获哪个特工。
|
capture_operative = {
operative = PREV
ignore_death_chance = yes
}
capture_operative = PREV |
捕获指定的特工。 | 特工可通过 引用作用域的标签 来引用 | 1.9 |
| create_operative_leader | bypass_recruitment = <bool> 该特工是被直接加入可用特工列表,还是需要被招募。
|
create_operative_leader = {
name = "Jacques Duclos"
GFX = GFX_portrait_jacques_duclos
traits = { operative_infiltrator operative_natural_orator }
bypass_recruitment = no
available_to_spy_master = yes
nationalities = { FRA POL }
}
|
为当前作用域创建一个具有指定属性的特工。 | 特质见 /Hearts of Iron IV/common/unit_leader/*.txt。除 bypass_recruitment 外,所有参数均为可选。肖像必须使用 spriteType,诸如 "gfx/leaders/TAG/filename.dds" 这样的直接链接无法使用。 | 1.9 |
| free_operative | <tag> 要释放的特工。 |
free_operative = PREV |
释放指定的特工。 | 特工可通过 引用作用域的标签 来引用 | 1.9 |
| free_random_operative | captured_by = <tag> 俘获该特工的国家。
|
free_random_operative = {
captured_by = POL
all = yes
}
|
释放一名随机的被俘特工,或释放全部被俘特工。 | 1.9 | |
| kill_operative | operative = <tag> 被杀害的特工。 |
kill_operative = {
operative = PREV
}
kill_operative = PREV |
杀害目标特工。 | 特工可通过 引用作用域的标签 来引用 | 1.9 |
| turn_operative | operative = <tag> 被策反的特工。 |
turn_operative = {
operative = PREV
}
turn_operative = PREV |
策反目标特工背叛其本国,并将其转至当前国家。 | 可以使用 引用作用域的标签 来指代特工。这算作该特工死亡,并将触发相应的 On action。若用于你自己的特工,会记录一条错误。 | 1.9 |
| steal_random_tech_bonus | category = <category name> 要窃取来源的类别。列表见 /Hearts of Iron IV/common/technology_tags/*。
|
steal_random_tech_bonus = {
category = air_equipment
folder = naval_folder
ahead_reduction = 0.8
bonus = 1.2
base_bonus = 1.1
dynamic = yes
name = LOC_KEY
target = POL
uses = 2
}
|
从指定国家窃取一项随机科技加成。 | 若该国没有可窃取的科技,则以 base_bonus 为基础施加一项随机加成。 | 1.9 |
角色
以下是国家作用域中与角色相关的效果。角色作用域中的效果见 § 角色作用域。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| set_nationality | target_country = <country> / <variable> 目标国家。
|
set_nationality = {
target_country = TZN
character = OMA_sultan
}
|
将指定角色转换到指定国家。 | 若你想更改某个特定人物的国籍,而获得该效果的国家尚未招募该人物,请使用 every_possible_country = {
limit = { has_character = ID }
random_character = {
limit = { is_character = ID }
set_nationality = TAG
}
} 用于召集他们的指令。仅在 1.11 及以后的版本中需要。 |
1.11 |
| retire_character | <character>
|
retire_character = GER_Character_Token |
使该角色退役,移除其担任的所有职务,并使其从游戏中消失。 | 仅限国家作用域。角色退役后无法再次招募。 | 1.11 |
| set_character_name | character = <character> 要修改的人物。
|
set_character_name = {
character = my_character
name = my_name
}
|
为目标角色设置新名字。 | 也可在角色作用域中使用。 | 1.11 |
| character_list_tooltip | limit = { <triggers> } 必须满足才能在列表中显示的触发器。
|
character_list_tooltip = {
limit = {
has_character_flag = SOV_targeted_for_purge_flag
}
random_select_amount = 4
}
|
显示一份列表,包含所有满足指定限制条件且已被当前国家招募的角色。 | 1.11 | |
| add_trait | character = <character> 要修改的人物。
|
add_trait = {
character = TAG_jane_smith
slot = political_advisor
trait = really_good_boss
}
add_trait = {
character = TAG_my_leader
ideology = liberalism
trait = field_of_gar
}
|
为该角色添加指定的国家领袖特质。 | 也可在角色作用域中使用。意识形态类型指分配给角色的意识形态组子类型,社区俗称亚意识形态。角色槽位可以是角色的名字或 id。推荐使用名字,因为 1.11 已使 id 过时。 | 1.11 |
| remove_trait | character = <character> 要修改的人物。
|
remove_trait = {
character = TAG_jane_smith
slot = political_advisor
trait = really_good_boss
}
remove_trait = {
character = TAG_my_leader
ideology = liberalism
trait = field_of_gar
}
|
从该角色移除指定的特质。 | 也可在角色作用域中使用。意识形态类型指分配给角色的意识形态组子类型,社区俗称亚意识形态。角色槽位可以是角色的名字或 id。推荐使用名字,因为 1.11 已使 id 过时。 | 1.11 |
部队领袖
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| create_corps_commander | name = <string> 该领袖的名称。
|
create_corps_commander = {
name = "Jean de Lattre de Tassigny"
picture = "Portrait_France_Jean_de_Lattre_de_Tassigny.dds"
traits = { trickster brilliant_strategist }
skill = 4
attack_skill = 4
defense_skill = 2
planning_skill = 4
logistics_skill = 3
}
|
为当前作用域创建一个具有指定属性的指挥官。 | 特质见 /Hearts of Iron IV/common/unit_leader/*.txt。已废弃,建议尽可能改用 add_corps_commander_role。若通过军官团将其任命为部长,所创建的军级指挥官将无法拥有肖像,从而导致错误。 | 1.0 |
| create_field_marshal | name = <string> 该领袖的名称。
|
create_field_marshal = {
name = "Maurice Gamelin"
portrait_path = "GFX_portrait_FRA_maurice_gamelin"
traits = { defensive_doctrine }
skill = 2
attack_skill = 1
defense_skill = 3
planning_skill = 2
logistics_skill = 1
}
|
为当前作用域创建一个具有指定属性的元帅。 | 特质见 /Hearts of Iron IV/common/unit_leader/*.txt。已废弃,建议尽可能改用 add_field_marshal_role。若通过军官团将其任命为部长,所创建的元帅将无法拥有肖像,从而导致错误。 | 1.0 |
| create_navy_leader | name = <string> 该领袖的名称。
|
create_navy_leader = {
name = "François Darlan"
gfx = "GFX_portrait_FRA_francois_darlan"
traits = { superior_tactician }
skill = 3
attack_skill = 2
defense_skill = 4
maneuvering_skill = 3
coordination_skill = 2
}
|
为当前作用域创建一个具有指定属性的海军领袖。 | 特质见 /Hearts of Iron IV/common/unit_leader/*.txt。已废弃,建议尽可能改用 add_naval_commander_role。若通过军官团将其任命为部长,所创建的海军上将将无法拥有肖像,从而导致错误。 | 1.0 |
| remove_unit_leader | <id> 部队领袖的 id。 |
remove_unit_leader = 70 |
按旧版 ID 移除指定的部队领袖。 | 不能使用角色 ID。建议尽可能改在角色的作用域内使用 remove_unit_leader_role。 | 1.0 |
| add_corps_commander_role | character = <character> 要修改的人物。
|
add_corps_commander_role = {
Character = GER_Character_token
skill = 4
attack_skill = 2
defense_skill = 3
planning_skill = 3
logistics_skill = 5
}
|
将指定角色设置为同时担任军级指挥官。 | 也可在角色作用域中使用。 | 1.11 |
| add_field_marshal_role | character = <character> 要修改的人物。
|
add_field_marshal_role = {
character = GER_Character_token
skill = 4
attack_skill = 2
defense_skill = 3
planning_skill = 3
logistics_skill = 5
}
|
将指定角色设置为同时担任元帅。 | 也可在角色作用域中使用。 | 1.11 |
| add_naval_commander_role | character = <character> 要修改的人物。
|
add_naval_commander_role = {
Character = GER_Character_token
skill = 4
attack_skill = 2
defense_skill = 3
planning_skill = 3
logistics_skill = 5
}
|
将指定角色设置为同时担任海军上将。 | 也可在角色作用域中使用。 | 1.11 |
| show_unit_leaders_tooltip | <character> 要显示名字的角色。 |
show_unit_leaders_tooltip = TAG_my_leader |
以提示框形式显示指定角色的名字。 | 1.11 |
国家领袖
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| create_country_leader | name = <string> 该领袖的名称。
|
create_country_leader = {
name = AFG_mohammed_zahir_shah
desc = "POLITICS_MOHAMMED_ZAHIR_SHAH_DESC"
picture = GFX_AFG_mohammed_zahir_shah
expire = "1965.1.1"
ideology = despotism
traits = {
}
}
|
该肖像使用 spriteType,在 /Hearts of Iron IV/interface/*.gfx 中定义。 子意识形态在 /Hearts of Iron IV/common/ideologies 中定义。已弃用。在可能的情况下建议改用 add_country_leader_role。 |
1.0 | |
| add_country_leader_role | character = <character> 要修改的人物。
|
add_country_leader_role = {
character = GER_character_token
promote_leader = yes
country_leader = {
ideology = fascism_ideology
expire = "1965.1.1.1"
traits = { war_industrialist }
}
}
|
将指定角色设置为同时担任国家领袖,并在指定时提升为政党领袖。 | 也可在角色作用域中使用。 若该角色在意识形态组中已拥有国家领袖职务,则完全无效。 | 1.11 |
| promote_character | <character> 要提升的人物。OR |
promote_character = GER_erwin_rommel promote_character = {
character = GER_erwin_rommel
ideology = nazism
}
|
将角色提升为其所属政党的领袖。 | 也可在角色作用域中使用。 若该角色拥有多个国家领袖职务,则必须指定意识形态类型。意识形态类型指分配给角色的意识形态组子类型,社区俗称亚意识形态。 | 1.11 |
| remove_country_leader_role | character = <character> 要修改的人物。
|
remove_country_leader_role = {
character = GER_Character_Token
ideology = socialism
}
|
移除角色的国家领袖职务。 | 也可在角色作用域中使用。 意识形态类型指分配给角色的意识形态组子类型,社区俗称亚意识形态。 | 1.11 |
| kill_ideology_leader | <ideology> 意识形态。 |
kill_ideology_leader = communism |
杀死当前作用域中指定意识形态的国家领袖。 | 1.9 | |
| retire_ideology_leader | <ideology> 意识形态。 |
retire_ideology_leader = fascism |
使当前作用域中该意识形态政党的国家领袖退役并将其移除。 | 1.9 | |
| kill_country_leader | <bool> 布尔值。 |
kill_country_leader = yes |
杀死当前作用域的国家领袖。 | 1.0 | |
| retire_country_leader | <bool> 布尔值。 |
retire_country_leader = yes |
使当前作用域的国家领袖作为其政党领袖退役并将其移除。 | 1.0 | |
| set_country_leader_ideology | <政府> 要设置的政府。 |
set_country_leader_ideology = socialism |
更改当前作用域中国家领袖的政府类型。 | 不生成提示框。 | 1.0 |
| set_country_leader_description | ideology = <ideology> 该国领袖的意识形态,可选。
|
set_country_leader_description = {
ideology = neutrality
desc = LOC_KEY
}
|
更改国家领袖的描述。 | 必须使用任意 /Hearts of Iron IV/localisation/*.yml 文件中的本地化键,将描述放在引号中无效。更多信息见 本地化文件 | 1.9.1 |
| set_country_leader_name | ideology = <ideology> 该国领袖的意识形态,可选。
|
set_country_leader_name = {
ideology = neutrality
name = LOC_KEY
}
|
更改国家领袖的名字。 | 1.9.1 | |
| set_country_leader_portrait | ideology = <ideology> 该国领袖的意识形态,可选。
|
set_country_leader_portrait = {
ideology = neutrality
portrait = GFX_IMAGE_NAME
}
|
更改国家领袖的肖像。 | 肖像必须定义于 /Hearts of Iron IV/interface/*.gfx 中 | 1.9.1 |
| add_country_leader_trait | <trait> 要添加的特质。 |
add_country_leader_trait = nationalist_symbol |
为当前国家的国家领袖添加指定的特质。 | 特质见 /Hearts of Iron IV/common/country_leader/*.txt 文件。 | 1.0 |
| remove_country_leader_trait | <trait> 要移除的特质。 |
remove_country_leader_trait = nationalist_symbol |
从当前作用域的国家领袖移除指定的特质。 | 特质见 /Hearts of Iron IV/common/country_leader/*.txt 文件。 | 1.0 |
| swap_ruler_traits | 类似于 swap_ideas。移除一个特质并添加另一个特质。 | swap_ruler_traits = { remove = <trait> add = <trait> }
|
交换特质。 | 在角色作用域中使用 swap_country_leader_traits。 | 1.6 |
顾问
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| activate_advisor | <character> 要启用的角色。 |
activate_advisor = GER_character_token_air_chief |
聘用一名顾问,并将其放入相应的槽位。 | 1.11 | |
| deactivate_advisor | <character> 要停用的角色。 |
deactivate_advisor = GER_character_token_air_chief |
将顾问从其槽位解职,使该槽位空置。 | 1.11 | |
| add_advisor_role | character = <character> 要修改的人物。
|
add_advisor_role = {
character = GER_Character_token
activate = yes
advisor = {
slot = air_chief
cost = 50
idea_token = GER_character_token_air_chief
traits = {
air_chief_ground_support_2
}
}
}
|
将指定角色设置为同时担任顾问,并在指定时启用。 | 用这种方式创建的顾问定义中不能添加 也可在角色作用域中使用。 触发与效果块(例如 allowed 和 on_add)。 |
1.11 |
| remove_advisor_role | character = <character> 若该效果在国家作用域中执行,则指定该人物。
|
remove_advisor_role = {
character = "SOV_genrikh_yagoda"
slot = political_advisor
}
|
移除该角色的指定顾问职务。 | 也可在角色作用域中使用。 | 1.11 |
| set_can_be_fired_in_advisor_role | character = <character> 要修改的人物。
|
set_can_be_fired_in_advisor_role = {
character = BHR_important_advisor
value = no
}
|
更改顾问的 can_be_fired 属性,使玩家无法解职该顾问。 |
也可在角色作用域中使用。 | 1.12.8 |
科学家
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_scientist_role | character = <character> / <variable> 要修改的人物。
|
add_scientist_role = {
character = my_character / var:my_char_var / PREV
scientist = {
desc = desc_loc_key
traits = { scientist_trait_token ... }
skills = { specialization_token = 2 ... }
}
}
|
为角色添加科学家职务。 | 科学家角色格式与人物数据库中的相同。除可见触发器外,通过效果创建的科学家角色不能拥有触发器。 | 1.15 |
| remove_scientist_role | character = <character> / <variable> |
remove_scientist_role = {
character = my_character / var:my_char_var / PREV
}
|
移除角色的科学家职务。 | 也可在角色作用域中使用。 | 1.15 |
| generate_scientist_character | portrait = <GFX> 可选,默认为随机肖像。
|
generate_scientist_character = {
portrait = GFX_portrait
portrait_tag_override = CHI
gender = male
skills = {
specialization_token = 2
}
traits = { trait_token }
}
|
生成一个拥有科学家职务的新角色,并在作用域中的国家招募该角色。 | 1.15 |
军工组织(MIO)
这些是国家作用域中与军事工业组织相关的效果。关于军事工业组织作用域中的效果,请参见 § 军工组织作用域。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| show_mio_tooltip | <MIO> 要显示的军工组织。 |
show_mio_tooltip = my_mio |
显示一个提示框,展示该军工组织的名称及其初始特质(若存在)。 | 不会直接改变该军工组织的可用性。 | 1.13 |
| unlock_military_industrial_organization_tooltip | <军事工业组织> / <变量> 要解锁的军工组织。 |
unlock_military_industrial_organization_tooltip = mio:my_mio_token unlock_military_industrial_organization_tooltip = var:my_mio_var |
显示一个提示框,说明该军工组织已可用(即已解锁)。 | 1.13 | |
| unlock_mio_policy_tooltip | <policy> 要显示的政策。OR |
unlock_mio_policy_tooltip = my_policy_1 unlock_mio_policy_tooltip = {
policy = my_policy_2
show_modifiers = no
}
|
显示一个提示框,说明该政策已可用。 | 不会直接改变该政策的可用性。 | 1.13 |
| add_mio_policy_cost | policy = <policy> 要修改的政策。
|
add_mio_policy_cost = {
policy = my_policy
value = 10
}
|
修改军工组织政策的基础花费。 | 基础数值下限为 0。 | 1.13 |
| set_mio_policy_cost | policy = <policy> 要修改的政策。
|
set_mio_policy_cost = {
policy = my_policy
value = 100
}
|
修改军工组织政策的基础花费。 | 不能为负数。 | 1.13 |
| add_mio_policy_cooldown | policy = <policy> 要修改的政策。
|
add_mio_policy_cooldown = {
policy = my_policy
value = 10
}
|
修改军工组织政策冷却时间的基础长度。 | 基础数值下限为 0。 | 1.13 |
| set_mio_policy_cooldown | policy = <policy> 要修改的政策。
|
set_mio_policy_cooldown = {
policy = my_policy
value = 100
}
|
修改军工组织政策冷却时间的基础长度。 | 不能为负数。 | 1.13 |
特殊项目
以下是国家作用域中与特殊项目相关的效果。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| complete_special_project | sp:<project>要完成的项目。OR |
complete_special_project = sp:sp_naval_midget_submarine complete_special_project = {
project = sp:sp_naval_midget_submarine
scientist = ITA_curio_bernardis
state = my_state
iteration_output = {
my_reward
my_other_reward
my_third_reward = my_option_1
}
show_modifiers = no
}
|
为作用域中的国家完成一个特殊项目。此效果不会考虑项目树的当前状态,即使前置项目未解锁也可解锁某个项目。由于该项目并非在设施中完成,设施状态与科学家效果不会生效。 | project、scientist、state 接受变量和关键字。 使用可选的迭代输出会使州和科学家参数变为必填。 |
1.15 |
| add_breakthrough_points | specialization = <dp_specialization_id> 该专业化,例如 specialization_land。
|
add_breakthrough_points = {
specialization = specialization_land
value = 3
}
add_breakthrough_points = {
specialization = all
value = 1
}
|
为国家作用域中的某个专精或全部专精增加突破点数。 | 1.15 | |
| add_breakthrough_progress | specialization = <dp_specialization_id> 该专业化,例如 specialization_land。
|
add_breakthrough_progress = {
specialization = specialization_land
value = 3
}
add_breakthrough_progress = {
specialization = all
value = sp_breakthrough_progress.medium
}
|
为国家作用域中的某个专精或全部专精增加突破进度。 | 该值可以是绝对值或脚本常量。 | 1.15 |
生涯档案
以下是国家作用域中与生涯档案相关的效果。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| career_profile_step_missiolini | <bool> 布尔值。 |
career_profile_step_missiolini = yes |
将生涯档案中已完成的墨索里尼任务数加一。 | ??? |
历史
这些效果 只能在历史文件中使用,在文件外使用时会失败。不过它们仍被视为效果而非历史参数,因为它们可用于 if 语句中。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| recruit_character | <character>
|
recruit_character = GER_Character_token |
在初始时将指定角色分配给当前国家。 | 1.11 | |
| generate_character | token_base = <string> 必填,作为人物标记使用。
|
generate_character = {
token_base = army_chief_defensive_1
name = funny_name
advisor = {
slot = air_chief
cost = 50
idea_token = GER_character_token_air_chief
traits = {
air_chief_ground_support_2
}
allowed = {
always = yes
}
}
}
|
为当前国家生成一个角色。 | 若用于创建顾问,则顾问职务的理念令牌将由 token_base 与 idea_token 拼接而成(若未设置理念令牌,则默认使用槽位),以下划线作为分隔符。在给出的示例中,理念令牌将是 army_chief_defensive_1_GER_character_token_air_chief;若没有 idea_token,则为 army_chief_defensive_1_air_chief。 |
1.11 |
| set_oob | <战斗序列> 用于战斗序列的文件名,不含 .txt 扩展名。 |
set_oob = BHR_1936 |
设置当前国家各师所使用的战斗序列,覆盖所有其他非海军、非空军的战斗序列。 | 战斗序列定义于 /Hearts of Iron IV/history/units/*.txt 文件中。 | 1.0 |
| set_naval_oob | <战斗序列> 用于战斗序列的文件名,不含 .txt 扩展名。 |
set_naval_oob = BHR_1936_naval_legacy |
设置当前国家各师所使用的战斗序列,覆盖所有其他海军战斗序列。 | 战斗序列定义于 /Hearts of Iron IV/history/units/*.txt 文件中。 | 1.0 |
| set_air_oob | <战斗序列> 用于战斗序列的文件名,不含 .txt 扩展名。 |
set_air_oob = ITA_1936_air_bba |
设置当前国家各师所使用的战斗序列,覆盖所有其他空军战斗序列。 | 战斗序列定义于 /Hearts of Iron IV/history/units/*.txt 文件中。 | 1.12 |
| set_keyed_oob | key = <string> 该文件使用的键。
|
set_keyed_oob = {
key = naval
name = BHR_1936_mtg
}
|
设置当前国家各师所使用的战斗序列,覆盖所有其他使用相同键的键控战斗序列。 | 战斗序列定义于 /Hearts of Iron IV/history/units/*.txt 文件中。 | 1.0 |
变量
以下是国家作用域中与变量相关的效果。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| get_highest_scored_country_temp | scorer = <???> 在国家评分器中使用的 Id。
|
get_highest_scored_country_temp = {
scorer = scorer_id
var = var_name
}
|
计算国家评分器中定义的得分最高的国家,并将其存入变量。 | ??? | |
| get_sorted_scored_countries_temp | scorer = <???> 在国家评分器中使用的 Id。
|
get_sorted_scored_countries_temp = {
scorer = scorer_id
array = array_name
scores = array_name
}
|
计算并排序国家评分器中的所有国家,并将其及对应得分存入临时数组。 | ??? | |
| get_supply_vehicles | var = <string> 要设置的变量名。
|
get_supply_vehicles = {
var = trucks_needed
type = truck
need = yes
}
|
将变量设置为库存中或所需的补给车辆数量。 | ??? | |
| get_supply_vehicles_temp | var = <string> 要设置的变量名。
|
get_supply_vehicles_temp = {
var = trucks_needed
type = truck
need = yes
}
|
将临时变量设置为库存中或所需的补给车辆数量。 | ??? |
州作用域
此处的效果必须在州作用域内使用。
通用
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| state_event | id = <event> 要触发的事件。
|
state_event = {
id = my_event.1
days = 10
random = 50
random_days = 10
trigger_for = controller
}
|
为当前州触发指定的事件。 | 在不需要反复检查触发器的情况下,random 可以成为用于安排事件的 mean_time_to_happen 的性能轻量替代方案。使用 days = <event> / <variable> 或 hours 可能仍有缺陷,且不会触发该事件。 |
1.0 |
| set_state_flag | <flag> 用于标识该州标记的唯一字符串。OR |
set_state_flag = my_flag set_state_flag = {
flag = my_flag
days = 123
value = 1
}
|
定义一个州旗标。 | 不显示工具提示。此效果中的 flag 是「布尔旗标」的含义,用于存储信息。 | 1.0 |
| clr_state_flag | <flag> 要清除的州旗标的唯一字符串。 |
clr_state_flag = my_flag |
清除已定义的州旗标。 | 不显示提示框。 | 1.0 |
| modify_state_flag | flag = <flag> 要修改的标记。
|
modify_state_flag = {
flag = my_flag
value = 3
}
|
为旗标增加一个整数值。 | 该旗标必须已被设置。 | 1.3 |
| set_state_name | <string> 定义新的名称。 |
set_state_name = "Funland" |
将当前州的名称更改为指定名称。 | 1.3 | |
| reset_state_name | <bool> 布尔值。 |
reset_state_name = yes |
重置对当前州名称所做的任何更改。 | 1.3 | |
| add_claim_by | <国家> / <变量> 要为其添加宣称的国家。 |
add_claim_by = SOV |
为指定国家在当前作用域上添加宣称。 | 1.0 | |
| remove_claim_by | <国家> / <变量> 要为其移除宣称的国家。 |
remove_claim_by = SOV |
移除指定国家在当前作用域上的宣称。 | 1.0 | |
| add_core_of | <国家> / <变量> 要为其添加核心的国家。 |
add_core_of = SOV |
为指定国家在当前作用域上添加核心。 | 1.0 | |
| remove_core_of | <国家> / <变量> 要为其移除核心的国家。 |
remove_core_of = SOV |
移除指定国家在当前作用域上的核心。 | 1.0 | |
| set_demilitarized_zone | <bool> 布尔值。 |
set_demilitarized_zone = yes |
将当前作用域设为非军事区。 | 1.0 | |
| set_state_category | <category> 要更改到的类别。 |
set_state_category = rural |
将当前州类别更改为指定类别。 | 类别见 /Hearts of Iron IV/common/state_category/*.txt | 1.3 |
| add_state_modifier | 修正作用域
|
add_state_modifier = {
modifier = {
local_resources = 2.0
}
}
|
为当前州添加一个modifier。 | 1.3 | |
| add_manpower | <整数> / <变量> 要添加的数量。 |
add_manpower = 10000 |
为当前州添加指定数量的总人口。 | 注意:使用负人力时,除了减少人口外,还会直接加入该州的可招募人力,从而增加你的人力。 | 1.0 |
| add_resource | type = <resource> 要添加的资源。
|
add_resource = {
type = oil
amount = 100
}
|
为当前州添加指定资源的指定数量。 | 也可在国家作用域中使用。 | 1.0 |
| set_border_war | <bool> 布尔值。 |
set_border_war = yes |
为当前州启用边境战争状态。 | 用于以州的边境战争,在地图上以橙色条纹表示,模拟两国边境上的战斗的边境战争参见§ 边境战争。边境战争结束时,会对输掉边境战争的州触发on_border_war_lost 的 on_action。 | 1.0 |
| create_unit | division = <division string> 该师字符串。
|
create_unit = {
division = "name = \"Infantry Division\" division_template = \"Infantry Division\" start_experience_factor = 0.5"
owner = GER
}
create_unit = {
division = "name = \"Artie\" division_template = \"Artillery Division\" start_manpower_factor = 0.3"
owner = BHR
count = 3
allow_spawning_on_enemy_provs = yes
country_score = {
base = 3
modifier = {
factor = 2
tag = OMA
}
}
id = 123
}
create_unit = {
division = "name = \"Tank division\" division_template = \"Tank Division\" start_manpower_factor = 1 force_equipment_variants = { medium_tank_chassis_2 = { owner = \"USA\" amount = 100 version_name = \"M4 Sherman\" }}"
owner = USA
count = 1
}
|
将指定的师添加到当前州。 | 师字符串 必须写在同一行。在 division = "..." 中间换行会破坏该效果,导致不生成任何单位。只能在州作用域内使用,例如 capital_scope。将该效果放入国家作用域时不会有任何作用。 装备系数不能设为零。 若设为零,将被视为 1。创建的装备将是该国可获得的最新装备。 |
1.3 |
| teleport_armies | limit = { <triggers> } 陆军所有者要被传送所必须满足的条件。
|
teleport_armies = {
limit = {
has_war_together_with = ROOT
}
to_state_array = owned_controlled_states
}
|
若军队所有者满足条件,则传送指定州内的所有军队。 | to_state_array、to_state 和 to_province 只能定义其中一个。若都未指定,则默认为首都。 | 1.9 |
| add_province_modifier | static_modifiers = { <modifiers> } 修正列表。 province = <id>要应用修正的省份。provinces = {}用于选择多个省份的作用域。以下参数必须写在其中: id = <id>省份的 ID。可指定多个。 all_provinces = yes选择所有符合限制条件的省份。以下参数需要它: limit_to_coastal = yes 将省份选择限制为仅沿海省份。 limit_to_border = yes 将省份选择限制为仅与不同国家接壤的省份。 limit_to_naval_base = yes 将省份选择限制为仅拥有海军基地的省份。 limit_to_victory_point = yes 将省份选择限制为仅拥有胜利点或城市的省份。 days = <int> 若指定则为临时修正,可以使用变量 |
add_province_modifier = {
static_modifiers = { mod_modifier_1 mod_modifier_2 }
province = 1234
}add_province_modifier = {
add_province_modifier = {
|
为该州内指定的省份添加一项省份修正。 | 省份修正在/Hearts of Iron IV/common/modifiers/*.txt中定义 | 1.6 |
| remove_province_modifier | static_modifiers = { <modifiers> } 修正列表。 province = <id>要应用修正的省份。provinces = {}用于选择多个省份的作用域。以下参数必须写在其中: id = <id>省份的 ID。可指定多个。 all_provinces = yes选择所有符合限制条件的省份。以下参数需要它: limit_to_coastal = yes 将省份选择限制为仅沿海省份。 limit_to_border = yes 将省份选择限制为仅与不同国家接壤的省份。 limit_to_naval_base = yes 将省份选择限制为仅拥有海军基地的省份。 limit_to_victory_point = yes 将省份选择限制为仅拥有胜利点或城市的省份。 |
remove_province_modifier = {
static_modifiers = { mod_modifier_1 mod_modifier_2 }
province = 1234
}remove_province_modifier = {
remove_province_modifier = {
|
移除该州内指定省份的省份修正。 | 省份修正在/Hearts of Iron IV/common/modifiers/*.txt中定义 | 1.6 |
| add_victory_points | 为省份添加胜利点 | add_victory_points = {
province = 1234
value = 10
}
|
为省份添加胜利点。 | 接受负值 | 1.10 |
| set_victory_points | 设置省份的胜利点 | set_victory_points = {
province = 1234
value = 10
}
|
设置省份的胜利点数量。 | 接受负值 | 1.10 |
| set_state_province_controller | controller = <tag> 该省份的新控制者。
|
set_state_province_controller = {
controller = POL
limit = {
OR = {
tag = GER
is_in_faction_with = GER
}
}
}
|
将该州内由满足触发器的国家控制的所有省份的控制者更改为指定国家。 | 1.9 | |
| transfer_state_to | <国家> 要将该州移交给的国家。 |
transfer_state_to = JAM |
将该州的所有者和控制者设置为指定国家 | 1.11 | |
| set_state_owner_to | <国家> 要将该州的所有者(但不包括控制者)设置为的国家。 |
set_state_owner_to = JAM |
将该州的所有者设置为指定国家 | 除非明确不应给予控制权,否则请使用transfer_state_to。 | 1.11 |
| set_state_controller_to | <国家> 要将该州的控制者(但不包括所有者)设置为的国家。 |
set_state_controller_to = ITA |
将该州的控制者设置为指定国家 | 1.11 | |
| add_contested_owner | <国家> / <变量> 要为该州添加争夺的国家。 |
add_contested_owner = GER |
为州添加争夺所有者。该效果既可在国家作用域使用,也可在州作用域使用,并接受另一方作为参数。 | 也可在国家作用域中使用。 | 1.15 |
| remove_contested_owner | <国家> / <变量> 要移除对该州争夺的国家。 |
remove_contested_owner = GER |
移除州的一个争夺所有者。该效果既可在国家作用域使用,也可在州作用域使用,并接受另一方作为参数。 | 也可在国家作用域中使用。 | 1.15 |
| strategic_province_location | <string> = <int> |
strategic_province_location = {
defensible_coastline = 10124
}
|
使用州作用域为省份添加一个战略位置。可用的战略位置在 strategic_locations 中定义,并通过省份 id 指定。 | 可以包含多个战略位置。 | 1.17 |
| strategic_state_location | <string> = <int> |
strategic_state_location = {
favorable_approach = 11932
}
|
为作用域中的州添加战略位置。可用的战略位置在 strategic_locations 中定义。 | 可以包含多个战略位置。 | 1.17 |
建筑
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_extra_state_shared_building_slots | <整数> / <变量> 要添加或移除的槽位数量。 |
add_extra_state_shared_building_slots = 2 |
更改当前州的共享建筑槽位数量。 | 共享建筑槽位指的是用于多种建筑类型的槽位,例如军用或民用工厂。这与非共享槽位形成对比,例如无线电台或空军基地所使用的槽位,它们只能通过科技在全球范围内更改。 注意: 当使用变量和 已保存的事件目标 时,必须写作 "saved_event.var_name",因为 "event_target:saved_event.var_name" 将无法工作。 |
1.0 |
| add_building_construction | type = <string> 要添加的建筑。
|
add_building_construction = {
type = arms_factory
level = 5
instant_build = yes
}
add_building_construction = {
type = bunker
level = 10
instant_build = yes
province = {
all_provinces = yes
limit_to_border = yes
limit_to_victory_point > 1
}
}
add_building_construction = {
type = bunker
level = 1
instant_build = yes
province = 2999
}
|
在当前州开始建造指定的建筑。 | 对于省级建筑,必须在包含该省份的州的作用域内进行 即使是在特定省份上执行。如果控制者国家没有在历史文件中分配的作战序列,这些建筑将不会出现在生产菜单中 直到重新计算建筑,例如通过更改消费品或重新加载存档。 只能在州作用域内使用,例如 random_owned_controlled_state。将该效果放入国家作用域时不会有任何作用。 关于基础游戏中存在的建筑 ID 列表,请参见 建筑模组制作#类型。 |
1.0 |
| set_building_level | type = <string> 要添加的建筑。
|
set_building_level = {
type = infrastructure
level = 10
instant_build = yes
}
set_building_level = {
type = bunker
level = 3
province = {
all_provinces = yes
limit_to_border = yes
level < 3
}
}
|
将指定的建筑设置到当前州(或该州内的省份)。 | 省份作用域用于省份级建筑。你可以使用以下方式将建造限制到胜利点: limit_to_victory_point > 5(只在胜利点高于 5 的省份上建造省份建筑) limit_to_victory_point = yes(只在拥有胜利点的省份上建造省份建筑) 对于省份建筑,必须在包含该省份的州的作用域内进行,即使是对特定省份操作也一样。 |
1.4 |
| damage_building | type = <building> 要损坏的建筑。
|
damage_building = {
type = infrastructure
damage = 1
}
damage_building = {
tags = dam_building
damage = 1
repair_speed_modifier = -0.8
province = 3488
}
|
破坏目标州或省份中的一座建筑。 | 建筑的生命值由建筑定义中的 value 属性决定。它乘以建筑等级即得到总生命值。 | 1.3 |
| remove_building | type = <building> 要移除的建筑。
|
remove_building = {
type = arms_factory
level = 5
}
remove_building = {
tag = facility
level = 1
}
|
移除当前州中指定的建筑。对于共享建筑,level 决定数量;对于其他建筑,它表示实际等级。 | 1.0 | |
| construct_building_in_random_province | <building> = <int> 要建造的建筑。 |
65 = {
construct_building_in_random_province = {
land_facility = 1
}
}
|
在州作用域内的随机省份设置建筑等级。 | 1.15 |
抵抗度与顺从度
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_compliance | <整数> / <变量> 要添加的数量。 |
add_compliance = 30 |
为指定的州添加顺从度。 | 1.9 | |
| add_resistance | <整数> / <变量> 要添加的数量。 |
add_resistance = 30 |
为指定的州添加抵抗度。 | 1.9 | |
| add_resistance_target | <整数> / <变量> 要添加的数量。 |
add_resistance_target = 30 |
提高指定州的抵抗度目标。 | 1.9 | |
| add_resistance_target | id = <int> 该目标增加的 ID。 amount = <int>/<variable> 抵抗度目标提高的数量。 occupied = <country> 仅当被占领国家为指定作用域时才会应用该提高。 occupier = <country> 仅当占领者为指定作用域时才会应用该提高。 days = <int>/<variable> 若设置,抵抗度目标只会在指定的天数内提高。 tooltip = <string> 在抵抗度目标工具提示中显示的工具提示。 |
add_resistance_target = {
id = 123
amount = 30
occupied = ENG
occupier = GER
days = 365
tooltip = my_localisation_key
}
|
提高指定州的抵抗度目标。 | 1.9 | |
| cancel_resistance | <bool> 布尔值。 |
cancel_resistance = yes |
取消当前州的抵抗度活动。 | 1.9 | |
| force_disable_resistance | <国家> 目标国家。 |
force_disable_resistance = GER |
当占领者为指定国家时,禁用作用域州的抵抗度。 | 1.9 | |
| force_disable_resistance | clear = <bool> 若设为 yes,将清除抵抗度。 occupier = <country> 若占领者为指定作用域,抵抗度将被禁用。 occupied = <country> 若被占领国家为指定作用域,抵抗度将被禁用。 |
force_disable_resistance = {
clear = yes
occupier = GER
occupied = ENG
}
|
当占领者为指定国家时,禁用作用域州的抵抗度。 | 1.9 | |
| force_enable_resistance | <国家> 目标国家。 |
force_enable_resistance = GER |
当占领者为指定国家时,启用作用域州的抵抗度。 | 它本身不会启动抵抗度,只会移除那些强制禁用抵抗度的检查。与start_resistance配合使用即可立即启动抵抗度。 | 1.9 |
| force_enable_resistance | clear = <bool> 若设为 yes,将清除抵抗度。 occupier = <country> 若占领者为指定作用域,抵抗度将被启用。 occupied = <country> 若被占领国家为指定作用域,抵抗度将被启用。 |
force_enable_resistance = {
clear = yes
occupier = GER
occupied = ENG
}
|
当占领者为指定国家时,启用作用域州的抵抗度。 | 它本身不会启动抵抗度,只会移除那些强制禁用抵抗度的检查。与start_resistance配合使用即可立即启动抵抗度。 | 1.9 |
| remove_resistance_target | <整数> / <变量> 要移除的抵抗度目标的 id。(必须通过 add_resistance_target 设置) |
remove_resistance_target = 30 |
移除指定州中已设置的抵抗度目标提高。 | 没有工具提示。 | 1.9 |
| set_compliance | <整数> / <变量> 要将顺从度设置为的数量。 |
set_compliance = 30 |
设置指定州的顺从度。 | 1.9 | |
| set_resistance | <整数> / <变量> 要将抵抗度设置为的数量。 |
set_resistance = 30 |
设置指定州的抵抗度。 | 该州应已启用抵抗度,可以通过start_resistance或游戏内流程启用。控制权变更后,抵抗度有时需要过一个 tick 才会开始,因此最好在紧接该效果执行之前交给该国的州上执行,例如在国家历史文件中执行时。 | 1.9 |
| start_resistance | <bool>/<country> 是否启动抵抗度。若以国家作为参数,则该州只有在被目标国家占领时才会启动抵抗度。 |
start_resistance = POL start_resistance = yes |
在指定的州启动抵抗度。 | 若用于通常无法启动抵抗度的州,请与force_enable_resistance配合使用。 | 1.9 |
| set_garrison_strength | <0-1> 新的驻军强度。 |
set_garrison_strength = 0.5 |
设置指定州驻军的强度。 | 1.9 | |
| set_occupation_law | <法令 ID> 由前一作用域或 default_law 颁布的新占领法令。 |
GER = {
every_controlled_state = {
set_occupation_law = military_governor_occupation
}
}# 更改德国对每个受控州的占领法令。 |
设置该州的占领法令。 | PREV 将是更改占领法令所针对的国家。若 PREV 不是国家,则不发生任何改变。若 PREV 未占领该州,则在它占领前不会有任何变化。若使用 default_law,则重置为该国的占领所设定的法令。 |
1.12 |
突袭
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| raid_reduce_project_progress_ratio | <float> 要减少的数值。 |
raid_reduce_project_progress_ratio = 0.1 |
减少州内特殊项目的进度。根作用域为突袭实例作用域。输入值为完成特殊项目所需总进度的比例,即 0 到 1 之间的小数。 | 1.15 |
角色作用域
此处的效果必须在角色作用域内使用。
通用
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| set_character_flag | <flag> 用于标识该人物标记的唯一字符串。OR |
set_character_flag = my_flag set_character_flag = {
flag = my_flag
days = 123
value = 1
}
|
定义一个角色旗标。 | 不显示工具提示。此效果中的 flag 是「布尔旗标」的含义,用于存储信息。 | 1.11 |
| set_character_name | <本地化键> 要使用的名称。 |
set_character_name = GER_my_cool_flag |
将角色的名称更改为指定本地化键的值。 | 1.11 | |
| modify_character_flag | flag = <flag> 要修改的标记。
|
modify_character_flag = {
flag = my_flag
value = 3
}
|
为旗标增加一个整数值。 | 该旗标必须已被设置。 | 1.11 |
| clr_character_flag | clr_character_flag = <bool> |
清除一个角色旗标 | 1.11 | ||
| retire | <bool> 布尔值> |
retire = yes |
使当前角色退役(将其移除)。 | 1.5 | |
| set_nationality | <国家> / <变量> 目标国家。 |
set_nationality = GER |
将当前角色切换到指定国家,并把该角色交给该国。 | 若你想更改某个特定人物的国籍,而获得该效果的国家尚未招募该人物,请使用 every_possible_country = {
limit = { has_character = ID }
random_character = {
limit = { is_character = ID }
set_nationality = TAG
}
} 用于召集他们的指令。仅在 1.11 及以后的版本中需要。 |
1.5 |
| set_portraits | character = <character> 该人物名称。若处于人物作用域中则可选。陆军作用域: |
set_portraits = {
character = my_character
army = { small ="MySmallCharacterGFX" }
civilian = { large ="MyLargeCharacterGFX" }
}
|
更改角色的指定立绘。 | Sprite 定义于 /Hearts of Iron IV/interface/*.gfx 文件中。 | 1.11 |
| add_trait | slot = <slot> 该人物的槽位。顾问必填。
|
add_trait = {
slot = political_advisor
trait = really_good_boss
}
add_trait = {
ideology = liberalism
trait = field_of_gar
}
|
为该角色添加指定的国家领袖特质。 | 意识形态类型指赋予角色的意识形态组下的子类型,社区术语中通常称为次意识形态。角色槽位可以是角色的名称或 id。推荐使用名称,因为 1.11 版本已使 id 过时。 | 1.11 |
| remove_trait | slot = <slot> 该人物的槽位。顾问必填。
|
remove_trait = {
slot = political_advisor
trait = really_good_boss
}
remove_trait = {
ideology = liberalism
trait = field_of_gar
}
|
从该角色移除指定的特质。 | 意识形态类型指赋予角色的意识形态组下的子类型,社区术语中通常称为次意识形态。角色槽位可以是角色的名称或 id。推荐使用名称,因为 1.11 版本已使 id 过时。 | 1.11 |
| add_corps_commander_role | <...>陆军领袖职务定义 |
add_corps_commander_role = {
skill = 4
attack_skill = 2
defense_skill = 3
planning_skill = 3
logistics_skill = 5
}
|
将指定角色设置为同时担任军级指挥官。 | 1.11 | |
| add_field_marshal_role | <...>陆军领袖职务定义 |
add_field_marshal_role = {
skill = 4
attack_skill = 2
defense_skill = 3
planning_skill = 3
logistics_skill = 5
}
|
将指定角色设置为同时担任元帅。 | 1.11 | |
| add_naval_commander_role | <...>海军领袖职务定义 |
add_naval_commander_role = {
skill = 4
attack_skill = 2
defense_skill = 3
planning_skill = 3
logistics_skill = 5
}
|
将指定角色设置为同时担任海军上将。 | 1.11 | |
| add_country_leader_role | character = <character> 要修改的人物。
|
add_country_leader_role = {
character = GER_character_token
promote_leader = yes
country_leader = {
ideology = fascism_type
expire = "1965.1.1.1"
traits = { war_industrialist }
}
}
|
将指定角色设置为同时担任国家领袖,并在指定时提升为政党领袖。 | 若该角色在意识形态组中已拥有国家领袖身份,则不会产生任何作用。 | 1.11 |
| promote_character | <bool> 布尔值。OR |
promote_character = yes promote_character = liberalism |
将角色提升为其所属政党的领袖。 | 若该角色拥有多个国家领袖身份,则必须指定意识形态类型。意识形态类型指赋予角色的意识形态组下的子类型,社区术语中通常称为次意识形态。 | 1.11 |
| remove_country_leader_role | ideology = <string> 角色的意识形态类型。 |
remove_country_leader_role = {
ideology = socialism
}
|
移除角色的国家领袖职务。 | 意识形态类型指赋予角色的意识形态组下的子类型,社区术语中通常称为次意识形态。 | 1.11 |
| add_advisor_role | advisor = { ... }顾问职务定义
|
add_advisor_role = {
activate = yes
advisor = {
slot = air_chief
cost = 50
idea_token = GER_character_token_air_chief
traits = {
air_chief_ground_support_2
}
}
}
|
将指定角色设置为同时担任顾问,并在指定时启用。 | 以这种方式创建的顾问定义中不能添加触发器和效果块(例如allowed和on_add)。 |
1.11 |
| remove_advisor_role | slot = <int> 要从中移除顾问的槽位。 |
remove_advisor_role = {
slot = political_advisor
}
|
移除该角色的指定顾问职务。 | 1.11 | |
| add_scientist_role | <...>科学家职务定义 |
add_scientist_role = {
scientist = {
desc = desc_loc_key
traits = { scientist_trait_token ... }
skills = { specialization_token = 2 ... }
}
}
|
为角色添加科学家职务。 | 科学家角色格式与人物数据库中的相同。除可见触发器外,通过效果创建的科学家角色不能拥有触发器。 | 1.15 |
| remove_scientist_role | <bool> |
remove_scientist_role = yes |
移除角色的科学家职务。 | 也可在国家作用域中使用。 | 1.15 |
| add_scientist_level | level = <int> / <variable> 要添加的等级。
|
add_scientist_level = {
level = 2
specialization = specialization_nuclear
}
|
为作用域中的科学家角色添加特殊项目专业方向的等级。 | 1.15 | |
| injure_scientist_for_days | <整数> / <变量> 应用受伤的天数。 |
injure_scientist_for_days = 12 |
使作用域中的科学家角色受伤 x 天。 | 1.15 | |
| add_scientist_trait | <trait> 要添加的特质。 |
add_scientist_trait = my_trait_token |
为作用域中的科学家角色添加一个特质。 | 1.15 | |
| add_scientist_xp | experience = <int> / <variable> 要添加的经验。
|
add_scientist_xp = {
experience = 2
specialization = specialization_nuclear
}
|
为作用域中的科学家角色添加特殊项目专业方向的经验。 | 1.15 | |
| set_can_be_fired_in_advisor_role | slot = <slot> 要修改的人物的槽位。
|
set_can_be_fired_in_advisor_role = {
slot = political_advisor
value = no
}
|
更改顾问的 can_be_fired 属性,使玩家无法解职该顾问。 |
1.12.8 |
部队领袖
这些只能用于单位指挥官类型的角色。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| unit_leader_event | id = <event> 要触发的事件。
|
unit_leader_event = {
id = my_event.1
days = 10
random = 50
random_days = 10
}
|
为当前单位指挥官的所有者触发指定事件。 | 使用显示当前单位将领肖像的特殊界面。 在无需反复检查触发器的情况下, |
1.5 |
| set_unit_leader_flag | <flag> 用于标识该单位指挥官旗标的唯一字符串。 |
set_unit_leader_flag = my_flag |
定义一个单位指挥官旗标。 | 已弃用。请改用set_character_flag。不显示工具提示。 | 1.5 |
| clr_unit_leader_flag | <flag> 要清除的单位指挥官旗标的唯一字符串。 |
clr_unit_leader_flag = my_flag |
清除已定义的单位指挥官旗标。 | 已弃用。请改用clr_character_flag。不显示工具提示。 | 1.5 |
| modify_unit_leader_flag | flag = <flag> 要修改的标记。
|
modify_unit_leader_flag = {
flag = my_flag
value = 3
}
|
为旗标增加一个整数值。 | 该旗标必须已经设置。已弃用。请改用modify_character_flag。 | 1.5 |
| promote_leader | <bool> 布尔值 |
promote_leader = yes |
将当前单位指挥官晋升为元帅(若为指挥官)。 | 1.5 | |
| demote_leader | <bool> 布尔值 |
demote_leader = yes |
将当前单位指挥官降为指挥官(若为元帅)。 | 1.5 | |
| add_unit_leader_trait | <trait> 要添加的特质。 |
add_unit_leader_trait = old_guard |
为当前单位指挥官添加指定的特质。 | 特质见 /Hearts of Iron IV/common/unit_leader/*.txt 文件。 | 1.0 |
| remove_unit_leader_trait | <trait> 要移除的特质。 |
remove_unit_leader_trait = old_guard |
移除当前单位指挥官的指定特质。 | 特质见 /Hearts of Iron IV/common/unit_leader/*.txt 文件。 | 1.0 |
| add_random_trait | <trait> 要添加的特质。 |
add_random_trait = { old_guard brilliant_strategist inflexible_strategist }
|
从列表中为该角色随机添加一个特质。 | 特质见 /Hearts of Iron IV/common/unit_leader/*.txt 文件。 | 1.5 |
| add_timed_unit_leader_trait | <trait> 要添加的特质。
|
add_timed_unit_leader_trait = {
trait = wounded
days = 90
}
|
为当前单位指挥官添加指定持续时间的指定特质。 | 特质见 /Hearts of Iron IV/common/unit_leader/*.txt 文件。 | 1.5 |
| replace_unit_leader_trait | trait = <trait> 要替换的特质。
|
replace_unit_leader_trait = {
trait = old_guard
replace = brilliant_strategist
}
|
将指定的特质替换为新特质。 | 特质可在/Hearts of Iron IV/common/unit_leader/*.txt文件中找到。 警告: 此效果有严重缺陷。它无法正确替换特质,且容易导致崩溃。请改用 remove_unit_leader_trait 和 add_unit_leader_trait。 |
1.5 |
| remove_exile_tag | 移除陆军指挥官的流亡标签,使其不再被视为流亡指挥官。 | remove_exile_tag = yes |
移除指挥官的流亡标签。 | 1.6 | |
| gain_xp | <int>
|
gain_xp = 5 |
为当前单位指挥官增加经验,若满足条件则晋升到下一技能等级。 | 不能使用负值。 | 1.9 |
| remove_unit_leader | <bool>
|
remove_unit_leader = yes |
移除当前单位指挥官。 | 1.0 | |
| remove_unit_leader_role | <bool> 布尔值。 |
remove_unit_leader_role = yes |
移除该角色的所有单位指挥官身份 | 1.11 |
国家领袖
这些只能用于国家领袖类型的角色。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_country_leader_trait | <trait> 要添加的特质。OR: |
add_country_leader_trait = nationalist_symbol add_country_leader_trait = {
ideology = marxism
trait = anti_communist
}
|
为当前角色添加指定的特质。 | 特质可在/Hearts of Iron IV/common/country_leader/*.txt文件中找到。前者仅在该角色只有一个国家领袖身份时适用。 | 1.11 |
| remove_country_leader_trait | <trait> 要移除的特质。OR: |
remove_country_leader_trait = nationalist_symbol remove_country_leader_trait = {
ideology = marxism
trait = anti_communist
}
|
从当前角色移除指定的特质。 | 特质可在/Hearts of Iron IV/common/country_leader/*.txt文件中找到。前者仅在该角色只有一个国家领袖身份时适用。 | 1.11 |
| swap_country_leader_traits | remove = <trait> 要移除的特质
|
swap_country_leader_traits = {
remove = nationalist_symbol
add = anti_communist
ideology = marxism
}
|
交换当前角色的特质。 | 在国家作用域中使用swap_ruler_traits。 | 1.11 |
战斗
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| supply_units | <整数> / <变量> 补给的小时数。 |
supply_units = 24 |
为当前单位指挥官率领的部队添加指定小时数的补给。 | 1.5 | |
| add_max_trait | <int> 要添加的数量。 |
add_max_trait = 1 |
为当前单位指挥官添加指定数量的可分配特质槽位。 | 1.5 | |
| add_skill_level | <int> 要添加的技能。 |
add_skill_level = 1 |
为当前单位指挥官增加技能。 | 1.5 | |
| add_logistics | <int> 要添加多少技能等级。 |
add_logistics = 1 |
为当前单位指挥官增加后勤技能。 | 1.5 | |
| add_planning | <int> 要添加多少技能等级。 |
add_planning = 1 |
为当前单位指挥官增加计划技能。 | 1.5 | |
| add_defense | <int> 要添加多少技能等级。 |
add_defense = 1 |
为当前单位指挥官增加防御技能。 | 1.5 | |
| add_attack | <int> 要添加多少技能等级。 |
add_attack = 1 |
为当前单位指挥官增加攻击技能。 | 1.5 | |
| add_coordination | <int> 要添加多少技能等级。 |
add_coordination = 1 |
为当前海军指挥官增加协同技能。 | 1.5 | |
| add_maneuver | <int> 要添加多少技能等级。 |
add_maneuver = 1 |
为当前海军指挥官增加机动技能。 | 1.5 | |
| add_temporary_buff_to_units | combat_offense = <float> 要授予的加成。可选。
|
add_temporary_buff_to_units = {
combat_offense = 0.25
combat_breakthrough = 0.25
org_damage_multiplier = -1.0
str_damage_multiplier = 0.25
war_support_reduction_on_damage = 0.2
cannot_retreat_while_attacking = 1.0
days = 7
tooltip = ABILITY_FORCE_ATTACK_TOOLTIP
}
|
为当前单位将领添加指定的战斗增益。 | 1.5 |
特工
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_nationality | <tag> 要把国籍设置为的国家。 |
add_nationality = GER |
为当前特工添加该国籍。 | 1.9 | |
| capture_operative | captured_by = <tag> 被哪个国家俘获。
|
capture_operative = {
captured_by = POL
ignore_death_chance = yes
}
|
使当前特工被某个特定国家俘获。 | 1.9 | |
| force_operative_leader_into_hiding | <bool> |
force_operative_leader_into_hiding = yes |
迫使当前特工进入隐匿状态。 | 1.9 | |
| free_operative | captured_by = <tag> 俘获该特工的国家。 |
free_operative = { captured_by = POL }
|
释放当前特工。 | 1.9 | |
| harm_operative_leader | <int> 对该特工造成多大伤害。 |
harm_operative_leader = 12 |
伤害当前特工。 | 该数值受修正影响。 | 1.9 |
| kill_operative | killed_by = <tag> 将杀死该特工的国家。 |
kill_operative = { killed_by = POL }
|
杀死当前特工。 | 1.9 | |
| turn_operative | turned_by = <tag> 该特工叛逃到的国家。 |
turn_operative = {
turned_by = PREV
}
|
使当前特工转而对抗自己的国家,将其转交给指定的国家。 | 这算作该特工死亡,并将触发相应的 On action。若用于你自己的特工,会记录一条错误。 | 1.9 |
| operative_leader_event | id = <event> 要触发的事件。
|
operative_leader_event = {
id = my_event.1
originator = POL
recipient = GER
days = 10
random = 50
random_days = 10
set_from = ENG
set_root = SOV
set_from_from = FRA
}
|
为该特工触发指定的事件。 | 使用显示当前特工肖像的特殊界面。 在无需反复检查触发器的情况下, |
1.9 |
师作用域
此处的效果必须在师作用域内使用。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| destroy_unit | <bool>布尔值。 |
destroy_unit = yes |
摧毁当前作用域中的师。 | 1.12 | |
| add_history_entry | key = <localisation key> 该条目的名称。
|
add_history_entry = {
key = my_history_entry
subject = "Test entry"
allow = no
}
|
在某师的指挥历史中创建一条记录。 | 1.12 | |
| change_division_template | <string> 该师的名称。 |
change_division_template = {
division_template = "New template"
}
|
把该师的模板更改为指定的模板。 | 1.12 | |
| add_random_valid_trait_from_unit | <character> 要授予该特质的人物。 |
add_random_valid_trait_from_unit = FROM |
为单位将领添加一个随机且有效的单位特质。 | 仅当师作用域与 ROOT 作用域相同时才能使用。 | 1.12 |
| add_unit_medal_to_latest_entry | unit_medals = <medal ID> 要添加的勋章。 |
add_unit_medal_to_latest_entry = {
unit_medals = my_medal
}
|
把指定的勋章添加到该单位历史中最新的一条记录上。 | 1.12 | |
| add_divisional_commander_xp | <decimal> 要添加的经验。 |
add_divisional_commander_xp = 10 |
为师长增加指定数量的经验。 | 1.12 | |
| reseed_division_commander | <int> 要使用的种子。 |
reseed_division_commander = 760 |
使用给定的种子重新随机该师的指挥官。 | 没有提示框。 | 1.12 |
| promote_officer_to_general | <bool>布尔值。 |
promote_officer_to_general = yes |
把该师的军官提升为将领。 | ||
| set_unit_organization | <decimal> 要设置到的等级。 |
set_unit_organization = 0.3 |
更改该单位的组织度。 | 标度为 0 到 1。 | 1.13 |
军工组织作用域
此处的效果必须在军工组织作用域内使用。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_mio_funds | <int> 要添加的资金。 |
add_mio_funds = 1000 |
为军事工业组织添加资金。 | 若该数量超过「扩大规模」上限,军事工业组织将自动获得规模。资金数量的下限封顶为 0。 | 1.13 |
| set_mio_funds | <int> 要设置的数量。 |
set_mio_funds = 1000 |
把某个军事工业组织的资金设置为特定水平。 | 若该数量超过「扩大规模」上限,军事工业组织将自动获得规模。不能为负数。 | 1.13 |
| add_mio_funds_gain_factor | <decimal> 要添加的数量。 |
add_mio_funds_gain_factor = 0.1 |
更改军事工业组织资金的基础倍率。 | 该倍率的下限封顶为 0。 | 1.13 |
| set_mio_funds_gain_factor | <decimal> 要设置的数量。 |
set_mio_funds = 0.1 |
更改军事工业组织资金的基础倍率。 | 不能为负数。 | 1.13 |
| add_mio_size | <int> 要添加的数量。 |
add_mio_size = 2 |
为军事工业组织增加规模。 | 资金不会因此效果而改变。不能为负数。 | 1.13 |
| add_mio_size_up_requirement_factor | <decimal> 要添加的数量。 |
add_mio_size_up_requirement_factor = 0.1 |
更改军事工业组织扩大规模所需条件的基础倍率。 | 该倍率的下限封顶为 0。 | 1.13 |
| set_mio_size_up_requirement_factor | <decimal> 要设置的数量。 |
set_mio_size_up_requirement_factor = 0.1 |
更改军事工业组织扩大规模所需条件的基础倍率。 | 不能为负数。 | 1.13 |
| add_mio_task_capacity | <int> 要添加的数量。 |
add_mio_task_capacity = 2 |
更改军事工业组织的基础任务容量上限。 | 若容量被削减到低于已分配任务的数量,这些任务将被转为允许状态。基础数值下限封顶为 0。不会立即生效。 | 1.13 |
| set_mio_task_capacity | <int> 要设置的数量。 |
set_mio_task_capacity = 2 |
更改军事工业组织的基础任务容量上限。 | 若容量被削减到低于已分配任务的数量,这些任务将被转为允许状态。不能为负数。不会立即生效。 | 1.13 |
| add_mio_research_bonus | <decimal> 要添加的数量。 |
add_mio_research_bonus = 0.3 |
更改军事工业组织的基础科研加成。 | 基础数值下限为 0。 | 1.13 |
| set_mio_research_bonus | <decimal> 要设置的数量。 |
set_mio_research_bonus = 0.3 |
更改军事工业组织的基础科研加成。 | 不能为负数。 | 1.13 |
| set_mio_name_key | <本地化键> 新的名称。 |
set_mio_name_key = mio_new_name |
更改军事工业组织的名称。 | 也可以指代一段脚本本地化定义,它将在军事工业组织的作用域中求值。 | 1.13 |
| set_mio_icon | <sprite> 新的 sprite。 |
set_mio_icon = GFX_new_mio_icon |
更改军事工业组织的图标。 | 1.13 | |
| add_mio_design_team_assign_cost | <decimal> 要添加的数量。 |
add_mio_design_team_assign_cost = 0.3 |
更改军事工业组织分配科研的基础政治点数成本。 | 基础数值下限为 0。 | 1.13 |
| set_mio_design_team_assign_cost | <decimal> 要设置的数量。 |
set_mio_design_team_assign_cost = 0.3 |
更改军事工业组织分配科研的基础政治点数成本。 | 不能为负数。 | 1.13 |
| add_mio_industrial_manufacturer_assign_cost | <decimal> 要添加的数量。 |
add_mio_industrial_manufacturer_assign_cost = 0.3 |
更改军事工业组织分配生产线的基础政治点数成本。 | 基础数值下限为 0。 | 1.13 |
| set_mio_industrial_manufacturer_assign_cost | <decimal> 要设置的数量。 |
set_mio_industrial_manufacturer_assign_cost = 0.3 |
更改军事工业组织分配生产线的基础政治点数成本。 | 不能为负数。 | 1.13 |
| add_mio_design_team_change_cost | <decimal> 要添加的数量。 |
add_mio_design_team_change_cost = 0.3 |
按百分比更改军事工业组织分配到装备的基础经验成本。 | 基础数值下限封顶为 0。向下取整,例如 0.3 成本为 5 时结果应为 6.5,但实际上变为 6。 |
1.13 |
| set_mio_design_team_change_cost | <decimal> 要设置的数量。 |
set_mio_design_team_change_cost = 0.3 |
按百分比更改军事工业组织分配到装备的基础经验成本。 | 不能为负数。向下取整,例如 0.3 成本为 5 时结果应为 6.5,但实际上变为 6。 |
1.13 |
| unlock_mio_trait_tooltip | <trait> 要显示的特质。OR |
unlock_mio_trait_tooltip = my_trait_1 unlock_mio_trait_tooltip = {
trait = my_trait_2
show_modifiers = no
}
|
显示一条提示框,说明该特质已可用。 | 不会直接更改该特质的可用性。 | 1.13 |
| complete_mio_trait | <trait> 要完成的特质。OR |
complete_mio_trait = my_trait_1 complete_mio_trait = {
trait = my_trait_2
show_modifiers = no
}
|
完成指定的军事工业组织特质。 | 自动为军事工业组织增加 1 点规模。不会对该特质施加任何检查。 | 1.13 |
| set_mio_flag | <flag> 用于标识该军事工业组织标记的唯一字符串。OR |
set_mio_flag = my_flag set_mio_flag = {
flag = my_flag
days = 123
value = 1
}
|
定义一个军事工业组织标记。 | 不显示提示框。 | 1.13 |
| clr_mio_flag | <flag> 要清除的国家旗标的唯一字符串。 |
clr_mio_flag = my_flag |
清除已定义的军事工业组织标记。 | 1.13 | |
| modify_mio_flag | flag = <flag> 要修改的标记。
|
modify_mio_flag = {
flag = my_flag
value = 3
}
|
为旗标增加一个整数值。 | 该旗标必须已被设置。 | 1.13 |
合同作用域
此处的效果必须在contract作用域内使用。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| cancel_purchase_contract | <bool> 布尔值。 |
cancel_purchase_contract = yes |
取消当前的采购合同。 | 1.13 |
突袭作用域
此处的效果必须在raid作用域内使用。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_raid_history_entry | <bool> |
add_raid_history_entry = yes/no |
为突袭添加历史条目。 | 1.15 | |
| raid_add_unit_experience | <float> 可以使用显式数值或变量 |
raid_add_unit_experience = 0.2 |
将给予分配给该突袭的任意类型单位经验,例如师或航空队。 | 该数值定义了向最高等级推进的进度,例如 0.2 = 获得达到最高等级所需经验的 20%。 | 1.15 |
| raid_damage_units | <flag> 用于标识该项目标记的唯一字符串。OR |
# Apply 50% damage to units
raid_damage_units = {
damage = 0.5
ratio = yes
}
# Apply 10 strength loss and 20 organization loss to units
raid_damage_units = {
org_damage = 20
str_damage = 10
}
# Lose 40% of all planes
raid_damage_units = {
plane_loss = 0.4
ratio = yes
}
# Lose 5 planes
raid_damage_units = {
plane_loss = 5
}
|
伤害会施加于地面单位,而对飞机的伤害则定义为损失的飞机数量。 | 若 'ratio = yes',则所有伤害/损失都按当前数量的比例施加。 对于单位,伤害可以通过一个值 'damage' 定义,或分别通过 'org_damage' 和 'str_damage' 定义 |
1.15 |
特殊项目作用域
此处的效果必须在 special project 作用域内使用。特殊项目在用作作用域或数值时必须始终在前面加上 sp:<special project>。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| add_project_progress_ratio | <float> 移除或添加 -1 到 1 之间的项目进度 |
sp:my_project = {
add_project_progress_ratio = 0.1
add_project_progress_ratio = var:my_var
}
|
为该项目原型阶段添加进度。 | 输入的数值是完成该特殊项目所需总进度的比例。 | 1.15 |
| complete_prototype_reward_option | prototype_reward = <prototype_reward> 要完成的原型奖励
|
complete_prototype_reward_option = {
prototype_reward = my_reward
prototyp_reward_option = my_option
show_modifiers = yes
}
|
为作用域中的项目完成一个原型奖励选项 | 该效果将遵循原型奖励的仅触发一次和允许属性。 | 1.15 |
| set_project_flag | <flag> 用于标识该项目标记的唯一字符串。OR |
set_project_flag = my_flag set_project_flag = {
flag = my_flag
days = 123
value = 1
}
|
定义一个项目标记。 | 不显示提示框。 | 1.15 |
| clr_project_flag | <flag> 要清除的国家旗标的唯一字符串。 |
clr_project_flag = my_flag |
清除已定义的项目标记。 | 1.15 | |
| modify_project_flag | flag = <flag> 要修改的标记。
|
modify_mproject_flag = {
flag = my_flag
value = 3
}
|
为旗标增加一个整数值。 | 该旗标必须已被设置。 | 1.15 |
其他作用域
此处的效果必须在说明中指定的作用域内使用。
| 名称 | 参数 | 示例 | 描述 | 备注 | 加入版本 |
|---|---|---|---|---|---|
| execute_operation_coordinated_strike | amount = <int> 该行动在行动中设定的天数内将执行多少次。 |
execute_operation_coordinated_strike = {
amount = 12
}
|
目标区域内所有已准备的港口打击和战略轰炸将执行多次,且防空无法拦截它们。 | 只能在行动中使用。 | 1.9 |
流程控制
这些作用域在效果作用域内使用,以控制效果的执行。
if 语句
if 语句允许仅在满足某些 触发器 时才执行效果。条件语句用 if = { ... } 效果表示。if 语句内部的 limit = { ... } 充当 trigger block,定义何时应执行,而 if = { ... } 内直接包含的其他所有内容都会被解释为条件为真时应执行的效果。
例如,若该国拥有正向
政治点数 且稳定度低于 90%,以下内容将为其增加 10% 稳定度:![]()
if = {
limit = {
has_political_power > 0
stability < 0.9
}
add_stability = 0.1
}
若不满足限制条件,则内部的所有效果都不会执行。若满足,则每一个都会执行。若省略限制条件,则默认为始终为 true。
效果必须位于 if 语句内部才能与限制条件相关联。例如,无论游玩哪个国家,这都将始终给予 100
政治点数:
if = {
limit = { tag = BHR }
} # Closes if = { ... }. Since no effects are inside, this means that the if statement does absolutely nothing
add_political_power = 100 # Outside of if = { ... }, so it will always give 100 political power, even if not playing as BHR
可选地,可以添加 else_if = { ... }(limit = { ... } 的作用类似)和 else = { ... }。若 if = { ... } 中的初始限制为 false,则继续检查下一个 else_if = { ... } 的限制。若那里的限制为 false,则继续下一个,直到遇到结尾或 else = { ... }。存在两种变体:嵌套与非嵌套。在第一种情况下,else_if 或 else 直接放在前面的 if 或 else_if 内部,而在第二种情况下它被放在 right after。若出现重叠,优先使用非嵌套的 if 语句。以下是使用非嵌套 if 语句的示例:
if = {
limit = {
stability < 0.3 # If stability is below 30%, add 30%.
}
add_stability = 0.3
}
else_if = {
limit = {
stability < 0.6 # Otherwise, if it's below 60% (i.e. 30-59%), add 20%
}
add_stability = 0.2
}
else = {
add_stability = 0.1 # If there's 60-100% stability, add 10%
}
在提示框中,只显示将会执行的效果。未满足的 if 语句内的效果(或因 if 语句已满足而未被读取的 else/else_if)将对玩家隐藏,触发器也会被隐藏。为避免玩家困惑,custom effect tooltips can be used to tell the player what this effect block would do,例如在 else 中使用时。
随机效果
如果你希望某个效果有随机概率被执行,否则什么也不发生,random = { ... } 块是实现这一点的最简单方式:
random = {
chance = 80
add_stability = 0.4
add_war_support = 0.3
}
这特别意味着有 80% 的概率增加 40% 稳定度和 30% 战争支持度,相应地有 20% 的概率什么也不做。此处的概率采用 0 到 100 的标度。
如果你希望游戏在多个效果块之间选择,可以改用 random_list。例如,若你希望某个效果随机给予玩家四种加成之一,你可以按如下方式编写:
random_list = {
10 = {
add_stability = 0.5
}
10 = {
add_manpower = 10000
}
10 = {
add_war_support = 0.5
}
10 = {
army_experience = 100
}
}
该数字不是概率,而是每个选项的权重,因为它们不必总和为 100 或任何数字。例如,权重为 20 的选项被选中的可能性是权重为 10 的选项的两倍。总体而言,某个选项被选中的概率等于该选项的权重除以所有权重之和。
也可以使用修正(类似 MTTH 块)来影响每个可能随机效果的权重,或使用变量作为概率。
random_list = {
30 = {
modifier = {
factor = 1.3
has_country_flag = inward_perfect_flag
}
add_stability = 0.5
}
25 = {
add_manpower = 10000
}
20 = {
add_war_support = 0.5
}
my_variable = { # Taking "my_variable" as the variable's name, both "var:my_variable" and "my_variable" are valid options, left up to the developer's preference.
army_experience = 100
}
}
若设置了国家标记 inward_perfect_flag,它会将上述 30 的概率乘以 1.3 得到 39。同时,my_variable 将取相应临时变量的值或当前作用域的变量作为该选项的权重。
请注意,如果你想创建一个包含随机列表的可重复决议,默认情况下同一决议在游戏中每次被触发时都会选取相同的随机结果。你可以通过在决议块中包含以下行来反转此行为:
fixed_random_seed = no
这仅用于决议。在其他地方,随机种子默认是不固定的,因此无需把此参数设为 "no"。
提示框操作
The "tooltip" in this case refers to the text shown to the player in-game that explains what the effect block changes within the game, such as "+50
政治点数".
在效果块内有 3 种编辑提示框的方式:
hidden_effect = { ... }用于把其中的效果从提示框中隐藏,使其执行不会向玩家显示。effect_tooltip = { ... }则用于把效果放入提示框中而不实际执行它们。custom_effect_tooltip = my_localisation_keyis used in order to put an arbitrary paragraph of text as an effect that will get executed.
例如,这个示例 焦点的完成奖励 同时使用了全部三种:
completion_reward = {
hidden_effect = {
every_subject_country = { country_event = my_event.1 }
}
custom_effect_tooltip = send_event_to_subjects_tt
effect_tooltip = {
add_political_power = 100
}
custom_effect_tooltip = reject_war_tt
}
在此情况下,send_event_to_subjects_tt 和 reject_war_tt 是在任意以 UTF-8-BOM 编码的 /Hearts of Iron IV/localisation/english/*_l_english.yml 文件中定义的本地化键,假定语言为英语。
send_event_to_subjects_tt: "Sends a demand to our every subject.\nIf they agree, we get the following for each subject:" reject_war_tt: "If they reject the demand, we gain a wargoal against them."
在游戏中,这会显示为:
效果:
向我们每个附属国发送一项要求。若他们同意,我们每个附属国都会获得以下内容:政治点数:+100 若他们拒绝该要求,我们将获得针对他们的战争目标。 |
值得注意的是,触发国家事件的效果会从提示框中隐藏。完成该焦点后,唯一发生的事情是每个附属国都会收到一个 ID 为 my_event.1 的事件,该国不会立即获得 100 政治点数。
元效果
元效果允许你把非动态效果(不接受修正、只能使用静态标记或常量值的效果)当作接受变量来使用。
add_equipment_to_stockpile = {
type = infantry_equipment_2
amount = eq_amount
}
在上面显示的效果中,添加的装备数量是动态的,可以使用变量 "eq_amount" 设置。然而,此效果不允许你把变量用作装备类型。你不能把 "infantry_equipment_2" 存入变量并在此处使用。
However, meta effects will let you use variables and scripted localization within them to build effects as if they were texts and run them. Let's make previous effect accept equipment type and equipment level as variables stored in "eq_type" and "eq_level".
set_variable = { eq_type = 1 } # Sets the equipment type to "1", which determines the equipment given using scripted localisation, included below
set_variable = { eq_amount = 10 } # Sets the amount of equipment given to 10
set_variable = { eq_level = 2 } # Sets the equipment level to 2, which is used directly in the meta effect, no scripted localisation required
meta_effect = { # The actual meta effect. This can go anywhere you need it: in a decision, in a scripted effect, in a scripted GUI click effect, etc...
text = {
add_equipment_to_stockpile = {
type = [EQ_TYPE]_[EQ_LEVEL]
amount = eq_amount
}
}
EQ_LEVEL = "[?eq_level|.0]" # Gets the "eq_level" variable and saves it as "EQ_LEVEL" for the meta effect to use
EQ_TYPE = "[This.GetEquipmentName]" # Gets the equipment type from scripted localisation, included below, based on the "eq_type" variable, and saves it as "EQ_TYPE" for the meta effect to use
}
# The scripted localization for the "eq_type" variable, which goes in a scripted localisation file
defined_text = { # Since the "eq_type" variable in this example is equal to 1, the equipment given by the effect is "artillery_equipment"
name = GetEquipmentName
text = {
trigger = {
check_variable = { eq_type = 0 }
}
localization_key = "infantry_equipment"
}
text = {
trigger = {
check_variable = { eq_type = 1 }
}
localization_key = "artillery_equipment"
}
}
如你所见,我们创建了一个接受两个参数的 meta_effect。这些参数将用于替换元效果内部的 [EQ_TYPE] 和 [EQ_LEVEL]。EQ_LEVEL 将被替换为 [?eq_level|.0],即 eq_level 的整数值(在此情况下 2.000 变为 2)。EQ_TYPE 稍复杂一些,它被替换为一段脚本本地化。该脚本本地化会检查 eq_type 变量,并根据其值返回装备的键标记。若为 0,将返回 "infantry_equipment"。若为 1,将返回 "artillery_equipment"。
因此最终结果是 [EQ_TYPE] 被替换为 "artillery_equipment",[EQ_LEVEL] 被替换为 "2",最终我们的效果将被构建为:
add_equipment_to_stockpile = {
type = artillery_equipment_2
amount = eq_amount
}
这将给予你 10 个 artillery_equipment_2。
可以向元效果添加 debug = yes。这将在效果执行时把最终效果打印到 game.log,使调试更容易。
脚本化效果
脚本效果的作用与函数类似,它们可以在 /Hearts of Iron IV/common/scripted_effects/*.txt 中定义,然后在其他地方作为简写形式使用。脚本效果永远不会自行运行 并且需要在其他地方作为效果使用才能执行。此外,游戏允许创建自定义控制台指令,它们也是脚本效果。
脚本效果的定义很简单,就是
scripted_effect_name = {
<effects>
}此示例可以在常规代码中作为 scripted_effect_name = yes 效果使用。
脚本效果可以在控制台中通过输入 e scripted_effect_name 来访问并运行。
要创建自定义控制台指令,脚本效果名称应以 d_ 开头。控制台指令本身不包含 d_,因此 d_test_command 在控制台中将作为 test_command 运行。在自定义控制台指令中,运行该指令的国家为 FROM,而 ROOT 为选定的国家、州或人物。在控制台指令之后输入的、以空格分隔的内容(如 test_command 123 321 GER)会被添加到 'args' 临时数组中。以下是一个脚本效果示例,它会把作为参数输入的每个州转交给运行该控制台指令的国家
d_transfer_states = {
for_each_scope_loop = {
array = args
FROM = {
transfer_state = PREV
}
}
}像 transfer_states 123 321 这样使用
实用的脚本效果
这些脚本效果在基础游戏中定义,保留在模组中可能有助于减少代码量。作为脚本效果,它们全都使用布尔值作为参数。
| 名称 | Scope | 示例 | 描述 | 备注 |
|---|---|---|---|---|
| instantiate_collaboration_government | 国家 | instantiate_collaboration_government = yes |
创建一个合作政府,以当前作用域为宗主国。 | 合作政府的目存储于 country_to_initiate 临时变量中。 |
| add_potential_special_forces_tree | 国家 | add_potential_special_forces_tree = yes |
添加 1 个特种部队分支专精 | |
| upgrade_economy_law | 国家 | upgrade_economy_law = yes |
把经济法令向全面动员方向切换一级。 | 若已处于全面动员,则增加 150 |
| gain_random_agency_upgrade | 国家 | gain_random_agency_upgrade = yes |
随机授予一项可用的情报机构升级。 | 仅当情报机构不存在时才会创建一个。 |
| add_ruling_to_dem | 国家 | add_ruling_to_dem = yes |
执政党的全部支持率都会被加到 |
若添加新的意识形态,需要手动调整。另见:add_ruling_to_fas、add_ruling_to_com、add_ruling_to_neu |
| remove_any_country_role_from_character | 角色 | remove_any_country_role_from_character = yes |
从当前作用域移除所有顾问角色。 | 若添加新的槽位,需要手动调整。 |
| increase_state_category | 州 | increase_state_category = yes |
把州类别更改为下一个拥有更多建筑槽位的类别。 | 对小岛屿、特大城市或 large_city(密集城区)没有效果。city(城区)会直接升级为都会,跳过 large_city。 |
| lerp | Any | lerp = yes |
创建 lerp_result 常规变量,使用 结果 := a + ( b - a ) · x |
a、b 和 : x 存储为 lerp_a、lerp_b、lerp_x 临时变量。: x 被限制在 0 到 1 之间。 |
| store_core_states_on_game_start | 国家 | store_core_states_on_game_start = yes |
把当前作用域的当前核心州存储到 ROOT 作用域中的一个数组里。 | 创建的数组将命名为 core_states_at_game_start。意图仅在 country history 中调用一次。 |
| 文档 | 效果 • 触发器 • 定义文件 • 修正项 • 修正项列表 • 作用域 • 本地化文件 • 事件钩子 • 数据结构(标记、事件目标、国家标签别名、变量、数组) |
| 脚本 | 成就 • AI • AI 焦点 • 自治领 • 力量均势 • 书签/剧本 (游戏规则) • 建筑 • 角色与特质 • 外观标签 • 国家 • 师 • 决议 • 学说 • 装备 • 事件 • 阵营 • 理念 • 意识形态 • 军事工业组织 • 国策 • 资源 • 脚本化 GUI • 科技与学说 • 单位 |
| 地图 | 地图 • 州 • 补给区域 • 战略区域 |
| 图形 | 界面 • 图形资源 • 实体 • 后期特效 • 粒子 • 字体 |
| 外观 | 肖像 • 名称列表 • 音乐 • 音效 |
| 其他 | 控制台指令 • 疑难排查 • 模组结构 • 模组 • 地图编辑器 |