Decisions 这些是玩家或AI可选的行动,会出现在外交或阴谋界面(取决于类型)。
Decisions are different from events,触发时玩家无法控制。复杂的决策通常会引发一连串事件。
Decisions need to be in the /decisions/ folder.
Intrigue decisions are declared inside a block decisions = { } or plot_decisions = { }, and are shown in the Intrigue view.
它们按决策文件夹中按字母顺序加载的顺序出现。
请注意,决策非常微妙:任何语法错误或未识别的关键词都会破坏决策,导致章节标题在阴谋界面中显示不佳。
Special scopes:
<decision_name> = {
is_high_prio = yes # Will show an alert once decision is enabled
ai_check_interval = 12 # Determines how seldom the AI checks whether they can and should do the decision, in months. By default 1 (every month).
potential = {
#Conditions for the decision to appear
}
allow = {
#Conditions for the decision to be enabled
}
effect = {
#Commands executed when taking the decision
}
ai_will_do = {
#Factors for an AI character to take the decision (1 = 100% chance)
}
}
要定义决策图标,你需要一个带有名称的精灵类型GFX_decision_name in a .gfx file inside interface/ folder.
Vanilla decision icons are 28px x 28px DDS 带有透明背景的文件,图标本身为24px x 20px,边框为2px黑色边框。
spriteTypes = {
...
spriteType = {
name = "GFX_decision_name"
texturefile = "gfx\\interface\\decision_icon.dds"
}
...
}
| vassal_decision和dynasty_decisions已被弃用,取而代之的是带有特定过滤器的targeted_decision |
这些决策在阴谋菜单中每个王朝或附庸都会出现一次,虽然被针对性决策半多余,但如果愿意,仍然可以使用。请记住,附庸不一定意味着直接附庸,可以是任何人,就像普通的决定,但每个人出现一次。
They are declared inside a block vassal_decisions = { } or dynasty_decisions = { }, and are shown in the Intrigue view.
Special scopes:
decision_name = {
is_high_prio = yes # Will show an alert once decision is enabled
ai_check_interval = 12 # Determines how seldom the AI checks whether they can and should do the decision, in months. By default 1 (every month).
from_potential = {
#Conditions on the decision taker for the decision to appear
potential = {
#Conditions on the vassal or dynasty member for the decision to appear
}
allow = {
#Conditions for the decision to be enabled
}
effect = {
#Commands executed when taking the decision
}
revoke_allowed = {
always = no #Not used in vanilla
}
ai_will_do = {
#Factors for an AI character to take the decision (1 = 100% chance)
}
}
要定义决策图标,你需要一个带有名称的精灵类型GFX_decision_name in a .gfx file inside the interface/ folder.
Vanilla decision icons are 28px x 28px DDS 带有透明背景的文件,图标本身为24px x 20px,边框为2px黑色边框。
spriteTypes = {
...
spriteType = {
name = "GFX_decision_name"
texturefile = "gfx\\interface\\decision_icon.dds"
}
...
}
Targeted decisions are declared inside a block targeted_decisions = { } or targetted_decisions = { } (任一都可以),并且会显示在外交视图中。注意,在technology.txt中加入带有add_decision的定向决策似乎会让无落地角色无法使用该决策。
Special scopes:
In order to limit CPU load, filter and ai_target_filter 指定目标角色类型(分别针对玩家/人工智能),其中 potential and allow blocks will be evaluated:
Additionally, all, court, home_court, sub_realm, realm, dynasty, independent_rulers and society have "_including_me" versions (e.g. court_including_me) which also include the decision taker.
decision_name = {
is_high_prio = yes # Will show an alert if special action is available
ai_check_interval = 12 # Determines how seldom the AI checks whether they can and should do the decision, in months. By default 1 (every month).
filter = sub_realm #Filter characters targeted by the player
from_potential = {
#Conditions on the decision taker for the decision to appear. Not taken into account when filter = self, use potential instead.
}
potential = {
#Conditions on the targeted character for the decision to appear
}
allow = {
#Conditions for the decision to be enabled
}
effect = {
#Commands executed when taking the decision
}
revoke_allowed = {
always = no #Not used in vanilla
}
ai_will_do = {
#Factors for an AI character to take the decision (1 = 100% chance every month - for each allowed target!)
}
ai_acceptance = {
# See below
}
}
AI接受是一个可选部分,用于指定决策,用以表示AI是否接受该决定。注意,AI的反应不受该系统影响;它旨在向玩家传达结果。脚本作者必须让AI按照显示的“是”或“也许”来行动。只有“不”才是机械效果,完全阻止了决策。
If ai_acceptance 定义后,AI接受度会反映在决策中,类似于许多互动的表现。如果得分低于或等于零,“做吧!”按钮将变灰。精确值会被保存到本地变量中 local_ai_acceptance_score,类似于第三方分数的保存方式。即使有 show_maybe_for_human is used.
An example AI acceptance section:
ai_acceptance = {
factor = 10 # The base score
yes_threshold = 50 # At what point to switch from "maybe" to "yes". Defaults to 0, meaning it will never be "maybe"
show_maybe_for_human = no # Whether to always show "maybe" for human targets (defined as ROOT being controlled by a player). Defaults to "yes"
additive_modifier = { # Any type of modifier can be used, but "additive" is recommended as it is the most intuitive to the end user. Works same way as MTTHs, ai_will_do, and so on
value = 10
always = yes
}
additive_modifier = {
value = -10
always = yes
}
additive_modifier = {
value = -10
always = no
}
additive_modifier = {
value = -100
localisation_key = "REASON_WEALTH"
wealth = 1000
}
}
定居点决策对所有定居点都可行,且显示在定居点外交视图中,而非阴谋视图。它们被宣布在一个区块内 settlement_decisions = { } 并采用与有针对性决策相同的结构和本地化。
Special scopes:
In order to limit CPU load, filter / ai_target_filter 指定目标定居点类型(分别针对玩家/AI),其中 potential and allow blocks will be evaluated:
Similarly there are also trade_post_decisions = { }, fort_decisions = { }, and hospital_decisions = { }.
头衔决策对所有头衔都可行,且显示在头衔外交视图中,而非阴谋视图。它们被宣布在一个区块内 title_decisions = { }
Special scopes:
In order to limit CPU load, filter / ai_target_filter 指定目标定居点类型(分别针对玩家/AI),其中 potential and allow blocks will be evaluated:
2.7补丁中加入。社团决策在区块内宣布 society_decisions = { }.他们只会被评估在任何社会中的角色。它们可以用来让不同社会的成员也能获得相同的决策。除此之外,它们与普通车完全相同 Decision.
In Patch 2.8, offmap powers 通过独特的地图外能力界面激活的决策。
与社会决策类似,这些决策被自身的决定包围 offmap_decisions = { } 阻挡,几乎与标准决策相同。 然而,offmap_decisions也有一个唯一的参数, button_name,对应于定义在 buttons section of an offmap power:
offmap_decisions = {
<decision_name> = {
button_name = offmap_gifts
ai_check_interval = 12
is_high_prio = yes
potential = {
#Conditions for the decision to appear
}
allow = {
#Conditions for the decision to be enabled
}
effect = {
#Commands executed when taking the decision
}
ai_will_do = {
#Factors for an AI character to take the decision (1 = 100% chance)
}
}
}
按钮名称已本地化,但本地化键必须在三个文件中保持一致:在地图外电源、offmap_decision和对应的图形界面文件中。
地图外的决策也可以由第三方决定,详见下文。
Since Patch 2.8,需要目标的决策也可以选择第二个目标,而第二个目标将成为第三方。这适用于目标、地图外、定居点和头衔决策,但通常只用于前两个。
Additional special scope:
third_party_filter and ai_third_party_filter use the same syntax filter and ai_target_filter in targeted decisions do, as well as an additional artifacts filter.
They can take one more parameter, third_party_score = { }.内窥镜会根据该分数排序,结果会是 variable, stored as local_third_party_score. The base value can be defined with factor = #Base value, then it is possible to modify it with modifier = { } and additive_modifier = { }.
decision_name = {
# other parameters
third_party_filter = court #Filter for applicable third parties
ai_third_party_filter = court #Filter for third party characters selected by the AI
third_party = ROOT # Determine which scope the third party should be filtered from. Defaults to FROM
show_third_party_potential = yes #Set to show third party requirements in the tooltip. Defaults to no.
third_party_potential = {
#Conditions for a third party character to be included in the list
}
third_party_allow = {
#Conditions on the selected third party for the "Send" button to be enabled
}
third_party_score = {
#Factors to determine how "good" a third party character is for the decision. Determines sorting.
#This score is stored in the variable "local_third_party_score", so it can be used in triggers and effect
factor = #Base value
additive_modifier = {
value = #Value to add to current
#Conditions
}
#More additive_modifier
modifier = {
factor = #Factor to multiply the value
#Conditions
}
#More modifier
}
effect = {
#Commands executed when taking the decision
}
}
Pre-triggers or fast triggers are special conditions 决策的根源是,如果决策未达成前触发条件,AI可以快速退出评估,而无需评估触发块。[1][2] 建议尽可能使用这些信息,以减少AI评估决策的时间。注意,预触发目前只适用于AI,不适用于玩家。
预触发次数没有限制,除了每种只有一个。
Warning: 有些预触发症状的名称与正常状态不同!
The following decision pre-triggers currently exist for decisions:
| Pre-trigger | Type | Scope | Description | Equivalent trigger |
|---|---|---|---|---|
| only_playable | bool | character | 在脚本中,“可操作”并不意味着玩家真的能操作该角色。意思是:伯爵等级或以上,或者贵族阶层,不是无地的叛乱者。使用这个预触发完全消除了对不符合条件的事件评估,意味着事件会针对游戏中约1000名可玩角色进行检查,而非全部约2万名 | is_playable |
| only_rulers | bool | character | Excludes untitled characters. This is a lesser version of only_playable,因为它包括男爵、叛乱者等(即任何拥有头衔的人)。
|
is_ruler |
| only_independent | bool | character | Excludes vassals and tributaries. Implies only_playable.
|
independent |
| is_in_society | bool | character | 排除不属于某个社会(= 是)或不属于某个社会的角色(= 不属于)。 | is_in_society |
| ai = no | bool | character | 排除所有非玩家角色的决策。在2.8补丁中加入。 | ai = no |
| 历史 | 角色 • 家族 • 省份 • 头衔 • 剧本 |
| 脚本 | 指令 • 条件 • 作用域 • 修正 • 事件 • 决议 |
| 常规 | 定义 • 游戏规则 • 另类开局 • 宗教 • 文化 • 政体 • 特质 • 血脉 • 科技 • 法律 • 建筑 • 宣战理由 • 朝贡国 • 单位 • 目标 • 疾病 • 死亡 • 荣誉头衔 • 社团 • 宝物 • 地图外政权 • 内阁成员 • 贸易路线 • 继承 • 奇观 • 称号 |
| 图像/音效/本地化 | 地图 • 图形 • 盾徽 • 肖像 • 界面 • 小地图 • 音乐 • 本地化 |
| 其他 | 故障排除 • 验证器 • 控制台指令 • 编辑游戏存档 • Steam创意工坊 • EU4转档器模组制作 |
ConditionsDDSDecisionEU4转档器模组制作Event moddingLaw moddingLocalizationModifiersOffmap power moddingPatch 2.8ScopeScopesSteam创意工坊Variable事件模组制作作用域修正内阁成员模组制作剧本模组制作单位模组制作历史模组制作另类开局模组制作图形模组制作地图外政权模组制作地图模组制作头衔模组制作奇观模组制作宗教模组制作定义宝物模组制作宣战理由模组制作家族模组制作小地图模组制作建筑模组制作指令控制台指令政体模组制作故障排除文化模组制作朝贡国类型模组制作本地化条件模组制作死亡模组制作法律模组制作游戏规则模组制作特质模组制作界面模组制作疾病模组制作目标模组制作盾徽模组制作省份模组制作社团模组制作科技模组制作称号模组制作继承模组制作编辑游戏存档肖像模组制作脚本荣誉头衔模组制作