指令

您所在的位置:网站首页 钢铁雄心4控制台快速宣战全世界 指令

指令

2024-05-04 16:10| 来源: 网络整理| 查看: 265

效果Effects),也叫指令Commands),用于在特定作用域内动态地影响游戏。

效果(也称为命令)用于从特定作用域内动态效果游戏。它们是对游戏当前状态的一次性更改,没有产生持久效果的能力。相反,修正用于对游戏的条件产生连续的、永恒的效果,可以用数字表示。效果块不能用于直接应用修正,但是它们可以添加可以应用修正的内容,最常见的是add_ideas。

效果在整个游戏中用于多种作用域,最常见的是国策、事件和决议。

请注意,某些效果可能会从变量中获取值,即 这在效果参数中由表示。有关变量效应的信息,有关变量效果的信息,参见变量

注意某些效果可能会需要变量的值,例如:

add_manpower = var:my_var.

这在效果的参数中用变量的值表示。

效果列表可能已过时。完整但未排序的效果列表可以在/Hearts of Iron IV/documentation/effects_documentation.html 或/Hearts of Iron IV/document/effects_documentation.md中找到。

目录 1 作用域 2 在博斯普鲁斯之战DLC中添加的新效果 3 在抵抗组织DLC(La Resistance)中添加的新效果(Effect) 4 在炮手就位DLC(Man the Guns)添加的新效果(Effect) 5 任意作用域 5.1 全局 5.2 边境冲突 6 国家作用域 6.1 整体 6.2 地区 6.3 政治力量 6.4 政治 6.5 外交 6.6 附属国 6.7 战争 6.8 资源 6.9 建筑 6.10 国策 6.11 决议 6.12 任务 6.13 科技 6.14 民族精神/内阁 6.15 单位 6.16 装备 6.17 陆军 6.18 海军 6.19 空军 6.20 AI 7 地区作用域 7.1 整体 7.2 建筑 8 部队将领作用域 8.1 整体 8.2 战斗 9 Flow Control 9.1 If, Else If and Else 9.2 隐藏效果 9.3 Random List 9.4 Effect Tooltip 作用域

这些不用作效果,而是作为作用域,用于更改正在为其执行效果的对象。

效果作用域 名称 用法 目标类型 例子 描述 添加的版本 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

    …                  #运行的效果

}

对满足限制并具有指定原始标签的每个国家/地区执行包含的效果。 1.9 random_country_with_original_tag 始终可用 国家 random_country_with_original_tag = {

    original_tag_to_check = TAG  #required

    …                  #运行的效果

}

对满足限制并具有指定原始标签的随机国家/地区执行包含的效果。 1.9 every_neighbor_country 仅在国家作用域内 国家 every_neighbor_country = { … } 对满足限制并与所包含的国家/地区接壤的每个国家/地区执行包含效果。 1.0 random_neighbor_country 仅在国家作用域内 国家 random_neighbor_country = { … } 对符合限制并与包含该国家/地区接壤的随机国家/地区执行包含效果。 1.0 every_occupied_country 仅在国家作用域内 国家 every_occupied_country = { … } 对达到限制的每个国家/地区执行包含效果,并且其任何核心状态都由该限制所在的国家/地区控制。 1.0 random_occupied_country 仅在国家作用域内 国家 random_occupied_country = { … } 对满足限制的随机国家/地区执行包含效果,并且其任何核心状态都由该国家/地区控制。 1.0 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_state 始终可用 state every_state = { … } 对满足限制的每个state执行包含的效果。 1.0 random_state 始终可用 state random_state = {

    limit = { 123 321 } #可选

    …    #运行的效果

}

对满足限制的随机state执行包含的效果。 1.0 every_neighbor_state 仅在state作用域内 state every_neighbor_state = { … } 对满足限制的每个state执行包含的效果,并与包含该限制的状态相邻。 1.0 random_neighbor_state 仅在state作用域内 state random_neighbor_state = { … } 对满足限制的随机state执行包含效果,并与该状态所包含的状态相邻。不支持优先级排序。 1.0 every_owned_state 仅在国家作用域内 state every_owned_state = { … } 对满足限制且归其所在国家/地区所有的每个state执行包含效果。 1.0 random_owned_state 仅在国家作用域内 state random_owned_state = {

    limit = { 123 321 } #可选

    …    #运行的效果

}

对满足限制的随机state执行包含效果,并且该状态归其中包含该状态的国家/地区所有。 1.0 every_core_state 仅在国家作用域内 state every_core_state = { … } 对满足限制的每个state执行包含效果,并且是其中包含的国家/地区的核心。 1.11 random_core_state 仅在国家作用域内 state random_core_state = {

    limit = { 123 321 } #可选

    …    #运行的效果

}

对满足限制的随机state执行包含的效果,并且是包含该状态的国家/地区的核心。 1.11 every_controlled_state 仅在国家作用域内 state every_controlled_state = { … } 对满足限制的每个state执行包含效果,并受其包含的国家/地区控制。 1.9 random_controlled_state 仅在国家作用域内 state random_controlled_state = {

    limit = { 123 321 } #可选

    …    #运行的效果

}

对满足限制的随机state执行包含效果,并由其中包含该状态的国家/地区控制。   1.9 random_owned_controlled_state 仅在国家作用域内 state random_owned_controlled_state = {

    limit = { 123 321 } #可选

    …    #运行的效果

}

对满足限制的随机state执行包含效果,并且由其中包含该状态的国家/地区拥有和控制。   1.9 every_unit_leader 仅在国家作用域内 人物 every_unit_leader = { … } 对每个符合限制的将领人(元帅、元帅、海军上将)执行包含效果,并由其中包含的国家招募。 1.5 random_unit_leader 仅在国家作用域内 人物 random_unit_leader = { … } 对符合限制的随机将领人(元帅、陆军元帅、海军上将)执行包含效果,并由其中包含的国家 1.5 every_army_leader 仅在国家作用域内 人物 every_army_leader = { ... } 对每个达到限制的军队领导人执行包含效果,并由其中包含的国家招募。 1.5 random_army_leader 仅在国家作用域内 人物 random_army_leader = { … } 对达到限制的随机军队首领执行包含效果,并被包含该国家/地区招募。 1.5 global_every_army_leader 始终可用 人物 global_every_army_leader = { … } 对每个达到限制的军队首领执行包含效果。最好使用every_army_leader除非有必要使用global_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 仅在state作用域内 师旅 every_state_division = { … } 对满足限制且位于当前状态中的每个部队执行包含的效果。 1.12 random_state_division 仅在state作用域内 师旅 random_state_division = { … } 对满足限制且位于当前状态内的随机部队执行包含的效果。 1.12 在博斯普鲁斯之战DLC中添加的新效果 名字 参数 示例 描述 注释 添加

版本

add_victory_points 给一个省份增加胜利点 add_victory_points = { province = (省份id) value = (数量) } 给一个省份增加胜利点 接受负值 1.10 set_victory_points 设置一个省份的胜利点 set_victory_points = { province = (省份id) value = (数量) } 设置一个省份的胜利点 接受负值 1.10 在抵抗组织DLC(La Resistance)中添加的新效果(Effect) 名字 参数 示例 描述 注释 添加

版本

create_intelligence_agency 可以自动建立一个情报机构 create_intelligence_agency = yes 建立一个情报机构   1.9 upgrade_intelligence_agency 可以自动解锁一项情报机构升级 upgrade_intelligence_agency = upgrade_form_department upgrade_intelligence_agency = 解锁一项情报机构升级 情报机构升级项目可以在目录 common/intelligence_agency_upgrades 中被找到 1.9 kill_ideology_leader 可以杀死一个属于一个准确的意识形态的国家领导人 kill_ideology_leader = communism kill_ideology_leader = (democratic,facism,communism) 杀死当前作用域的指定意识形态领导人   1.9 transfer_units_fraction 可以精确地将一个国家的一部分军队和装备转移到任何国家。 transfer_units_fraction= {    target = SPD(SPD是一个国家的标识tag)     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    } } 将一定的装备、海军、空军和陆军按照特定的比例转移到一个国家。 军队将领可以使用 keep_unit_leaders_trigger = {保留 1.9 在炮手就位DLC(Man the Guns)添加的新效果(Effect) 名字 参数 示例 描述 注释 添加

版本

remove_decision 可以在不使用 remove_effect 语句下移除特定的决议 remove_decision = GER_MEPO 移除一项决议   1.6 swap_ruler_traits 与 swap_ideas 类似. 移除一个技能/特质(trait)然后添加另外一个.(trait指的是国家领导人身上的技能) swap_ruler_traits = { remove = add = } 更换技能   1.6

remove_exile_tag

移除一个军队将领的流亡标识(tag), 让他不再被判定为流亡将领 remove_exile_tag = { USA = "Arturo Rawson" } 移除一个Leader的流亡标识   1.6 add_legitimacy 给一个流亡政府增加政权合法性 add_legitimacy = 10 增加政权合法性   1.6

set_legitimacy

设定流亡政府政权合法性 set_legitimacy= { POL = 1.0 } 设定政权合法性   1.6 become_exiled_in 使一个国家成为一个在既定国家的流亡政府,具有既定的合法性。 become_exiled_in = { target = legitimacy = (预设的合法性) } 创建一个流亡政府 必须在 ROOT(不懂参见作用域)下使用, 需要成为流亡政府的国家,或者一个特定的tag 1.6 end_exile 结束流亡政府 end_exile 结束流亡政府   1.6 add_province_modifier 增加省份修正 add_province_modifier = { 5246 = mud } 增加一个省份修正(天气) 新的省份修正可以在"weather.txt"文件中创建. 1.6 remove_province_modifier 移除一个省份修正(天气) remove_province_modifier = { 5246 = mud } 移除一个省份修正 新的省份修正可以在"weather.txt"文件中创建. 1.6 set_faction_name 设置阵营名字(本地化名字,即需要本地化(localize),写入本地化文件) set_faction_name = SOME_LOC_KEY 改变阵营名字   1.6 add_nuclear_bombs 给一个特定国家增加指定数量的核弹 add_nuclear_bombs = 100 给一个特定国家增加指定数量的核弹 需要事先研究核弹科技 1.6 launch_nuke 核爆一个特定省份

launch_nuke = {    province = 42     state = 42    controller = GER     use_nuke = yes }

核爆一个省份

当仅提供地区参数的时候,敌人占领的省份优先核平

需要核弹科技和核弹库存,使用的时候从库存里面删除一个核弹 1.6 inherit_technology 转移一个国家的所有科技到另外一个国家 inherit_technology = CAN 转移科技 在内战的时候很有用. 作用域国家会继承Tag标识国家的所有科技,所以要小心作用域的问题 1.6 set_fuel_ratio 设定一个国家的燃油存量(倍数) set_fuel_ratio 设置国家目前的燃料比。   1.6 add_mines 为当前国家在一个战略区域布雷 add_mines = { region = 42 amount = 100 } 在一个战略区域布雷  

1.6

give_resource_rights 给予资源使用权 give_resource_rights = { receiver = ENG state = 291 } 把一个省份的所有资源给予目标国家使用 参见 04_mtg_on_actions 1.6 remove_resource_rights 剥夺资源使用权 ENG = { remove_resource_rights = 477 } 剥夺先前给予的资源使用权   1.6 任意作用域

能在“国家”、“省份”或者“将领”这些作用域使用

全局 这部分内容可能已不适合当前版本,最后更新于1.5。 名字 参数 示例 描述 注释 添加

版本

set_global_flag 用于标识全局标志的唯一字符串 set_global_flag = my_flag 定义一个全球Flag 1.0 clr_global_flag 要清除的全局标志的唯一字符串 clr_global_flag = my_flag 清除一个全球Flag 1.0 modify_global_flag flag = The global flag to modify.

value = The value to set it to: 0 or 1

modify_global_flag = { flag = my_flag value = 1 } 修改一个全球Flag 推荐使用 变量 1.0 custom_effect_tooltip 作为提示文字的本地化文本 custom_effect_tooltip = my_tooltip_tt 在效果提示文字内显示本地化文本 1.0 log 显示在game.log里的文本 log = "myVariable: [?myVariable]" 当运行指令时将这行文本写入game.log 允许所有的本地化命令 (比如[Root.GetName]等) 1.5 save_event_target_as 用于标识事件目标的唯一字符串 capital_scope = { save_event_target_as = my_state } 将当前范围另存为键。一旦执行结束(即事件结束)就会被清除。 Use event_target: to access the scope.Do not use in Scripted GUIs. 1.0 save_global_event_target_as 用于标识全局事件目标的唯一字符串 random_other_country = { save_global_event_target_as = my_country } 将当前范围另存为键。执行后持续存在,直到通过生效清除。 Use event_target: to access the scope.Do not use in Scripted GUIs. 1.0 clear_global_event_target 要清除的全局事件目标的唯一字符串 clear_global_event_target = my_country 清除特定的全局事件目标。 1.0 clear_global_event_targets yesBoolean. clear_global_event_targets = yes 清除所有全局事件目标。 1.0 break None break 停止执行当前作用域内的指令 1.0 sound_effect 要播放的音频名字,要事先定义在sound.asset和soundeffects.asset中 sound_effect = "boom" 播放一段音效 不能被作用域限制,一旦播放,其他国家也能听到(偶然发现的,版本1.8.1,单人模式) 1.0 randomize_weather 一个随机数种子(整数) randomize_weather = 12345 以特定的随机数种子随机生成天气 1.0 set_province_name id = 要重命名的胜利点ID

name = 胜利点所要改成的名字

set_province_name = { id = 325 name = "Funland" } 把某个胜利点的名字改为特定名字 1.3 reset_province_name 要复位的胜利点名字 reset_province_name = 325 重设特定胜利点的名字 1.3 goto_province 要移动到的地块 goto_province = 325 把视角移到特定地块 1.0 goto_state / 要移动到的省份 goto_state = 1 goto_state = var:some_state 把视角移到特定省份 1.0 change_tag_from / 要切换到的国家. GER = { change_tag_from = ROOT } GER = { change_tag_from = var:from.country } 从当前国家切换到目标国家游玩 注意:等号后面的是当前国家,指令前的作用域为目标国家 1.0 add_region_efficiency 1.5 边境冲突 Name Parameters Examples Description Notes Version Added start_border_war(发起边境冲突) change_state_after_war = 在边境冲突结束后,该省份是否易手进攻方作用域 state = / 发起边境冲突的省份 . num_provinces = 指定进攻方投入当前省份下的多少地块的部队发起边境冲突 . on_win = 进攻方胜利所触发的事件 . on_lose = 进攻方失败所触发的事件 . on_cancel= 进攻方与对方陷入僵持时所触发的事件 防守方作用域 state = / 因边境冲突而受到攻击的省份. num_provinces = 指定防守方投入当前省份下的多少地块的部队发起边境冲突. on_win = 防守方胜利所触发的事件 on_lose = 防守方失败所触发的事件. on_cancel= 防守方与对方陷入僵持时所触发的事件 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 } 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 = / 攻击方发起进攻的省份

defender = / 防守方进行防御的省份 attacker_modifier = / 应用于进攻方军队的修正 defender_modifier = / 应用于防守方军队的修正 combat_width = / 边境冲突的战场宽度

set_border_war_data = { attacker = 527 defender = 408 defender_modifier = 0.15 combat_width = 100 } 设置双方的攻守加成或惩罚修正,在发起边境冲突后使用。   1.5 cancel_border_war attacker = / 攻击方发起进攻的省份

defender = / 防守方进行防御的省份 dont_fire_events = 不触发start_border_war中有关的事件

cancel_border_war = { dont_fire_events = yes defender = 408 attacker = 527 } 取消当前的边境冲突而且没有胜者   1.5 finalize_border_war attacker = / 攻击方发起进攻的省份

defender = / 防守方进行防御的省份 attacker_win = 让进攻方获胜 defender_win = 让防守方获胜

finalize_border_war = { attacker_win = yes attacker = 527 defender = 408 } 结束一场边境冲突   1.5 国家作用域

下列的指令必须在“国家”作用域使用

整体 Name Parameters Examples Description Notes Version Added set_country_flag An unique string to identify the country flag with. set_country_flag = my_flag 定义一个国家Flag   1.0 clr_country_flag The unique string of a country flag to clear. clr_country_flag = my_flag 清除一个国家Flag   1.0 modify_country_flag flag = 要修改的国家Flag

value = 要设置的值,只能是0或1

modify_country_flag = { flag = my_flag value = 1 } 修改一个国家Flag 推荐使用 变量 1.3 country_event id = 要触发的事件

days = / 在特定的天数内触发事件(可选) hours = / 在特定的小时内触发事件(可选) random = Adds a random number (between 0 and random, inclusive) of hours to the scheduled fire time. Optional.

country_event = { id = my_event.1 days = 10 random = 50 } 对特定国家触发事件 Where triggers do not need to be repeatedly checked random can be a performance light alternative to mean_time_to_happen for scheduling events. 1.0 news_event id = 要触发的新闻事件

days = / 在特定的天数内触发事件(可选) hours = / 在特定的天数内触发事件(可选) random = Adds a random number (between 0 and random, inclusive) of hours to the scheduled fire time. Optional.

news_event = { id = my_event.1 days = 10 random = 50 } 对特定国家触发新闻事件 新闻事件和普通事件所显示的界面不同

Where triggers do not need to be repeatedly checked random can be a performance light alternative to mean_time_to_happen for scheduling events.

1.0 set_cosmetic_tag(设置显示动态Tag) 设置一个动态Tag以更改旗帜、国名(注意:此代码无法改变国家初始tag,只会更改其显示) set_cosmetic_tag = SAF_SOV_communism Makes the current scope use the specified cosmetic tag, changing name and flag.   1.3 drop_cosmetic_tag Boolean. drop_cosmetic_tag = yes Makes the current scope drop the current cosmetic tag they are using.   1.3 set_rule Boolean. set_rule = { can_create_factions = yes } 为当前作用域应用特定的游戏规则 Possible rules: can_be_called_to_war can_boost_other_ideologies can_create_factions can_declare_war_on_same_ideology can_declare_war_without_wargoal_when_in_war can_decline_call_to_war can_force_government can_generate_female_aces can_guarantee_other_ideologies can_join_factions can_join_factions_not_allowed_diplomacy can_join_opposite_factions can_lower_tension can_not_declare_war can_occupy_non_war can_puppet can_send_volunteers can_only_justify_war_on_threat_country can_use_kamikaze_pilots units_deployed_to_overlord (subjects only) 1.0 add_dynamic_modifier modifier = The name of the Modifier.

scope =

#optional, specify if it is specified while adding the modifier

add_dynamic_modifier = { modifier = my_modifier } 添加dynamic modifier remove_dynamic_modifier modifier = The name of the Modifier.

scope =

#optional, specify if it is specified while adding the modifier

remove_dynamic_modifier = { modifier = my_modifier } 移除dynamic modifier force_update_dynamic_modifier Boolean. force_update_dynamic_modifier = yes 强制刷新dynamic modifier 地区 Name Parameters Examples Description Notes Version Added add_state_core / 添加省份核心 add_state_core = 345 为当前作用域添加省份核心   1.0 remove_state_core / 移除省份核心 remove_state_core = 345 移除当前作用域的省份核心   1.0 set_capital / 将指定省份设置为首都 set_capital = { state = 562 } 将特定的省份设置为当前作用域的首都   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 将当前作用域设置为省份的拥有者   1.0 set_state_controller / 设置省份的实际控制者 set_state_controller = 345 将当前作用域设置为省份的实际控制者   1.0 transfer_state / 改变省份的拥有者和实际控制者 transfer_state = 345 将当前作用域设置为省份的拥有者和实际控制者   1.0 set_province_controller 设置地块的实际控制者 set_province_controller = 2999 将当前作用域设置为地块的实际控制者(仅在战时可用)   1.0 政治力量 Name Parameters Examples Description Notes Version Added 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 / The amount to add. set_stability = 0.5 为当前作用域设定特定数量的稳定度 稳定度的值在0到1之间 1.5 add_war_support / The amount to add. add_war_support = 0.1 为当前作用域增加特定数量的战争支持度 战争支持度的值在0到1之间 1.5 set_war_support / The amount to set. set_war_support = 0.5 为当前作用域设定特定数量的战争支持度 战争支持度的值在0到1之间 1.5 add_command_power / The amount to add. add_command_power = 100 为当前作用域增加特定数量的指挥点数   1.5 政治 Name Parameters Examples Description Notes Version Added kill_ideology_leader 意识形态 kill_ideology_leader = communism 杀死当前作用域下特定意识形态的领袖   1.9 retire_ideology_leader 意识形态 retire_ideology_leader = fascism 移除当前作用域下特定意识形态的领袖并使其退休   1.9 kill_country_leader Boolean. kill_country_leader = yes 杀死当前作用域的国家元首   1.0 retire_country_leader Boolean. retire_country_leader = yes 移除当前作用域的国家元首并使其退休   1.0 set_country_leader_ideology The government to set. set_country_leader_ideology = socialism 改变国家元首所属的党派(实际上是更改意识形态)   1.0 add_country_leader_trait The trait to add. add_country_leader_trait = nationalist_symbol 为当前作用域的国家元首添加特性 特性参见 /Hearts of Iron IV/common/country_leader/*.txt. 1.0 remove_country_leader_trait The trait to remove. remove_country_leader_trait = nationalist_symbol 移除当前作用域的国家元首的特性 特性参见 /Hearts of Iron IV/common/country_leader/*.txt. 1.0 hold_election The country to hold an election for. hold_election = ROOT 为当前作用域执行在on_new_term_election内的事件(在On Actions文件里)   1.0 add_popularity(更改支持率) ideology = 指定需更改支持率的党派意识形态

popularity = / 该党派支持率变更的具体数值

add_popularity = { ideology = fascism popularity = -0.5 } 在当前作用域里修改党派的支持率 Values used are 0 to 1. 1.0 set_politics ruling_party = The party to set.

elections_allowed = Whether elections are allowed. Optional. last_election = When the last election was. Optional. election_frequency = How often in months an election occurs. Optional.

set_politics = { ruling_party = neutrality } 设置当前范围的政党设置  

Previously included the "parties" parameter, which has been deprecated by the "set_popularities" command. The "parties" parameter no longer works as of version 1.7

1.0 (Updated 1.7) _drift(每日增长多少支持率) _drift = / 意识形态支持度每日增长 fascism_drift = 0.01 在当前作用域里每日修改的党派支持度 1.0 set_politics ruling_party = The party to set.

elections_allowed = Whether elections are allowed. Optional. last_election = When the last election was. Optional. election_frequency = How often in months an election occurs. Optional.

set_politics = { ruling_party = neutrality } 设置当前范围的政党设置  

以前包含“parties”参数,该参数已被“set_popularities”命令弃用。从版本 1.7 开始,“parties”参数不再有效

1.0 (Updated 1.7) set_popularities = / The popularity to set. set_popularities = { democratic = 50 neutrality = 15 fascism = 30 communism = 5 } 设置当前范围的政党受欢迎程度  

人气加起来必须达到 100,否则该命令将无效

1.7 set_political_party ideology = The party to change.

popularity = The amount of popularity to set.

set_political_party = { ideology = fascism popularity = 50 } 设置当前范围内指定政党的受欢迎程度   1.0 set_party_name(设置党派名称) ideology = 指定更改名称的党派

long_name = 指定党派更改名称的全名 name = 指定党派更改名称的简称

set_party_name = { ideology = neutrality long_name = GER_neutrality_party_kaiserreich_long name = GER_neutrality_party_kaiserreich } 更改当前范围的指定政党的名称   1.0 create_country_leader name = The name of the leader.

desc = The description of the leader. picture = The graphical reference to the leader portrait. expire = When the leader dies in history. ideology = The ideology government the leader belongs to. Traits scope The trait to add. Can add multiple.

create_country_leader = { name = "Mohammed Zahir Shah" desc = "POLITICS_MOHAMMED_ZAHIR_SHAH_DESC" picture = "Portrait_Afghanistan_Mohammed_Zahir_Shah.dds" expire = "1965.1.1" ideology = despotism traits = { } }   纵向字符串可以包含完整路径(即 gfx/leaders/my_folder/custom_pic.dds)或仅包含图像的名称(即 custom_pic.dds)

仅使用名称时,图像必须位于与当前范围的标记匹配的文件夹中,例如/Hearts of Iron IV/gfx/leaders/GER/custom_pic.dds.

1.0 外交 Name Parameters Examples Description Notes Version Added set_major 布尔值 set_major = yes 使当前作用域成为主要国家   1.0 create_faction 派系名称。 create_faction = MY_FACTION_NAME 创建一个在当前作用域的有指定名称的派系(MY_FACTION_NAME)。该作用域范围内及其附属国将自动加入派系。   1.0 add_to_faction 国家tag标签。 FACTION_LEADER_TAG = { add_to_faction = TAG_TO_ADD }FACITON_LEADER_TAG(派系领导者的国家tag标签)

TAG_TO_ADD(需要加入该派系的国家tag标签)

将特定国家(TAG_TO_ADD)加入该派系领导人(FACTION_LEADER_TAG)领导的的派系。   1.0 leave_faction Boolean. leave_faction = yes 离开当前派系   1.5 remove_from_faction 派系的名称 remove_from_faction = MY_FACTION_NAME 从指定派系中删除当前范围   1.0 dismantle_faction Boolean. dismantle_faction = yes 拆除当前范围的派系   1.0 puppet 被傀儡国家 puppet = GER 傀儡某个国家   1.0 end_puppet The target country. end_puppet = GER 删除目标和当前范围之间的傀儡状态   1.0 release The target country. release = GER 将指定的主题或仅核心国家/地区发布为自由国家/地区   1.0 release_puppet The target country. release_puppet = GER 将指定的主题或仅核心国家/地区作为当前范围的傀儡发布   1.0 give_guarantee The target country. give_guarantee = GER 使当前范围保证指定国家/地区   1.0 give_military_access The target country. give_military_access = GER 使指定国家/地区授予当前范围的军事通行权   1.0 recall_attache The target country with an attache. recall_attache = GER 从指定国家/地区调用当前示波器的随员   1.5 diplomatic_relation country = The target country to alter the relationship with ROOT.

relation = The relation to change. active = Whether the relation is started or broken.

diplomatic_relation = { country = SOV relation = guarantee active = no } 用于定义当前范围和目标范围国家之间的外交关系 Possible relations: non_aggression_pact guarantee puppet military_access docking_rights 1.0 add_opinion_modifier target = The target country.

modifier = The opinion modifier to add.

add_opinion_modifier = { target = GER modifier = faction_traitor } 为当前范围 towards 指定范围添加指定的意见修饰符 Opinion modifiers are found in /Hearts of Iron IV/common/opinion_modifiers/*.txt. 1.0 remove_opinion_modifier target = The target country.

modifier = The opinion modifier to remove.

remove_opinion_modifier = { target = GER modifier = faction_traitor } 删除当前范围 towards 指定范围的指定意见修饰符 Opinion modifiers are found in /Hearts of Iron IV/common/opinion_modifiers/*.txt. 1.0 reverse_add_opinion_modifier target = The target country.

modifier = The opinion modifier to add.

reverse_add_opinion_modifier = { target = GER modifier = faction_traitor } 为当前作用域的指定范围 towards 添加指定的意见修饰符 意见修饰符位于/Hearts of Iron IV/common/opinion_modifiers/*.txt. 1.0 add_relation_modifier target = The target country.

modifier = The relation modifier to add.

add_relation_modifier = { target = SWE modifier = HUN_dynastic_ties_license } 为当前作用域 towards 添加指定的关系修饰符 关系修饰符位于/Hearts of Iron IV/common/modifiers/*.txt. 1.4 remove_relation_modifier target = The target country.

modifier = The relation modifier to remove.

remove_relation_modifier = { target = SWE modifier = HUN_dynastic_ties_license } 删除当前作用域 towards 指定作用域的指定关系修饰符 关系修饰符位于/Hearts of Iron IV/common/modifiers/*.txt. 1.4 附属国 Name Parameters Examples Description Notes Version Added add_autonomy_ratio value = The freedom score to add.

localization = The localization key for the modifier.

add_autonomy_ratio = { value = 0.1 localization = AST_adopt_westminster } 将自由度百分数比率修饰符添加到当前范围 用于主题 1.3 add_autonomy_score value = The freedom score to add.

localization = The localization key for the modifier.

add_autonomy_ratio = { value = 10 localization = EXAMPLE } 将精确的自由度百分数修饰符添加到当前范围 用于主题 1.3 set_autonomy target = / The subject country.

autonomy_state = The type of autonomy state to set. freedom_level = The new freedom level value. Optional.

set_autonomy = { target = AST autonomy_state = autonomy_free } 设置指定国家/地区的自治级别 自治状态位于/Hearts of Iron IV/common/autonomous_states/*.txt. 1.3 release_autonomy target = / The subject country.

autonomy_state = The type of autonomy state to set. freedom_level = The new freedom level value. Optional.

release_autonomy = { target = VIN autonomy_state = autonomy_puppet freedom_level = 0.5 } 释放国家/地区并设置指定国家/地区的自治级别 自治状态位于/Hearts of Iron IV/common/autonomous_states/*.txt. 1.3 战争 名字 Parameters 例子 描述 Notes Version Added add_threat 增加多少世界紧张度 add_threat = 10 增加全球紧张度   1.0 add_named_threat threat = The amount to change by.

name = The localization string.

add_named_threat = { threat = 5 name = GER_rhineland } 调整 World Tension 的级别,并在 World Tension 工具提示中添加一个条目   1.0 annex_country target = 被吞并的国家ID

transfer_troops = yes Whether to transfer the troops of the annexed country.

annex_country = { target = GER transfer_troops = yes } 让一个国家吞并另一个国家   1.0 add_to_war targeted_alliance = The country to assist.

enemy = The country attacking the ally. hostility_reason = Localization for the reason for joining. Optional.

add_to_war = { targeted_alliance = PREV enemy = HUN hostility_reason = asked_to_join } 将当前范围添加到其盟友与指定敌人的战争中   1.0 declare_war_on target = / 被攻击的国家ID

type = 此次战争的宣战借口

declare_war_on = { target = GER type = annex_everything } 让一个国家向另一个国家宣战,并且用其宣战借口宣战 宣战借口类型可以在 /Hearts of Iron IV/common/wargoals/*.txt中定义 1.0 white_peace / 被无条件和平的国家ID

相当于和平条约窗口上的提示

white_peace = GER white_peace = { tag = GER message = EXAMPLE } 让一个国家无条件和平   1.0 set_truce target = The scope to truce with.

days = The duration of the truce.

set_truce = { target = GER days = 90 } 使当前作用域休战与指定的作用域   1.0 create_wargoal(制造宣战借口) target = / 指定被制造宣战借口的国家

type = 指定制造的宣战借口类型,宣战借口类型在Hearts of Iron IV\common\wargoals\中(可通过该方式自定义宣战借口) generator = { } The states to supply the wargoal (i.e. take_state_focus).

create_wargoal = { type = puppet_wargoal_focus target = ROOT } 让一个国家获得对另一个国家的宣战借口   1.0 start_civil_war ideology = The ideology of the breakaway country.

ruling_party = The ruling party of the original country. Optional. size = The size of the breakaway country and the fraction of the original stockpile and military units it will receive. Optional. capital = The capital of the breakaway country. Optional. only_own_territory = Limits the breakaway country to only own territory. Optional. states = { } The states included in the breakway country. Optional. states_filter = { } Filters to apply to the state assignment for the breakaway country. Optional. keep_unit_leaders = { } Keep the specified leaders. Optional. keep_unit_leaders_trigger = { Keep the specified leaders that meet the triggers. Optional.

start_civil_war = { ruling_party = communism ideology = ROOT size = 0.8 only_own_territory = no capital = 282 states = { 282 533 536 555 529 530 528 } keep_unit_leaders = { 750 751 752 } } 使用指定参数为当前范围启动内战   1.0 资源 名字 参数 示例 描述 注释 添加

版本

add_resource type = 要添加的资源

amount = 要添加资源的数量 state = 要添加资源的地区。 可以使用变量

add_resource = { type = oil amount = 50 state = 88 } 在特定地区添加特定数量的特定资源   1.0 destroy_resource type = 要添加的资源

amount = 要添加资源的数量 state = 要添加资源的地区。 可以使用变量

destroy_resource = { type = oil amount = 50 state = 88 } 在特定地区摧毁特定数量的特定资源   1.9 create_import resource = The resource to import.

amount = The amount of resource to import. exporter = Which country exports the resource.

create_import = { resource = steel amount = 100 exporter = GER } 使用指定资源和从指定导出程序为当前范围创建导入   1.0 建筑 名字 参数 示例 描述 注释 添加

版本

add_offsite_building type = The building to add.

level = / The maximum level to add.

add_offsite_building = { type = arms_factory level = 1 } 为当前范围添加一个地图外建筑物,该建筑物在不处于状态的情况下产生其效果   1.5 modify_building_resources building = The building to modify.

resource = The resource to add. amount = The amount of resource to add.

modify_building_resources = { building = synthetic_refinery resource = oil amount = 1 } 修改当前范围的指定建筑物的资源输出   1.5 国策 名字 参数 示例 描述 注释 添加

版本

load_focus_tree 加载某个指定国策树.Alternatively, as an effect block:tree = keep_completed = yes/no load_focus_tree = china_communist_focusload_focus_tree = { tree = british_focus keep_completed = yes } 为当前范围加载新的国策树,并保留任何共享国策   1.5 unlock_national_focus The focus to unlock. unlock_national_focus = my_focus 绕过当前示波器的指定国策(标记为完成,而不触发国策complete_effect)   1.0 complete_national_focus The focus to complete. complete_national_focus = my_focus 完成当前作用域的指定国策   1.0 决议 名字 参数 示例 描述 注释 添加

版本

activate_decision The decision to activate. activate_decision = my_decision 激活当前作用域的指定决策,忽略决策的触发器 决策位于/Hearts of Iron IV/common/decisions/*.txt 1.0 activate_targeted_decision target = The country to target.

decision = The decision to activate.

activate_targeted_decision = { target = GER decision = my_decision } 为当前范围的指定目标激活指定的目标决策 决策位于/Hearts of Iron IV/common/decisions/*.txt 1.5 remove_targeted_decision The decision to remove. remove_targeted_decision = { target = FROM decision = my_decision } 删除当前作用域的指定目标决策 决策位于/Hearts of Iron IV/common/decisions/*.txt 1.5 unlock_decision_tooltip The decision to display. unlock_decision_tooltip = my_decision 在效果工具提示中显示指定决策的特殊工具提示 决策位于/Hearts of Iron IV/common/decisions/*.txt 1.5 unlock_decision_category_tooltip The decision category to display. unlock_decision_category_tooltip = my_category 在效果工具提示中显示指定决策类别的特殊工具提示 决策类别位于/Hearts of Iron IV/common/decisions/catergories/*.txt 1.5 任务 名字 参数 示例 描述 注释 添加

版本

activate_mission The mission to activate. activate_mission = my_mission Activates the specified mission for the current scope, ignoring any triggers for the decision. Missions are found in /Hearts of Iron IV/common/decisions/*.txt 1.5 activate_mission_tooltip The mission to display. activate_mission_tooltip = my_mission Displays a special tooltip for the specified mission in the effect tooltip. Missions are found in /Hearts of Iron IV/common/decisions/*.txt 1.5 remove_mission The mission to remove. remove_mission = my_mission Removes the specified mission for the current scope. Missions are found in /Hearts of Iron IV/common/decisions/*.txt 1.5 科技 名字 参数 示例 描述 注释 添加

版本

add_research_slot 要加多少个科研槽 add_research_slot = 1 让一个国家增加一定数量个科研槽   1.0 set_research_slots 设置的 set_research_slots = 4 Sets the number of research slots the current scope has.   1.0 add_tech_bonus bonus = The bonus to technology given.

uses = The amount of times the bonus can be used. ahead_reduction = The cost reduction if ahead of time. category = Which technology category the bonus applies to. Multiple can be defined. technology = Which technology the bonus applies to. Multiple can be defined.

add_tech_bonus = { bonus = 0.5 uses = 1 category = radar_tech } Grants a research bonus to the current scope with the specified parameters. Research bonus categories are found in Hearts of Iron IV/common/technology_tags/*.txt 1.0 set_technology = The technology to add.popup = no To not show the popup after adding technology set_technology = { suicide_craft = 1 } Grants the specified technology to the current scope. A value of 1 sets the technology. A value of 0 removes the technology, but if it is a researchable technology, the duration to research isn't reset, meaning it can be researched in 1 day. 1.0 add_to_tech_sharing_group The group to add the current scope to. add_to_tech_sharing_group = us_research Adds the current scope to the specified technology sharing group.   1.3 remove_from_tech_sharing_group The group to remove the current scope from. remove_from_tech_sharing_group = us_research Removes the current scope from the specified technology sharing group.   1.3 modify_tech_sharing_bonus id = The group to modify.

bonus = The new bonus.

modify_tech_sharing_bonus = { id = us_research bonus = 0.5 } Modifies the specified technology sharing group.   1.3 民族精神/内阁 名字 参数 示例 描述 注释 添加

版本

add_ideas 需添加的民族精神/内阁成员 add_ideas = my_idea add_ideas = { my_idea_1 my_idea_2 } 将指定民族精神添加到当前作用域。 可以在同效果内添加多个民族精神。 1.0 add_timed_idea idea = 需添加的民族精神

days = / 限时存在的天数

add_timed_idea = { idea = my_idea days = 180 } 在指定作用域添加限时民族精神。   1.0 modify_timed_idea idea = 需要修改的民族精神

days = / 需要添加的时间量(天数)

modify_timed_idea = { idea = my_idea days = 60 } 将限时民族精神的持续时间延长指定量。   1.0 swap_ideas add_idea = 需添加的民族精神

remove_idea = 需移除的民族精神

swap_ideas = { remove_idea = my_idea_1 add_idea = my_idea_2 } 在被添加和移除的民族精神之间显示效果的更改内容和差异。   1.3 remove_ideas 需移除的民族精神 remove_ideas = my_idea remove_ideas = { my_idea_1 my_idea_2 } 将指定民族精神移除出当前作用域。 可以在同效果内移除多个民族精神。. 1.0 remove_ideas_with_trait The trait to target. remove_ideas_with_trait = motorized_equipment_manufacturer Removes all ideas for the current scope that use the specified trait.   1.0 show_ideas_tooltip 需要展示的民族精神 show_ideas_tooltip = my_idea 在当前作用域中显示指定的民族精神,注意,这个效果并不添加民族精神。   1.0 单位 Name Parameters Examples Description Notes Version Added load_oob(生成单位) 引入生成单位的指定文件,并通过该文件生成单位(生成单位的指定文件应放置于history\units文件夹中) load_oob = "GER_default" Loads the specified OOB for the current scope, applying the effects within.   1.0 division_template name The name of the division. regiments = { = { x = 0 y = 0 } } support = { = { x = 0 y = 0 } }

The composition of the division.

division_template = { name = "Test" regiments = { infantry = { x = 0 y = 0 } infantry = { x = 0 y = 1 } infantry = { x = 0 y = 2 } infantry = { x = 0 y = 3 } } support = { military_police = { x = 0 y = 0 } } } Creates and adds the specified division template to the current scope. The x and y attributes represent the rows and columns in the division designer. 1.0 set_division_template_lock division_template = The name of the division template.

is_locked = Whether the division is locked or not.

set_division_template_lock = { division_template = "Infantry Division" is_locked = yes } Toggles the locked status on a division template for the current scope, which prevents editing or deletion.   1.5 delete_unit_template_and_units division_template = The name of the division template. delete_unit_template_and_units = { division_template = "Infantry Division" disband = yes #will refund equipment and manpower } Deletes the specified division template and all units using it for the current scope.   1.5 delete_unit state = The id number of the state. ENG = { delete_unit = { state = 787 disband = yes #will refund equipment and manpower }} Deletes all units within the specified state using the country scope.   1.5 装备 Name Parameters Examples Description Notes Version Added set_equipment_fraction / The fraction of equipment to remove. set_equipment_fraction = 0.5 Reduces the overall equipment stockpile by the specified fraction. This should not be used in civil wars to simulate stockpile splitting. start_civil_war now automatically divides stockpiles according to the respective size. 1.0 add_equipment_to_stockpile type = The equipment to add. Can be archetype.

amount = The amount to add. producer = Defines who produced the equipment. Optional.

add_equipment_to_stockpile = { type = infantry_equipment amount = 100 producer = GER } Adds the specified equipment to the current scope. Note that removal will only remove equipment with the same producer defined in the effect. 1.0 send_equipment type = The equipment to add. Can be archetype.

amount = / The amount to add. target = / Which country receives the equipment.

send_equipment = { equipment = infantry_equipment amount = 100 target = GER } Sends the specified amount of equipment to the specified target, removing said equipment from the current scope.   1.0 create_production_license target = Which country receives the license.

cost_factor = Modifies the production cost. Equipment scope type = The equipment the country is licensed to produce. Must be an non-archetype equipment.

create_production_license = { target = HUN equipment = { type = fighter_equipment_1 } cost_factor = 0 } Grants the specified country a licensed to produce the specified equipment from the current scope.   1.4 create_equipment_variant name = The name of the variant

type = The equipment the variant is of. parent_version = Ordering for multiple variants. Upgrade scope = The upgrades configuration for the variant.

create_equipment_variant = { name = "Montecuccoli Class" type = light_cruiser_1 upgrades = { ship_reliability_upgrade = 3 ship_engine_upgrade = 3 ship_gun_upgrade = 3 ship_anti_air_upgrade = 3 } } Creates the specified equipment variant for the current scope.   1.0 add_equipment_production amount = The amount to produce. Optional.

requested_factories = The number of factories to assigned initially. Optional. progress = The initial production progress. Optional. efficiency = The initial production efficiency. Optional. Equipment scope type = The name of the equipment to produce. creator = The country which is producing the equipment. Used if root scope isn't producer. Optional. version_name = The name of the variant to produce. Optional.

add_equipment_production = { equipment = { type = light_cruiser_2 } requested_factories = 1 progress = 0.95 amount = 1 } Starts a production line for the specified equipment for the current scope.   1.0 陆军 Name Parameters Examples Description Notes Version Added add_manpower / 要添加的数量。 add_manpower = 100000 add_manpower = var:my_var 将指定数量的人力添加到当前范围。   1.0 army_experience / 要添加的数量。 army_experience = 10 将指定数量的陆军经验添加到当前范围。   1.0 create_corps_commander name = The name of the leader.

picture = The graphical reference of the picture of the leader. skill = The skill of the leader. attack_skill = The attack skill of the leader. defense_skill = The defense skill of the leader. planning_skill = The planning skill of the leader. logistics_skill = The logistics skill of the leader. traits = { } The traits the leader spawns with. female = The gender of the leader.

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 } Creates a commander for the current scope with the specified attributes. Traits are found in /Hearts of Iron IV/common/unit_leader/*.txt. 1.0 create_field_marshal name = The name of the leader.

picture = The graphical reference of the picture of the leader. skill = The skill of the leader. attack_skill = The attack skill of the leader. defense_skill = The defense skill of the leader. planning_skill = The planning skill of the leader. logistics_skill = The logistics skill of the leader. traits = { } The traits the leader spawns with.

create_field_marshal = { name = "Maurice Gamelin" picture = "Portrait_France_Maurice_Gamelin.dds" traits = { defensive_doctrine } skill = 2 attack_skill = 1 defense_skill = 3 planning_skill = 2 logistics_skill = 1 } Creates a field marshal for the current scope with the specified attributes. Traits are found in /Hearts of Iron IV/common/unit_leader/*.txt. 1.0 海军 Name Parameters Examples Description Notes Version Added navy_experience / The amount to add. navy_experience = 10 Adds the specified amount of navy experience to the current scope.   1.0 destroy_ships type = The type of ship to destroy.

count = or all The amount to destroy.

destroy_ships = { type = destroyer count = all } Destroys the specified type and amount of ships controlled by the current scope.   1.5 transfer_navy target = The target country. transfer_navy = { target = GER } Transfers the current scope navy to the specified country.   1.5 transfer_ship type = The type of ship to transfer. 5 (only build province buildings on province with VP over 5 ) limit_to_victory_point = yes (only build province buildings on province with VP) 1.0 set_building_level type = The building to add.

level = / The level to set the building to. instant_build = Defines whether the buildings are instantly built. province = Defines the exact province to add provincal buildings in. Can be used as a scope. Province scope all_provinces = Affect all provinces. Used in the province scope. limit_to_coastal = Affect coastal provinces. Used in the province scope. limit_to_naval_base = Affect naval base provinces. Used in the province scope. limit_to_border = Affect border provinces. Used in the province scope. level = Affect only provinces with buildings level below, at or above the specified level. Used in the province scope. id = Affect the specified province. Used in the province scope.

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 } } Sets the specified building to the current state (or provinces within the state). The province scope is used for provincal level buildings. You can limit the construction to victory points using : limit_to_victory_point > 5 (only build province buildings on province with VP over 5 ) limit_to_victory_point = yes (only build province buildings on province with VP) 1.4 damage_building type = The building to damage.

damage = The amount of damage to inflict. province = The province to target for provincal buildings.

damage_building = { type = infrastructure damage = 1 } Damages the specified building in the current state. The health of buildings is determined by the value attribute in a building's definition. This is multiplied by their level to get their total health. 1.3 remove_building type = The building to remove.

level = / The levels to remove.

remove_building = { type = arms_factory level = 5 } Removes the specified building in the current state. For shared buildings level determines the amount, whereas for the others it is the actual level.   1.0 add_extra_state_shared_building_slots / The amount of slots to add or remove. add_extra_state_shared_building_slots = 2 Adjusts the number of shared building slots for the current state.   1.0 部队将领作用域

The effects here must be used within a unit leader scope.

整体 Name Parameters Examples Description Notes Version Added unit_leader_event id = The event to fire.

days = / Fires the event in the specified number of days. Optional. hours = / Fires the event in the specified number of hours. Optional. random = Adds a random number (between 0 and random, inclusive) of hours to the scheduled fire time. Optional.

unit_leader_event = { id = my_event.1 days = 10 random = 50 } Fires the specified event for the owner of the current unit leader. Uses a special interface displaying the current unit leader portrait.

Where triggers do not need to be repeatedly checked random can be a performance light alternative to mean_time_to_happen for scheduling events.

1.5 set_unit_leader_flag An unique string to identify the unit leader flag with. set_unit_leader_flag = my_flag Defines a unit leader flag.   1.5 clr_unit_leader_flag The unique string of a unit leader flag to clear. clr_unit_leader_flag = my_flag Clears a defined unit leader flag.   1.5 modify_unit_leader_flag flag = The unit leader flag to modify.

value = The value to set it to: 0 or 1

modify_unit_leader_flag = { flag = my_flag value = 1 } Modifies a unit leader flag.   1.5 promote_leader Boolean promote_leader = yes Promotes the current unit leader to Field Marshal (if Commander.   1.5 demote_leader Boolean demote_leader = yes Demotes the current unit leader to Commander (if Field Marshal).   1.5 retire Boolean> retire = yes Retires the current unit leader (removing them).   1.5 remove_unit_leader The id of the unit leader. remove_unit_leader = 70 Removes the specified unit leader by their id.   1.0 set_nationality / The target country. set_nationality = GER Switches the current unit leader to the specified country, giving them the leader.   1.5 add_unit_leader_trait The trait to add. add_unit_leader_trait = old_guard Adds the specified trait to the current unit leader. Traits are found in /Hearts of Iron IV/common/unit_leader/*.txt. 1.0 remove_unit_leader_trait The trait to remove. remove_unit_leader_trait = old_guard Removes the specified trait from the current unit leader. Traits are found in /Hearts of Iron IV/common/unit_leader/*.txt. 1.0 add_timed_unit_leader_trait The trait to add.

days = The duration of the trait.

add_timed_unit_leader_trait = { trait = wounded days = 90 } Adds the specified trait to the current unit leader for the specified duration. Traits are found in /Hearts of Iron IV/common/unit_leader/*.txt. 1.5 replace_unit_leader_trait       Traits are found in /Hearts of Iron IV/common/unit_leader/*.txt. 1.5 战斗 Name Parameters Examples Description Notes Version Added supply_units / The amount of hours of supply. supply_units = 24 Adds the specified amount of hours of supply to troops led by the current unit leader.   1.5 add_max_trait The amount to add. add_max_trait = 1 Adds the specified amount of assignable trait slots to the current unit leader.   1.5 add_skill_level The skill to add. add_skill_level = 1 Adds skill to the current unit leader.   1.5 add_logistics The skill to add. add_logistics = 1 Adds logistics skill to the current unit leader.   1.5 add_planning The skill to add. add_planning = 1 Adds planning skill to the current unit leader.   1.5 add_defense The skill to add. add_defense = 1 Adds defense skill to the current unit leader.   1.5 add_attack The skill to add. add_attack = 1 Adds attack skill to the current unit leader.   1.5 add_temporary_buff_to_units combat_offense = The bonus to grant. Optional.

combat_breakthrough = The bonus to grant. Optional. combat_defense = The bonus to grant. Optional. combat_entrenchment = The bonus to grant. Optional. org_damage_multiplier = The bonus to grant. Optional. str_damage_multiplier = The bonus to grant. Optional. war_support_reduction_on_damage = The bonus to grant. Optional. cannot_retreat_while_attacking = The bonus to grant. Optional. cannot_retreat_while_defending = The bonus to grant. Optional. days = The duration of the buff. Optional. tooltip = The tooltip to display for the buff.

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 } Adds the specified combat buff to the current unit leader.   1.5 boost_planning The amount to add. boost_planning = 1 Improves the planning of units controlled by the current unit leader.   1.5 Flow Control

These scopes are used within effect scopes to control the execution of effects.

If, Else If and Else

These scopes allow effects to be conditionalized, so they only occur when the requisite triggers are met.

For example, if you only have an effect to occur for Germany, you'd do the following:

if = { limit = { original_tag = GER } add_stability = 0.1 }

If you then wanted England to have a similar effect, and everyone else to have something else, you do the following:

if = { limit = { original_tag = GER } add_stability = 0.1 } else_if = { limit = { original_tag = ENG } add_stability = 0.25 } else = { add_stability = 0.05 }

As you can see, this allows for flexibility in how effects occur and cuts down on duplication.

隐藏效果

This scope hides the presence of the effects within it in the player's tooltip. This is used to execute effects without the player seeing them. For example, you may want to manipulate some variables in an event. Showing them to the player may confuse them, so it is best to hide the effects within an hidden effect scope, like so:

hidden_effect = { set_variable = { my_var = 100 } } Random List

This scope allows the creation of a random selection of effects. For example, if you wanted an effect to randomly given the player one out of four bonuses, you'd do the following:

random_list = { 25 = { add_stability = 0.5 } 25 = { add_manpower = 10000 } 25 = { add_war_support = 0.5 } 25 = { army_experience = 100 } }

Note that if you want to create a repeatable decision including a random list, by default the same decision will pick the same random result every time it is triggered in a game. You can reverse this behaviour by including the following line in the decision block:

fixed_random_seed = no

It is also possible to use modifiers to affect the weight of each possible random effect.

random_list = { 25 = { add_stability = 0.5 modifier = { factor = 1.3 has_country_flag = inward_perfect_flag } } 25 = { add_manpower = 10000 } 25 = { add_war_support = 0.5 } 25 = { army_experience = 100 } }

The above code would multiply the 25 by the factor thereby making it more or less likely to occur if the trigger condition is fulfilled.

Effect Tooltip

This scope will display the tooltip information of the effects within, without actually executing the effects. This is useful when you want to show what the effect may look like to the player. Here is an example:

effect_tooltip = { every_owned_state = { add_manpower = 10000 } } 模组制作  文档 效果 • 条件 • 定义 • 修正 • 修正列表 • 作用域 • 本地化 • 行动 • Data structures (Flags, Event targets, Country tag aliases, Variables, Arrays) 编写脚本 AI • AI focuses • Autonomous states • Balances of power • 剧本 • 建筑 • Characters and traits • Cosmetic tags • 国家 • 师 • 决议 • 装备 • 事件 • 内阁/民族精神 • 意识形态 • 国策 • 资源 • Scripted GUI • 科技 • 单位 地图 地图 • 地区 • 补给区域 • 战略区域 图形图像 界面 • 图形资产 • 实体 • 后特效 • 离子效果 • 字体 装饰性 肖像 • 命名列表 • 音乐 • 音效 其他 控制台指令 • 故障排除 • 模组结构 • 成就代码分析


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3