事件模组制作:修订间差异

本页面讲述的内容长期有效
(06:10, 12 November 2020‎ Lillebror)
→‎选项:​ 润饰翻译
 
(未显示6个用户的18个中间版本)
第2行: 第2行:
{{需要翻译}}
{{需要翻译}}
{{需要完善}}
{{需要完善}}
Events are the meat of every well-rounded mod; smaller and larger bits of story that can happen to a player during the campaign.
'''事件'''是每个完善的模组的核心;是在游戏过程中可能发生在玩家身上的一系列或大或小的故事片段。


== Location ==
== 位置==
Events belong in a .txt file inside the <code>events</code> directory directly below your [[Mod structure#Mod folder|root mod folder]]. Each file can hold as many events as one would like. The <code>events</code> directory may also have sub-folders containing their own event files, if one prefers.
事件的代码需要放在位于[[模组结构#Mod文件夹|Mod文件夹]]中的<code>events</code> 目录中的.txt文件中。每个文件可以容纳任意多个事件。如有需要,<code>events</code> 目录下可以再建立子文件夹来存放事件文件。


== Structure ==
== 结构 ==


The overall structure is similar to that of a [[CKII:Event_modding|CK2 event]], with some tweaks to the syntax and a whole lot of extra features, many of them optional. The barest possible event is laid out here, and each element is described individually in a later section.
整体结构与[[ck2: 事件模组制作|CK2 的事件]] 相似,语法进行了一些调整,并添加了大量的额外功能,其中许多是可选的。以下是最基本的事件(其中每个元素会在后面的小节中进行解释):
 
<syntaxhighlight lang="coffeescript">
<pre>
namespace = example
example.1 = {
example.1 = {
desc = example.1.desc
desc = example.1.desc
第19行: 第19行:
}
}
}
}
</pre>
</syntaxhighlight>
There you go! Add this to your mod, trigger it from the in-game console using "event triggers [example.1]", and you have got yourself a working event! Everything else is optional, but necessary to really flesh out the events.
 
好了!将这段代码添加到你的模组中,在游戏内控制台输入"event example.1" 来触发它,你就会得到一个可用的事件!这就是一个最基本的事件的结构,所有其他的内容都是可选的,但是编撰一个生动的事件时它们是必不可少的。以下是一个更为详细的事件示例(仅包含基础内容):
 
<syntaxhighlight lang="coffeescript">
## 这是一个基础事件,可将其作为其他事件的基础(参考)。不过,您可能希望先删除这段注释垃圾。
superexample.1337 = { # 请使用注释(比如这个!)在此处填写事件名称,这样其他模组编写者就可以在不知道ID的情况下找到你正在处理的事件。
type = character_event
title = "A Modding Example Worthy of Kings" # 专业提示:在编写时,你可以使用字符串,稍后再用本地化替换它。
desc = birth.1003.b # 对于Sublime用户而言,有一个非常出色的功能,即“在文件中查找”,非常适用于在本地化文件中探索。
 
theme = mental_break
left_portrait = root
 
option = { # 在选项中使用注释来说明选项的内容或功能(例如:“不,我谴责你这个异端!”或“与孩子进行决斗”),这与事件标题的做法相似,这是一个很好的习惯。
name = stewardship_domain_special.1424.a
}
}
</syntaxhighlight>
 
=== ID 和命名空间 ===
命名空间(Namespaces)可以是任何由字母和数字组成的字符串(不包含'.'字符),会被用作前缀,形式为 <code><namespace>.<id></code> 。ID是对于一个事件的唯一标识。


=== ID and namespace ===
如果一个事件文件使用一个命名空间,那么它必须在文件开头声明 <code>namespace = <namespace></code> 。对每个使用该命名空间的文件都需要进行声明。
The ID uniquely identifies your event.


=== Flags ===
=== 标志 ===
These are top-level variables that determine your event's kind and appearance. They have a limited set of values.
标志(Flags)是决定你的事件种类和外观的顶级变量。它们有一组有限的取值。


{| class="wikitable"
{| class="wikitable"
|-
|-
! Flag !! Meaning !! Possible values
! Flag !! 意义 !! 可能的取值
|-
|-
| type 
| type 
|| The kind of event. It determines what sort of scope the root is.
|| 事件的类型决定了根(root)的作用域(scope)。
|| * character_event
||
* none (when an event doesn't use the root scope at all)
* character_event
* letter_event
* duel_event
* none (当一个事件完全不使用根作用域时)
* empty (使一个无角色事件能被触发。注意:这意味着输入 type = empty )
|-
|-
| hidden || Set this to true, and the event will not be shown at all; it will happen in the background. Useful for doing maintenance events that are not immediately relevant to the player.
| hidden 
|| 将此设置为true,事件将不会显示;它将在后台执行。适用于进行对玩家并不立即相关的维护事件。
|| true, false
|| true, false
|}
|}


== Portraits ==
== 人物肖像 ==
In Crusader Kings III, portraits are now in 3D, and can now be animated as well! What follows is a list of the different portrait positions, as well as a list of animations for them.
在《十字军之王3》中,人物肖像是3D的,而且是动态的啦!肖像由肖像位置和动画决定。


=== Portrait Positions ===
=== 人物肖像定位 ===


[[File:Example event.png|thumb|left|Portrait Positions]]
[[File:Example event.png|thumb|left| 人物肖像效果]]


{| class="wikitable"
{| class="wikitable"
第52行: 第76行:
! Portrait Position !! Description
! Portrait Position !! Description
|-
|-
| left_portrait || Shown on the left side of the event scene.
| left_portrait || 在事件框的左侧显示肖像。
|-
|-
| right_portrait || Shown on the right side of the event scene.
| right_portrait || 在事件框的右侧显示肖像。
|-
|-
| lower_left_portrait || Shown on the lower left part of the event scene.
| lower_left_portrait || 在事件框的左下方显示肖像。
|-
|-
| lower_center_portrait || Shown on the lower center part of the event scene.
| lower_center_portrait || 在事件框的下方中间显示肖像。
|-
|-
| lower_right_portrait || Shown on the lower right part of the event scene.
| lower_right_portrait || 在事件框的右下方显示肖像。
|}
|}


Here is an example of all of the portrait positions in use at the same time, along with a screenshot:
这是一个同时使用所有人物肖像位置的示例,效果截图如上图:
<pre>
<pre>
example_event.1001 = {
example_event.1001 = {
left_portrait = {
left_portrait = {
character = ROOT # Whoever this is scoped to will show up in this event window position, exhibiting the chosen animation.
character = ROOT # 此处指定的人物会出现在事件框的指定位置,表现出指定的动画
animation = fear # Take note that characters with SOME genetic traits (for example, gigantism, dwarfism) that change their character models have different animations, and if you assign one of THOSE animations to a character that does not have that model, crashes may occur.
animation = fear # 注意,拥有某些角色的基因特质(比如巨人、侏儒)会改变人物模型,从而有不同的动作模组;如果你要求一个没有这个动作的模型的人物做将这些特有的动作,可能导致游戏崩溃
}
}
right_portrait = {
right_portrait = {
第86行: 第110行:
</pre>
</pre>


=== Animations ===
肖像可以使用以下参数:
 
{| class="wikitable"
|-
! 参数 !! 描述 !! 示例
|-
| character|| 展示哪个角色的肖像 ||<code>character = scope:event_target</code>
|-
| animation|| 角色将显示哪种动画 ||<code>animation = anger</code>
|-
| triggered_animation|| 如果符合条件,人物将显示这种动画。如果不符合,将显示以<code>animation = </code>语句设置的动画。 ||<pre>triggered_animation = {
trigger = {}
animation = fear
}</pre>
|-
| triggered_outfit|| 设置事件中使用的服装 ||<pre>triggered_outfit = {
trigger = {}
outfit_tags = no_clothes (可以使用多个tag,格式:outfit_tags = { tag1 tag2 })
remove_default_outfit = yes/no
}</pre>
|-
| hide_info|| 避免显示人物的任何信息 (提示文字、盾徽、clicks等),只显示人物肖像 ||<code>hide_info = yes/no</code>
|}
 
=== 人物动画 ===
{|class="wikitable"
{|class="wikitable"
|-
|-
!colspan="4"|Animation
!colspan="6"| 与事件兼容的动画ID
|-
|-
| happiness
| idle
| dismissal
| chancellor
| prison_dungeon
| steward
| admiration
| marshal
| spymaster
| chaplain
|-
|-
| anger
| rage
| disapproval
| disbelief
| disgust
| disgust
| schadenfreude
| stress
| personality_compassionate
|-
| pain
| ecstasy
| fear
| fear
| rage
|-
|-
| anger
| sadness
| flirtation_left
| shame
| shame
| boredom
|-
| shock
| shock
| worry
| worry
| scheme
| boredom
| personality_bold
| grief
|-
|-
| personality_callous
| paranoia
| personality_irrational
| dismissal
| personality_content
| flirtation
| flirtation
| flirtation_left
| love
| schadenfreude
|-
|-
| stress
| happiness
| ecstasy
| admiration
| lunatic
| scheme
|-
|-
| disbelief
| beg
| personality_cynical
| pain
| personality_rational
| poison
| personality_dishonorable
| aggressive_axe
| aggressive_mace
| aggressive_sword
|-
|-
| idle
| aggressive_dagger
| paranoia
| aggressive_spear
| personality_vengeful
| aggressive_hammer
| disapproval
| celebrate_axe
| celebrate_mace
| celebrate_sword
|-
|-
| sick
| celebrate_dagger
| beg
| celebrate_spear
| personality_zealous
| celebrate_hammer
| newborn
| loss_1
| chess_certain_win
| chess_cocky
|-
|-
| love
| laugh
| sadness
| lantern
| personality_honorable
| eyeroll
| personality_forgiving
| eavesdrop
| assassin
| toast
|-
|-
| personality_greedy
| toast_goblet
| personality_coward
| drink
| severelyinjured
| drink_goblet
| newborn
| sick
| severelywounded
| severelywounded
|-
|-
| prisonhouse
| prisondungeon
| war_attacker
| war_attacker
| war_defender
| war_defender
| war_over_tie
| war_over_win
| war_over_win
| grief
|-
| war_over_loss
| pregnant
| personality_honorable
| personality_dishonorable
| personality_bold
| personality_coward
|-
| personality_greedy
| personality_content
| personality_vengeful
| personality_forgiving
| personality_rational
| personality_irrational
|-
| personality_compassionate
| personality_callous
| personality_zealous
| personality_cynical
| frontend_center_idle
| frontend_left_idle
|-
| frontend_right_idle
| throne_room_chancellor
| throne_room_kneel_1
| throne_room_kneel_2
| throne_room_curtsey_1
| throne_room_messenger_1
|-
| throne_room_messenger_2
| throne_room_messenger_3
| throne_room_conversation_1
| throne_room_conversation_2
| throne_room_conversation_3
| throne_room_conversation_4
|-
| throne_room_cheer_1
| throne_room_cheer_2
| throne_room_applaud_1
| throne_room_bow_1
| throne_room_bow_2
| throne_room_bow_3
|-
| throne_room_one_handed_passive_1
| throne_room_one_handed_passive_2
| throne_room_two_handed_passive_1
| throne_room_writer
| test_case_1
| throne_room_ruler
|}
|}


=== Themes ===
== 主题 ==
主题(Themes)是一类用于角色肖像的背景、照明环境和音效的集合。它们在 common/event_themes/ 目录中声明。
{| class="wikitable"
{| class="wikitable"
|-
|-
第248行: 第362行:
|}
|}


override_background, override_icon, override_sound, override_environment
可以使用 <code>override_background</code>, <code>override_icon</code>, <code>override_sound</code>, and <code>override_environment</code> 来覆盖主题的各个元素。


==== Backgrounds ====
==== 背景 ====
{| class="wikitable"
{| class="wikitable"
!colspan="4"|Background
!colspan="4"|Background
第315行: 第429行:
|}
|}


==== Environments ====
=== 环境 ===
When you've selected a background, the appropriate environment is automatically selected. Only overwrite it when necessary.
当您选择了一个背景之后,系统会自动选择适当的环境。仅在必要时才进行更改。
{| class="wikitable"
{| class="wikitable"
!colspan="3"| Environment
!colspan="3"| Environment
第420行: 第534行:
|}
|}


=== Trigger ===
== 触发器 ==
This is an additional requirement for an event to work.
这是另一个使事件具有使用价值的要求。


==== on_trigger_fail ====
<pre>
Runs when the trigger fails.
trigger = { # 只有这些条件都满足,这个事件才可以触发(对于事件本身而言,这是一个巨大的IF语句)。
culture = {
has_innovation = innovation_guilds # 检查你的文化是否已解锁行会。
}
}
</pre>
 
还可以使用 <code>trigger_if</code> 将某些要求锁定在自己的触发器后面。只有在 <code>limit</code> 为真时,才会检查 <code>trigger_if</code> 中的要求。如果想在 <code>trigger_if</code> 为假时检查另一组要求,可以选择添加 <code>trigger_else</code> 。
 
<pre>
trigger = {
any_held_county = { # 检查是否持有一个建造了铁匠铺的地产
any_county_province = {
has_building_or_higher = blacksmiths_01
}
}
 
trigger_if = { # 如果角色有贪婪的特质,需求增加500金币
limit = { has_trait = greedy }
gold > 500
}
trigger_else = { # 否则,必须至少拥有50点虔诚和10金币。
piety > 50
     gold > 10
}
}
</pre>
 
=== 触发失败 ===
on_trigger_fail 在trigger检验失败的时候运行。
 
== 描述 ==
{{需要完善}}
Description 解释如何组合多个字符串来构成描述,包括类似于first_valid和所有备选项的内容。


=== Description ===
== 立即执行 ==
Explain how a description can be composed of multiple strings; with stuff like first_valid, and all the alternatives.
这是一个效果脚本块:当事件被触发时,它将立即运行,甚至在标题、描述和肖像被运算确定和渲染之前。这个脚本块常见的用途是:设置变量和保存作用域,以便在文本或肖像中使用;施展玩家无法控制其发生的功能性效果。


=== Immediate ===
会提示 "has happened"。
This is a block of effect script: it will be ran ''immediately'' as your event is triggered, before the title, description, portraits, are even evaluated let alone rendered. This block is useful for setting variables and saving scopes to use in your text or for portraits; or for functional effects that you want to happen without the player having any control over it.


"has happened" tooltip.
<pre>
immediate = { # 无论选择哪个选项,当事件出现在屏幕上时,它都会起作用。
add_gold = 50 # 给玩家增加50金钱
}
</pre>


=== Options ===
== 选项 ==
Options within events are able to be pressed by the user. Each event may have any number of options, including none at all (a common example includes hidden events). Each option in defined in the main event block, like so:
用户可以点击事件所提供选项。每个事件可以有任意数量的选项,包括没有选项(一个常见的例子是隐藏事件)。每个选项在事件的顶级块中定义,如下所示:
<pre>
<pre>
example.1 = {
example.1 = {


[...]
#[...]


option = {
option = {
# option info
# 选项内容
}
}


[...]
#[...]


}
}
</pre>
</pre>
The table below describes available keys within the <code>option</code> block:


以下是一个更复杂的例子:
<pre>
option = { # 选项名
name = stewardship_domain_special.1424.a
trigger_event = { # 让另一个事件发生
id = yearly.1012 # 事件ID是访问级别最高的内容(因此,只要事件存在,其ID就是有效、可访问的)。
days = { 7 14 } # 获取两个值之间的随机数(无法确定是否包括两个边界值),任何接受 "= {X Y}" 格式的内容如果只需要一个确定值则可以写成 "= X"。
}
hidden_effect = { # 隐藏选项提示中的内容
scope:county = { # 获取存储在作用域 "county" 中的位置信息。
add_county_modifier = { # 添加修正(奖励或惩罚)
modifier = governance_land_cleared_for_settlement_modifier
                 # 确保使用的修正类型正确,列表为https://ck3.parawikis.com/wiki/%E4%BF%AE%E6%AD%A3%E5%88%97%E8%A1%A8(在本例中为伯爵领)。
days = 3650 # 效果的持续时间,也可以用 days = {X Y}
}
}
}
ai_chance = {
base = 50 # 选择这个选项相比其他选项的机会有多大?(不必是0到100,可以是任何数值)
modifier = {  # 你可以根据各种因素来改变这个值,此处示范根据AI角色的特质进行修改。
add = 15
has_trait = sadistic # 特质可以在 ..\game\common\traits\00_traits.txt 中找到
}
modifier = {
add = -40 # 做减法则是加负数(5 + -10 = -5)。
has_trait = compassionate
}
}
}
</pre>
下表描述了 <code>option</code> 块中可用的键:
{| class="wikitable"
{| class="wikitable"
! Key
! Key
! Required
! 必需
! Description
! 描述
! Example
! 例子


|-
|-
| name
| name
| Yes
|
| Points to a localization key for the event option button text.
| 指向事件选项按钮文本的本地化键。
| name=example.1.a
| name=example.1.a


|-
|-
| (effects)
| (effects)
| No
|
| Any [[effect]]s that the option may have can be written directly in the <code>option</code> block.
| 选项可能产生的任何[[Effects|效果]] 都可以直接写在 <code>option</code> 块中。
| play_music_cue = mx_cue_banquet
| play_music_cue = mx_cue_banquet


|-
|-
| trigger
| trigger
| No
|
| Defines a [[trigger]] that has to be fulfilled for the option to be valid and thus available to the user. Not to be confused with the [[#Trigger|main event trigger]].
| 定义了一个必须满足的[[ 触发器]] ,以使选项有效并对用户可用。请注意,这与[[# 触发器| 事件的触发器]] 不同。
|
|
<pre>
<pre>
第482行: 第665行:
|-
|-
| show_as_unavailable
| show_as_unavailable
| No
|
| If the option is invalid, but this trigger is, the option will be shown, but disabled. This behavior is also influenced by the EVENT_OPTIONS_SHOWN_HIDE_UNAVAILABLE define.
| 如果选项无效,但此触发器有效,则选项将显示但被禁用。此行为还受EVENT_OPTIONS_SHOWN_HIDE_UNAVAILABLE定义的影响。
|
|
<pre>
<pre>
第490行: 第673行:
}
}
</pre>
</pre>
|-
| trait
| 否
| 如果玩家具有指定的特质,则在此选项的左侧显示它。将鼠标悬停在上面时,会显示该选项可用的原因是由于拥有该特质。这仅仅是为了增加趣味性,实际上并不影响选项的功能性。
|
trait = honest
|-
| skill
| 否
| 在选项的左侧显示指定的技能。将鼠标悬停在其上会显示选项可用,因为你的该技能水平较高。这只是为了增加趣味性,实际上并不影响选项的功能。
|
skill = prowess
|-
| add_internal_flag
| 否
| 可以取值为“特殊(special)”或“危险(dangerous)”。值"special"将选项以黄色突出显示,"dangerous"则以红色突出显示。这只是为了增加趣味性,实际上并不影响选项的功能。
|
add_internal_flag = special


|-
|-
| highlight_portrait
| highlight_portrait
| No
|
| Highlights the event portrait of this character while this option is hovered. This is in addition to the automatic highlighting when hovering an event option that has an effect that affects portrait characters.
| 当将光标悬停在此选项上时,高亮显示该角色的肖像。默认会对选项的效果所影响的角色的肖像高亮显示,此键值通常用于高亮其他的肖像。
| highlight_portrait = scope:custom
| highlight_portrait = scope:custom
|-
| fallback
| 否
| 设为是(yes)的时候:如果其他选项都不能满足其触发器,即使此选项的触发器也未满足,它也将显示出来。你可以将此选项与 <code>trigger = { always = no }</code> 结合使用,以创建一个只作为最后手段显示的选项。
| fallback = yes
|-
| exclusive
| 否
| 如果选项标记为exclusive = yes并且满足了触发条件,它将是唯一显示的选项。如果多个选项被标记为exclusive = yes并且每个选项都满足了各自的触发条件,那么它们都会被显示。
| exclusive = yes
|-
| flavor
| 否
| 在选项的提示中显示的风味文本。风味可以是本地化键(loc key)或具有first_valid的动态描述。
| flavor = my_events.1001.a.flavor
|}
|}


=== After ===
== 后处理 ==
This is a block of effect script that runs after the event has ran its course and an option has been chosen. Won't do anything if the event has no options (for hidden events, for example).
'''After''' 这是一个在事件完成并选择了一个选项后运行的效果脚本块。与[[#Immediate]]脚本块完全相同。如果事件没有选项(例如隐藏事件),则不会执行任何操作。<br>
它最常用于清理任务,删除可能会在不打算时持续存在的变量、字符和其他类型的数据。<br>
举个例子,在事件 <code>fp2_struggle.2009</code> 《抓到神秘盗贼》(Catching Thieves of Myth) 中,<code>after</code>块用于检查是否有保存的范围(用作布尔值),以决定在事件结束后是否应该删除事件生成的角色。
<pre>
after = {
if = {
limit = { NOT = { exists = scope:fp2_2009_thief_permanence_scope } } # 如果存在,则作为布尔值为真
scope:fp2_2009_garduna_young_thief = { silent_disappearance_effect = yes } # 我们将年轻的小偷除掉,因为他对未来的事态已经不再有用。
}
}
</pre>
 
== 部件 ==
{{Expand|}} Widgets 有哪些部件,并给出截图
 
==  触发动作 (on_action) ==
On Actions(触发动作)是游戏代码调用时,每次执行特定动作(如孩子出生、角色继承土地或使用牵制)时运行的脚本。<br>
这允许模组制作者在调用相关的"On Actions"时,拦截并运行自己的脚本。<br>
触发动作分为两个主要类型:
# 从代码中调用的内容。
# 脚本中调用的内容。
 
这些 on_action 脚本有一点奇怪,因为它不允许追加效果和触发器,这使得创建一个具有良好兼容性的模组变得不可能。然而,你可以通过以下方式实现类似的效果:
<pre>
on_birth_child = {
on_actions = { # "on_action" 内的 "on_actions" 已经被追加,因此可以安全地使用下面表格中的现有 on_action。
on_action_my_on_action
}
}
on_action_my_on_action = {
trigger = { ... }
effect = {... }
}
</pre>
如果您编写的脚本如下所示,触发器和效果将不会追加,因此在修改相同的 on_actions 的模组之间可能会发生冲突:
<pre>
on_birth_child = { # 下表中的一个 on_action
trigger = { ... }
effect = {... } # 触发和效果被覆盖,而非追加。
}
</pre>
 
=== on_actions中的变量 ===
表格中的内容来自 ''/common/on_action/on_actions.info'' 文件.
{| class="wikitable"
|+
!名称
!描述
!可能的数据类型
!例子
|-
|trigger
|on_actions可以有触发器。如果一个on_action触发并且其触发器返回false,则什么都不会发生。
|boolean
|<pre>
trigger = {
trigger_conditions = yes
}
</pre>
|-
|weight_multiplier
|如果此项是随机动作列表中的候选项(请参见下文),则用于操作其权重。
|integer
|<pre>
weight_multiplier = {
base = 1
modifier = {
add = 1
trigger_conditions = yes
}
}
</pre>
|-
|events
|只要触发器的返回结果为真,"events"括号中列出的事件将会触发。
|
|<pre>
events = {
event_id_1
delay = { days = 365 } # 延迟意味着在延迟时间过去之后,所有列在其后的事件才会被触发。 注意:出于性能原因,只有在 on_action 执行时以及延迟完成后,事件才能成功触发。所有的触发条目都支持延迟,无论是用于事件还是 on_action。
event_id_2
delay = { months = { 6 12 } } # 设置新的延迟会覆盖之前的延迟。延迟支持随机范围。
event_id_3
}
</pre>
|-
|random_events
|选择一个事件进行触发。
|
|<pre>
random_events = { # 选择一个事件进行触发。
chance_to_happen = 25 # 一个几率决定是否会对所涉及的事件进行评估


=== Widgets ===
chance_of_no_event = { # 一个可以格式化为脚本值的条目(因此可以具有条件条目)。出于性能原因,与“chance_to_happen”分开。仅在chance_to_happen为true时进行评估。
What types of widgets are there, with screenshots for each of what they look like.
value = 0
if = {
limit = { trigger_conditions = yes }
add = 10
}
}


== On_actions ==
100 = event_id_1 # 数字是选择特定事件的权重。该权重受到事件的weight_multiplier条目的影响。(如果事件没有定义weight_multiplier,权重将为1)
{{Expand‎|with=An explanation on what on_actions are, and how and for what they are used.}}
200 = event_id_2
On_actions are divided into two main types:
100 = 0 # 如果一个事件的条目为“0”,即使存在其他有效的事件,也有可能没有事件触发。这对于确保罕见事件不总是触发非常重要,因为其他可能的事件都无效。
# Those that are called from code.
# Those that are called from script.


=== On_actions from code ===
}
</pre>
|-
|first_valid
|选择第一个使触发器返回 true 的事件。
|List<event>
|<pre>
first_valid = { # 选择第一个使触发器返回 true 的事件。
event_id_1
event_id_2
fallback_event_without_trigger
}
</pre>
|-
|on_actions
|一个 on_action 可以触发其他 on_action,遵循与事件相同的规则。
|List<on_action>
|<pre>
on_actions = { #一个 on_action 可以触发其他 on_action,遵循与事件相同的规则。
on_action_1
on_action_2
on_action_3
}
</pre>
|-
|random_on_actions
|就像事件一样,对于on_actions,它们也受其weight_multipliers的影响,该值默认为1。
|
|<pre>
random_on_actions = {
100 = on_action_1
200 = on_action_2
100 = 0
}
</pre>
|-
|first_valid_on_action
|
|List<on_action>
|<syntaxhighlight>
first_valid_on_action = {
on_action_1
on_action_2
}
</pre>
|-
|effect
|on_action可以运行效果(effect)。它可以访问与触发它的脚本链/代码功能相同的默认(default)范围或保存(saved)范围(scope)。请注意,它与on_action触发的事件同时发生,而不是在之前。此处运行的效果会创建一个与on_action触发的事件不同的链,因此您不能在效果中操作值,然后可靠地在同时触发的事件中访问这些值。在这里设置的范围或局部变量不会传递到由on_action触发的任何事件。
|
|<pre>
effect = {
effects = yes
}
 
</pre>
|-
|fallback
|on_actions 可以定义一个回退 on_action。如果没有事件或 on_actions 被 on_action 运行,就会调用回退。避免创建无限回退循环,否则可能会阻止游戏时间的推进!
|on_action
|<pre>
fallback = another_on_action
</pre>
|}
 
 
=== 来自代码的 On_actions ===
{| class="wikitable sortable" width="100%"
{| class="wikitable sortable" width="100%"
! width="15%" | Name
! width="15%" | 名称
! width="15%" | Description
! width="15%" | 描述
! width="25%" | From code
! width="25%" | From code
! width="20%" | Expected scope
! width="20%" | 预计作用域
! width="20%" | Other
! width="20%" | 其他
|-
|-
|on_prestige_level_loss
|on_prestige_level_loss
第593行: 第978行:
|
|
|Yes
|Yes
|Character
|Casus belli
|
|
|-
|-
第886行: 第1,271行:
|
|
|Yes
|Yes
|None
|Casus belli
|
|
|-
|-
第1,070行: 第1,455行:
|}
|}


=== On_actions from script ===
=== 脚本中的On_actions ===
{{Expand‎}}
{{Expand‎}}


== Strategy ==
== 策略 ==
=== Triggering the event ===
=== 触发事件 ===
{{Expand‎}}
{{Expand‎}}
Should probably become its own page.
Should probably become its own page.
第1,082行: 第1,467行:
Pinging events, message events.
Pinging events, message events.


Other fancy ideas..
Other fancy ideas.


{{Modding navbox}}
{{Modding navbox}}
[[Category:模组制作]]
[[Category:模组制作]]
[[en:Event modding]]
[[en:Event modding]]

2024年3月27日 (三) 19:58的最新版本

事件是每个完善的模组的核心;是在游戏过程中可能发生在玩家身上的一系列或大或小的故事片段。

位置[编辑 | 编辑源代码]

事件的代码需要放在位于Mod文件夹中的events目录中的.txt文件中。每个文件可以容纳任意多个事件。如有需要,events目录下可以再建立子文件夹来存放事件文件。

结构[编辑 | 编辑源代码]

整体结构与CK2的事件相似,语法进行了一些调整,并添加了大量的额外功能,其中许多是可选的。以下是最基本的事件(其中每个元素会在后面的小节中进行解释):

namespace = example
example.1 = {
	desc = example.1.desc
	
	option = {
		name = example.1.a
	}
}

好了!将这段代码添加到你的模组中,在游戏内控制台输入"event example.1"来触发它,你就会得到一个可用的事件!这就是一个最基本的事件的结构,所有其他的内容都是可选的,但是编撰一个生动的事件时它们是必不可少的。以下是一个更为详细的事件示例(仅包含基础内容):

## 这是一个基础事件,可将其作为其他事件的基础(参考)。不过,您可能希望先删除这段注释垃圾。
superexample.1337 = { # 请使用注释(比如这个!)在此处填写事件名称,这样其他模组编写者就可以在不知道ID的情况下找到你正在处理的事件。
	type = character_event
	title = "A Modding Example Worthy of Kings" # 专业提示:在编写时,你可以使用字符串,稍后再用本地化替换它。
	desc = birth.1003.b # 对于Sublime用户而言,有一个非常出色的功能,即“在文件中查找”,非常适用于在本地化文件中探索。

	theme = mental_break
	left_portrait = root

	option = { # 在选项中使用注释来说明选项的内容或功能(例如:“不,我谴责你这个异端!”或“与孩子进行决斗”),这与事件标题的做法相似,这是一个很好的习惯。
		name = stewardship_domain_special.1424.a
	}
}

ID 和命名空间[编辑 | 编辑源代码]

命名空间(Namespaces)可以是任何由字母和数字组成的字符串(不包含'.'字符),会被用作前缀,形式为 <namespace>.<id> 。ID是对于一个事件的唯一标识。

如果一个事件文件使用一个命名空间,那么它必须在文件开头声明 namespace = <namespace> 。对每个使用该命名空间的文件都需要进行声明。

标志[编辑 | 编辑源代码]

标志(Flags)是决定你的事件种类和外观的顶级变量。它们有一组有限的取值。

Flag 意义 可能的取值
type 事件的类型决定了根(root)的作用域(scope)。
  • character_event
  • letter_event
  • duel_event
  • none (当一个事件完全不使用根作用域时)
  • empty (使一个无角色事件能被触发。注意:这意味着输入 type = empty )
hidden 将此设置为true,事件将不会显示;它将在后台执行。适用于进行对玩家并不立即相关的维护事件。 true, false

人物肖像[编辑 | 编辑源代码]

在《十字军之王3》中,人物肖像是3D的,而且是动态的啦!肖像由肖像位置和动画决定。

人物肖像定位[编辑 | 编辑源代码]

人物肖像效果
Portrait Position Description
left_portrait 在事件框的左侧显示肖像。
right_portrait 在事件框的右侧显示肖像。
lower_left_portrait 在事件框的左下方显示肖像。
lower_center_portrait 在事件框的下方中间显示肖像。
lower_right_portrait 在事件框的右下方显示肖像。

这是一个同时使用所有人物肖像位置的示例,效果截图如上图:

example_event.1001 = {
	left_portrait = {
		character = ROOT # 此处指定的人物会出现在事件框的指定位置,表现出指定的动画
		animation = fear # 注意,拥有某些角色的基因特质(比如巨人、侏儒)会改变人物模型,从而有不同的动作模组;如果你要求一个没有这个动作的模型的人物做将这些特有的动作,可能导致游戏崩溃
	}
	right_portrait = {
		character = ROOT
		animation = scheme
	}
	lower_left_portrait = {
		character = ROOT
	}
	lower_center_portrait = {
		character = ROOT
	}
	lower_right_portrait = {
		character = ROOT
	}
}

肖像可以使用以下参数:

参数 描述 示例
character 展示哪个角色的肖像 character = scope:event_target
animation 角色将显示哪种动画 animation = anger
triggered_animation 如果符合条件,人物将显示这种动画。如果不符合,将显示以animation = 语句设置的动画。
triggered_animation = {
	trigger = {}
	animation = fear
}
triggered_outfit 设置事件中使用的服装
triggered_outfit = {
	trigger = {}
	outfit_tags = no_clothes (可以使用多个tag,格式:outfit_tags = { tag1 tag2 })
	remove_default_outfit = yes/no
}
hide_info 避免显示人物的任何信息 (提示文字、盾徽、clicks等),只显示人物肖像 hide_info = yes/no

人物动画[编辑 | 编辑源代码]

与事件兼容的动画ID
idle chancellor steward marshal spymaster chaplain
anger rage disapproval disbelief disgust fear
sadness shame shock worry boredom grief
paranoia dismissal flirtation flirtation_left love schadenfreude
stress happiness ecstasy admiration lunatic scheme
beg pain poison aggressive_axe aggressive_mace aggressive_sword
aggressive_dagger aggressive_spear aggressive_hammer celebrate_axe celebrate_mace celebrate_sword
celebrate_dagger celebrate_spear celebrate_hammer loss_1 chess_certain_win chess_cocky
laugh lantern eyeroll eavesdrop assassin toast
toast_goblet drink drink_goblet newborn sick severelywounded
prisonhouse prisondungeon war_attacker war_defender war_over_tie war_over_win
war_over_loss pregnant personality_honorable personality_dishonorable personality_bold personality_coward
personality_greedy personality_content personality_vengeful personality_forgiving personality_rational personality_irrational
personality_compassionate personality_callous personality_zealous personality_cynical frontend_center_idle frontend_left_idle
frontend_right_idle throne_room_chancellor throne_room_kneel_1 throne_room_kneel_2 throne_room_curtsey_1 throne_room_messenger_1
throne_room_messenger_2 throne_room_messenger_3 throne_room_conversation_1 throne_room_conversation_2 throne_room_conversation_3 throne_room_conversation_4
throne_room_cheer_1 throne_room_cheer_2 throne_room_applaud_1 throne_room_bow_1 throne_room_bow_2 throne_room_bow_3
throne_room_one_handed_passive_1 throne_room_one_handed_passive_2 throne_room_two_handed_passive_1 throne_room_writer test_case_1 throne_room_ruler

主题[编辑 | 编辑源代码]

主题(Themes)是一类用于角色肖像的背景、照明环境和音效的集合。它们在 common/event_themes/ 目录中声明。

Theme
abduct_scheme alliance bastardy battle
befriend_scheme claim_throne_scheme corruption crown
culture_change death default diplomacy
diplomacy_family_focus diplomacy_foreign_affairs_focus diplomacy_majesty_focus dread
dungeon dynasty education fabricate_hook_scheme
faith family feast_activity friend_relation
friendly generic_intrigue_scheme healthcare hunt_activity
hunting intrigue intrigue_intimidation_focus intrigue_skulduggery_focus
intrigue_temptation_focus learning learning_medicine_focus learning_scholarship_focus
learning_theology_focus love lover_relation marriage
martial martial_authority_focus martial_chivalry_focus martial_strategy_focus
medicine mental_break mental_health murder_scheme
party pet physical_health pilgrimage_activity
pregnancy prison realm recovery
rival_relation romance_scheme secret seduce_scheme
seduction skull stewardship stewardship_domain_focus
stewardship_duty_focus stewardship_wealth_focus sway_scheme unfriendly
vassal war witchcraft

可以使用 override_background, override_icon, override_sound, and override_environment 来覆盖主题的各个元素。

背景[编辑 | 编辑源代码]

Background
alley_day alley_night armory army_camp
battlefield bedchamber burning_building corridor_day
corridor_night council_chamber courtyard docks
dungeon farmland feast gallows
garden market market_east market_india
market_tribal market_west physicians_study sitting_room
study tavern temple temple_church
temple_generic temple_mosque temple_scope terrain
terrain_activity terrain_scope throne_room throne_room_east
throne_room_india throne_room_mediterranean throne_room_scope throne_room_tribal
throne_room_west wilderness wilderness_desert wilderness_forest
wilderness_forest_pine wilderness_mountains wilderness_scope wilderness_steppe

环境[编辑 | 编辑源代码]

当您选择了一个背景之后,系统会自动选择适当的环境。仅在必要时才进行更改。

Environment
environment_body environment_council environment_cw_east_main
environment_cw_east_spouse environment_cw_east_throneroom_main environment_cw_east_throneroom_spouse
environment_cw_india_main environment_cw_india_spouse environment_cw_india_throneroom_main
environment_cw_india_throneroom_spouse environment_cw_mediterranean_main environment_cw_mediterranean_spouse
environment_cw_mediterranean_throneroom_main environment_cw_mediterranean_throneroom_spouse environment_cw_tavern
environment_cw_tavern_spouse environment_cw_tribal_main environment_cw_tribal_spouse
environment_cw_west environment_cw_west_spouse environment_event_alley
environment_event_alley_day environment_event_armory environment_event_battlefield
environment_event_bedchamber environment_event_church environment_event_corridor_day
environment_event_courtyard environment_event_desert environment_event_docks
environment_event_dungeon environment_event_farms environment_event_feast
environment_event_forest environment_event_forest_pine environment_event_gallows
environment_event_garden environment_event_genericcamp environment_event_market_east
environment_event_market_tribal environment_event_market_west environment_event_mosque
environment_event_mountains environment_event_sittingroom environment_event_standard
environment_event_steppe environment_event_study environment_event_study_physician
environment_event_tavern environment_event_temple environment_event_throne_room_west
environment_frontend_east_heir environment_frontend_east_main environment_frontend_east_secondary
environment_frontend_india_heir environment_frontend_india_main environment_frontend_india_secondary
environment_frontend_mediterranean_heir environment_frontend_mediterranean_main environment_frontend_mediterranean_secondary
environment_frontend_tribal_heir environment_frontend_tribal_main environment_frontend_tribal_secondary
environment_frontend_west_heir environment_frontend_west_main environment_frontend_west_secondary
environment_head environment_hud environment_portrait_editor
environment_shoulders environment_standard environment_torso
environment_war_overview

触发器[编辑 | 编辑源代码]

这是另一个使事件具有使用价值的要求。

trigger = { # 只有这些条件都满足,这个事件才可以触发(对于事件本身而言,这是一个巨大的IF语句)。
	culture = {
		has_innovation = innovation_guilds # 检查你的文化是否已解锁行会。
	}
}

还可以使用 trigger_if 将某些要求锁定在自己的触发器后面。只有在 limit 为真时,才会检查 trigger_if 中的要求。如果想在 trigger_if 为假时检查另一组要求,可以选择添加 trigger_else

trigger = {
	any_held_county = { # 检查是否持有一个建造了铁匠铺的地产
		any_county_province = {
			has_building_or_higher = blacksmiths_01
		}
	}

	trigger_if = { # 如果角色有贪婪的特质,需求增加500金币
		limit = { has_trait = greedy }
		gold > 500
	}
	trigger_else = { # 否则,必须至少拥有50点虔诚和10金币。
		piety > 50
        gold > 10
	}
}

触发失败[编辑 | 编辑源代码]

on_trigger_fail在trigger检验失败的时候运行。

描述[编辑 | 编辑源代码]

Description 解释如何组合多个字符串来构成描述,包括类似于first_valid和所有备选项的内容。

立即执行[编辑 | 编辑源代码]

这是一个效果脚本块:当事件被触发时,它将立即运行,甚至在标题、描述和肖像被运算确定和渲染之前。这个脚本块常见的用途是:设置变量和保存作用域,以便在文本或肖像中使用;施展玩家无法控制其发生的功能性效果。

会提示 "has happened"。

immediate = { # 无论选择哪个选项,当事件出现在屏幕上时,它都会起作用。
	add_gold = 50 # 给玩家增加50金钱 
}

选项[编辑 | 编辑源代码]

用户可以点击事件所提供选项。每个事件可以有任意数量的选项,包括没有选项(一个常见的例子是隐藏事件)。每个选项在事件的顶级块中定义,如下所示:

example.1 = {

	#[...]

	option = {
		# 选项内容
	}

	#[...]

}

以下是一个更复杂的例子:

option = { # 选项名
	name = stewardship_domain_special.1424.a
	trigger_event = { # 让另一个事件发生
		id = yearly.1012 # 事件ID是访问级别最高的内容(因此,只要事件存在,其ID就是有效、可访问的)。
		days = { 7 14 } # 获取两个值之间的随机数(无法确定是否包括两个边界值),任何接受 "= {X Y}" 格式的内容如果只需要一个确定值则可以写成 "= X"。
	}

	hidden_effect = { # 隐藏选项提示中的内容
		scope:county = { # 获取存储在作用域 "county" 中的位置信息。
			add_county_modifier = { # 添加修正(奖励或惩罚)
				modifier = governance_land_cleared_for_settlement_modifier 
                                # 确保使用的修正类型正确,列表为https://ck3.parawikis.com/wiki/%E4%BF%AE%E6%AD%A3%E5%88%97%E8%A1%A8(在本例中为伯爵领)。
				days = 3650 # 效果的持续时间,也可以用 days = {X Y}
			}
		}
	}

	ai_chance = {
		base = 50 # 选择这个选项相比其他选项的机会有多大?(不必是0到100,可以是任何数值)
		modifier = {  # 你可以根据各种因素来改变这个值,此处示范根据AI角色的特质进行修改。
			add = 15
			has_trait = sadistic # 特质可以在 ..\game\common\traits\00_traits.txt 中找到
		}
		modifier = {
			add = -40 # 做减法则是加负数(5 + -10 = -5)。
			has_trait = compassionate
		}
	}
}

下表描述了 option 块中可用的键:

Key 必需 描述 例子
name 指向事件选项按钮文本的本地化键。 name=example.1.a
(effects) 选项可能产生的任何效果都可以直接写在 option 块中。 play_music_cue = mx_cue_banquet
trigger 定义了一个必须满足的触发器,以使选项有效并对用户可用。请注意,这与事件的触发器不同。
trigger = {
	has_trait = shy
}
show_as_unavailable 如果选项无效,但此触发器有效,则选项将显示但被禁用。此行为还受EVENT_OPTIONS_SHOWN_HIDE_UNAVAILABLE定义的影响。
show_as_unavailable = {
	short_term_gold < medium_gold_value
}
trait 如果玩家具有指定的特质,则在此选项的左侧显示它。将鼠标悬停在上面时,会显示该选项可用的原因是由于拥有该特质。这仅仅是为了增加趣味性,实际上并不影响选项的功能性。

trait = honest


skill 在选项的左侧显示指定的技能。将鼠标悬停在其上会显示选项可用,因为你的该技能水平较高。这只是为了增加趣味性,实际上并不影响选项的功能。

skill = prowess


add_internal_flag 可以取值为“特殊(special)”或“危险(dangerous)”。值"special"将选项以黄色突出显示,"dangerous"则以红色突出显示。这只是为了增加趣味性,实际上并不影响选项的功能。

add_internal_flag = special


highlight_portrait 当将光标悬停在此选项上时,高亮显示该角色的肖像。默认会对选项的效果所影响的角色的肖像高亮显示,此键值通常用于高亮其他的肖像。 highlight_portrait = scope:custom
fallback 设为是(yes)的时候:如果其他选项都不能满足其触发器,即使此选项的触发器也未满足,它也将显示出来。你可以将此选项与 trigger = { always = no } 结合使用,以创建一个只作为最后手段显示的选项。 fallback = yes
exclusive 如果选项标记为exclusive = yes并且满足了触发条件,它将是唯一显示的选项。如果多个选项被标记为exclusive = yes并且每个选项都满足了各自的触发条件,那么它们都会被显示。 exclusive = yes
flavor 在选项的提示中显示的风味文本。风味可以是本地化键(loc key)或具有first_valid的动态描述。 flavor = my_events.1001.a.flavor

后处理[编辑 | 编辑源代码]

After 这是一个在事件完成并选择了一个选项后运行的效果脚本块。与#Immediate脚本块完全相同。如果事件没有选项(例如隐藏事件),则不会执行任何操作。
它最常用于清理任务,删除可能会在不打算时持续存在的变量、字符和其他类型的数据。
举个例子,在事件 fp2_struggle.2009 《抓到神秘盗贼》(Catching Thieves of Myth) 中,after块用于检查是否有保存的范围(用作布尔值),以决定在事件结束后是否应该删除事件生成的角色。

after = {
	if = {
		limit = { NOT = { exists = scope:fp2_2009_thief_permanence_scope } } # 如果存在,则作为布尔值为真
		scope:fp2_2009_garduna_young_thief = { silent_disappearance_effect = yes } # 我们将年轻的小偷除掉,因为他对未来的事态已经不再有用。
	}
}

部件[编辑 | 编辑源代码]

Widgets 有哪些部件,并给出截图

触发动作 (on_action)[编辑 | 编辑源代码]

On Actions(触发动作)是游戏代码调用时,每次执行特定动作(如孩子出生、角色继承土地或使用牵制)时运行的脚本。
这允许模组制作者在调用相关的"On Actions"时,拦截并运行自己的脚本。
触发动作分为两个主要类型:

  1. 从代码中调用的内容。
  2. 脚本中调用的内容。

这些 on_action 脚本有一点奇怪,因为它不允许追加效果和触发器,这使得创建一个具有良好兼容性的模组变得不可能。然而,你可以通过以下方式实现类似的效果:

on_birth_child = { 
	on_actions = { # "on_action" 内的 "on_actions" 已经被追加,因此可以安全地使用下面表格中的现有 on_action。
		on_action_my_on_action 
	} 
} 
on_action_my_on_action = { 
	trigger = { ... } 
	effect = {... } 
}

如果您编写的脚本如下所示,触发器和效果将不会追加,因此在修改相同的 on_actions 的模组之间可能会发生冲突:

on_birth_child = { # 下表中的一个 on_action 
	trigger = { ... } 
	effect = {... } # 触发和效果被覆盖,而非追加。 
}

on_actions中的变量[编辑 | 编辑源代码]

表格中的内容来自 /common/on_action/on_actions.info 文件.

名称 描述 可能的数据类型 例子
trigger on_actions可以有触发器。如果一个on_action触发并且其触发器返回false,则什么都不会发生。 boolean
trigger = {
	trigger_conditions = yes
}
weight_multiplier 如果此项是随机动作列表中的候选项(请参见下文),则用于操作其权重。 integer
weight_multiplier = {
	base = 1
	modifier = {
		add = 1
		trigger_conditions = yes
	}
}
events 只要触发器的返回结果为真,"events"括号中列出的事件将会触发。
events = {
	event_id_1
	delay = { days = 365 }		# 延迟意味着在延迟时间过去之后,所有列在其后的事件才会被触发。 注意:出于性能原因,只有在 on_action 执行时以及延迟完成后,事件才能成功触发。所有的触发条目都支持延迟,无论是用于事件还是 on_action。
	event_id_2
	delay = { months = { 6 12 } }	# 设置新的延迟会覆盖之前的延迟。延迟支持随机范围。
	event_id_3
}
random_events 选择一个事件进行触发。
random_events = {	# 选择一个事件进行触发。
		
	chance_to_happen = 25	# 一个几率决定是否会对所涉及的事件进行评估

	chance_of_no_event = { 	# 一个可以格式化为脚本值的条目(因此可以具有条件条目)。出于性能原因,与“chance_to_happen”分开。仅在chance_to_happen为true时进行评估。
		value = 0
		if = {
			limit = { trigger_conditions = yes }
			add = 10
		}
	}

	100 = event_id_1 	# 数字是选择特定事件的权重。该权重受到事件的weight_multiplier条目的影响。(如果事件没有定义weight_multiplier,权重将为1)
	200 = event_id_2
	100 = 0		# 如果一个事件的条目为“0”,即使存在其他有效的事件,也有可能没有事件触发。这对于确保罕见事件不总是触发非常重要,因为其他可能的事件都无效。

}
first_valid 选择第一个使触发器返回 true 的事件。 List<event>
first_valid = {		# 选择第一个使触发器返回 true 的事件。
	event_id_1
	event_id_2
	fallback_event_without_trigger
}
on_actions 一个 on_action 可以触发其他 on_action,遵循与事件相同的规则。 List<on_action>
on_actions = {	#一个 on_action 可以触发其他 on_action,遵循与事件相同的规则。
	on_action_1
	on_action_2
	on_action_3
}
random_on_actions 就像事件一样,对于on_actions,它们也受其weight_multipliers的影响,该值默认为1。
random_on_actions = {
	100 = on_action_1
	200 = on_action_2
	100 = 0
}
first_valid_on_action List<on_action> <syntaxhighlight>

first_valid_on_action = { on_action_1 on_action_2 }

effect on_action可以运行效果(effect)。它可以访问与触发它的脚本链/代码功能相同的默认(default)范围或保存(saved)范围(scope)。请注意,它与on_action触发的事件同时发生,而不是在之前。此处运行的效果会创建一个与on_action触发的事件不同的链,因此您不能在效果中操作值,然后可靠地在同时触发的事件中访问这些值。在这里设置的范围或局部变量不会传递到由on_action触发的任何事件。
effect = {
	effects = yes
}

fallback on_actions 可以定义一个回退 on_action。如果没有事件或 on_actions 被 on_action 运行,就会调用回退。避免创建无限回退循环,否则可能会阻止游戏时间的推进! on_action
fallback = another_on_action


来自代码的 On_actions[编辑 | 编辑源代码]

名称 描述 From code 预计作用域 其他
on_prestige_level_loss Yes None
on_rank_down Yes None
on_weight_changed Yes Character
on_faith_monthly Yes Faith
on_knight_combat_pulse Yes Character
on_war_invalidated Yes None
on_war_transferred Yes Character
on_divorce Yes None
on_leave_court Yes Character
on_guest_ready_to_move_to_pool Yes Character
on_guest_arrived_from_pool Yes Character
on_siege_completion Yes Character
on_war_won_attacker Yes Casus belli
on_alliance_added Yes None
on_pregnancy_mother Yes Character
on_raid_action_start Yes None
on_county_faith_change Yes Landed Title
on_title_gain_usurpation Yes None
on_release_from_prison Yes Character
random_yearly_playable_pulse Yes Character
on_raid_action_completion Yes Army
on_death Yes Character
on_birth_father Yes None
on_betrothal_broken Yes None
on_war_white_peace Yes None
three_year_playable_pulse Yes Character
on_defeat_raid_army Yes Army
on_army_enter_province Yes Character
on_join_court Yes Character
on_fired_from_council Yes Character
on_raid_loot_delivered Yes Army
on_pregnancy_ended_mother Yes None
on_title_lost Yes None
on_title_gain Yes Character
on_character_culture_change Yes Character
on_birth_child Yes Character
on_holy_order_hired Yes None
on_great_holy_war_invalidation Yes Great Holy War
on_combat_end_loser Yes Combat Side
on_concubinage Yes None
on_commander_combat_pulse Yes Character
random_yearly_everyone_pulse Yes Character
five_year_everyone_pulse Yes Character
on_perks_refunded Yes None
quarterly_playable_pulse Yes None
on_prestige_level_gain Yes None
on_faith_created Yes Character
on_holy_order_new_lease Yes None
on_title_gain_inheritance Yes None
on_game_start Yes None
on_character_faith_change Yes Character
on_combat_end_winner Yes Combat Side
on_courtier_decided_to_move_to_pool Yes Character
on_culture_era_changed Yes None
on_birthday Yes Character
on_faith_conversion Yes Character
on_raid_action_weekly Yes None
on_explicit_claim_gain Yes Character
on_courtier_ready_to_move_to_pool Yes Character
on_potential_great_holy_war_invalidation Yes Great Holy War
on_holy_order_destroyed Yes None
on_war_won_defender Yes Casus belli
yearly_global_pulse Yes None
on_great_holy_war_countdown_end Yes GreaT Holy War
yearly_playable_pulse Yes Character
three_year_pool_pulse Yes Character
on_pregnancy_father Yes None
on_piety_level_loss Yes None
on_piety_level_gain Yes None
on_siege_looting Yes None
on_title_destroyed Yes None
on_army_monthly Yes None
on_game_start_after_lobby Yes None
on_imprison Yes Character
on_birth_mother Yes Character
on_dynasty_created Yes None
on_alliance_removed Yes None
on_county_occupied Yes None
on_rank_up Yes None
on_vassal_become_powerful Yes None
on_join_war_as_secondary Yes Character
on_explicit_claim_lost Yes Character
on_alliance_broken Yes None
on_natural_death_second_chance Yes None
on_leave_council Yes Character
on_county_culture_change Yes None
on_war_started Yes None
on_marriage Yes Character
on_great_holy_war_participant_replaced Yes Character
five_year_playable_pulse Yes Character
on_birth_real_father Yes None
on_game_start_with_tutorial Yes None

脚本中的On_actions[编辑 | 编辑源代码]

策略[编辑 | 编辑源代码]

触发事件[编辑 | 编辑源代码]

Should probably become its own page.

Techniques and design patterns[编辑 | 编辑源代码]

Pinging events, message events.

Other fancy ideas.