国策的定义在/Hearts of Iron IV/common/national_focus/*.txt。
国策
File:Ambox outdated info.png | 这部分内容可能已不适合当前版本,最后更新于1.8。 |
单个国策被捆绑于国策树上。
属性
id
(变量类型: 字符串string) 国策的独一无二的标识符。
文本id(text)
(变量类型: 字符串string, 默认: id) 一个可替换的文本标识符。这允许多个国策使用同一个名称和描述。
动态(dynamic)
(变量类型: 布尔boolean, 默认: no) 如果为真,本地化的字符串可以包括占位符,例如可以允许国策名字根据意识形态改变。
花费时间(cost)
(变量类型: number (three decimal places precision), 默认: 0) 国策将要花费多长时间(乘以7天)。
允许国策支(allow_branch)
(变量类型: AND trigger, 默认: { }
) 如果这个trigger非空,它就可以专有地决定一个国策是否可用。如果这个trigger为假,这个国策及其依赖项都不可用且不可见。
前提条件(prerequisite)
定义一系列作为该国策前提条件的国策(至少一个)。前提国策的id可以由focus
和OR
给出。可以出现多次,在这种情况下每一个prerequisite
都需要满足。例如:
prerequisite = { focus = GER_kdf_wagen OR = GER_synthetic_rubber } prerequisite = { focus = GER_important_focus }
在上面的例子中,GER_kdf_wagen
和GER_synthetic_rubber
中的一个完成了,就是满足了国策的第一个前提条件,但是GER_important_focus
也需要完成。第一行也可以等效地写成prerequisite = { focus = GER_kdf_wagen focus = GER_synthetic_rubber }
.
互斥(mutually_exclusive)
定义一系列国策,每个国策都和该国策互斥。语法规则和prerequisites
相同。可以出现多次,以使该国策与其他多个国策互斥。
可用(available)
(变量类型: AND trigger, 默认: { }
) 当allow_branch
不存在时,若这个trigger为假,国策将不可用。
投降后可用(available_if_capitulated)
(变量类型: 布尔boolean, 默认: no) 如果为假,这个国策对已投降的国家将不可用,如果国策正在进行,国家投降时国策将会取消。
可取消(cancelable)
(变量类型: 布尔boolean, 默认: yes) 如果为假,国策将不能手动取消。
取消(cancel)
(变量类型: AND trigger, 默认: { }
) 当国策进行中而取消触发器变为真时,国策将会取消。与普通的AND触发器不同,一个空的取消触发器被视为假。
无效时取消(cancel_if_invalid)
(变量类型: 布尔boolean, 默认: yes) 如果为真,当available
变为假时正在进行的国策会被取消。
无效时继续(continue_if_invalid)
(变量类型: 布尔boolean, 默认: no) 如果为真,cancel
和cancel_if_invalid
会被忽略
开始效果(select_effect)
(变量类型: effect) 当国策被选中开始时,效果将会实施。
完成奖励(completion_reward)
(变量类型: effect) 当国策完成时,效果将会实施。
完成提示(complete_tooltip)
(变量类型: effect) 国策的完成提示将会显示这里面的效果而不是真正的完成奖励completion_reward
。
跳过(bypass)
(变量类型: AND trigger, 默认: { }
) 当跳过触发器为真时,任意当前正在进行中或者可用的国策都会跳过。与普通的AND触发器不同,一个空的跳过触发器被视为假。Bypassing ignores the available
trigger. 当一个国策有互斥选项时,玩家需要手动选择跳过。otherwise the bypass happens automatically as soon as the conditions are fulfilled.
图标(icon)
(变量类型: 字符串string) 图形图标名,一般是在/Hearts of Iron IV/interface/goals.gfx中定义。
x坐标(x)
(变量类型: 整数integer, 默认: 0) 国策的水平坐标,网格行。
y坐标(y)
(变量类型: 整数integer, 默认: 0) 国策的垂直坐标,网格列。
坐标移动(offset)
一个对x
和y
坐标属性的额外转换,以一个触发器为条件。x
和y
坐标属性是整数integers,其中的触发器是一个AND触发器。例子如下:
offset = { x = -1 y = 0 trigger = { NOT = { has_dlc = "Man the Guns" } } }
(相对位置id)relative_position_id
(变量类型: 字符串string) 此国策的图形坐标将相对于参考原点国策的位置生成。通常来说参考原点国策会是该国策的前置国策,这样就可以做到移动根国策就可以移动整棵国策树。在编辑国策树时推荐使用相对位置。代码样例如下:
focus = { id = root_focus x = 2 y = 0 } focus = { id = branch_focus relative_position_id = root_focus x = -1 y = 1 }
在这种情况下,root_focus
的坐标为(2,0),而branch_focus
的实际坐标为(1,1),可以通过移动root_focus
来一起移动其后的整个国策树。
historical
(变量类型: 布尔boolean, 默认: no) 从未使用
(历史AI)historical_ai
(变量类型: AND trigger, 默认: { }
) 如果历史AI国策是开启状态,AI只会当这个触发器为真时才会选择这个国策。
ai_will_do
(变量类型: MTTH, 默认: { base = 1 }
) Defines the probability of the AI picking this focus. The value is further modified by +50% if the focus is not at the root of a branch, proportionately reduced if a mutually exclusive choice, as well as multiplied by any focus_factor
s in AI strategy plans. For each available focus, the AI generates a random number between 0 and the calculated value. It chooses the focus with the highest resulting number.
For example if two focuses are available with calculated values of 1.5 and 3 respectively, the former has a chance of 1-in-6 to be picked and the latter 5-in-6.
will_lead_to_war_with
(变量类型: country tag) The specified country will receive a warning that war goals are being justified against it while the focus is running. Can appear multiple times.
本地化(Localization)
The localization keys of focuses are prefixed with its id
(or text
). Given a focus with id = XYZ
, the localization keys are
- XYZ: name
- XYZ_desc: description
国策树
File:Ambox outdated info.png | 这部分内容可能已不适合当前版本,最后更新于1.8。 |
Each country is assigned a focus tree, which is a collection of national focuses. It can get amended by continuous focuses and shared focuses.
Attributes
id
(变量类型: 字符串string) A unique identifier for the focus tree.
country
(变量类型: MTTH, 默认: { base = 1 }
) A score for the fit of this tree for the given tag. A country uses the national focus tree with the highest score. To assign a tree to a particular country, the score should be zero by 默认 and modified to a high value for just that country.
默认
(变量类型: 布尔boolean, 默认 no
) If set to yes
, this focus tree will be used for all countries that did not get a score greater than 0 on any focus tree. Only one focus tree should be set to be the 默认, generic_focus in the base game.
reset_on_civil_war
(变量类型: 布尔boolean, 默认: yes
) If set to no
, if the newly spawned tag in a civil war gets the same focus tree, it will copy the progress unlocked by the original country. Otherwise it starts the focus tree from the beginning.
continuous_focus_position
(变量类型: point, 默认: { x = 0, y = 0 }
) The visual location of the continuous focus palette.
focus
(变量类型: national focus) Defines a national focus as described above that is added to this tree. Can appear multiple times.
(变量类型: 字符串string) Causes the referenced shared focus and its dependants to be inserted in this tree. Can appear multiple times. A shared focus is declared outside of any focus tree using shared_focus
. It otherwise has the same semantics as a normal national focus.
例子
shared_focus = { id = shared_1 x = 10 offset = { x = 10 trigger = { tag = LIT } } completion_reward = { army_experience = 10 } } focus_tree = { id = lithuania_focus country = { base = 0 modifier = { add = 10 tag = LIT } } shared_focus = shared_1 focus = { id = LIT_focus_1 x = 10 completion_reward = { navy_experience = 10 } } focus = { id = LIT_focus_2 prerequisite = { focus = LIT_focus_1 } relative_position_id = LIT_focus_1 y = 10 completion_reward = { navy_experience = 10 } } } focus_tree = { id = basic_focus country = { base = 1 } shared_focus = shared_1 }
文件 | 效果 • 条件 • 定义 • 修正 • 修正列表 • 作用域 • 本地化 • on action • 数据结构 (标记, 临时标记, 国家别名, 变量, 数组) |
脚本 | 成就修改 • AI修改 • AI focuses • 自治领修改 • 权力平衡修改 • 剧本/标签 (游戏规则)• 建筑修改 • 人物修改 • 修饰性TAG修改 • 国家创建 • 军队修改 • 决议制作 • 装备修改 • 事件修改 • Idea修改 • 意识形态修改 • 军工商修改 • 国策制作 • 资源修改 • Scripted GUI • 科技制作 • 单位修改 |
地图 | 地图 • 省份 • 补给区域 • 战略区域 |
图形图像 | 界面 • 图形资产 • 实体模型 • 后期特效 • 离子效果 • 字体 |
装饰性 | 肖像 • 命名列表 • 音乐 • 音效 |
其他 | 控制台指令 • 故障排除 • 模组结构 • 成就代码分析 • Mod相关 • Nudger修改 |