该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。
最后版本 | 您的文本 | ||
第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. | |||
==位置== | ==位置== | ||
事件 | 事件 属于 位于[[模组结构#Mod文件夹|root Mod folder]] 正下方 的<code>Events</code>目录中的.txt文件。每个文件可以容纳任意多个事件。<code>events</code>目录 也 可以 有包含自己事件文件的 子文件夹 (如果愿意的话) 。 | ||
== 结构 == | == 结构 == | ||
整体结构与[[ | 整体结构与[[CKII:Event_modding|CK2的事件]]相似,语法进行了一些调整,并添加了大量的额外功能,其中许多是可选的。以下是最基本的事件(其中每个元素会在后面的小节中 提到 ): | ||
<syntaxhighlight lang="coffeescript"> | <syntaxhighlight lang="coffeescript"> | ||
namespace = example | namespace = example | ||
第21行: | 第21行: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
好了!将这段代码添加到你的模组中,在游戏内控制台输入"event example.1"来触发它,你就会得到一个可用的事件!这就是一个最基本的事件 | 好了!将这段代码添加到你的模组中,在游戏内控制台输入"event example.1"来触发它,你就会得到一个可用的事件!这就是一个最基本的事件结构,其他的内容都是可选的,但是 它们在完善 事件时是必 须 的。以下是一个更为详细的 活动 示例(仅包含基础内容): | ||
<syntaxhighlight lang="coffeescript"> | <syntaxhighlight lang="coffeescript"> | ||
第28行: | 第28行: | ||
type = character_event | type = character_event | ||
title = "A Modding Example Worthy of Kings" # 专业提示:在编写时,你可以使用字符串,稍后再用本地化替换它。 | title = "A Modding Example Worthy of Kings" # 专业提示:在编写时,你可以使用字符串,稍后再用本地化替换它。 | ||
desc = birth.1003.b # 对于Sublime用户而言,有一个非常出色的功能,即“在文件中查找”,非常适用于 | desc = birth.1003.b # 对于Sublime用户而言,有一个非常出色的功能,即“在文件中查找”,非常适用于 查找代码 。 | ||
theme = mental_break | theme = mental_break | ||
第40行: | 第40行: | ||
=== ID 和命名空间 === | === ID 和命名空间 === | ||
命名空间(Namespaces)可以是任何由字母和数字组成的字符串(不包含'.'字符), | 命名空间(Namespaces)可以是任何由字母和数字组成的字符串(不包含'.'字符), 并且 用作前缀,形式为 <code><namespace>.<id></code> 。ID是对于一个事件的唯一标识。<br> | ||
如果一个事件文件使用一个命名空间,那么它必须在文件开头声明 <code>namespace = <namespace></code> 。对每个使用该命名空间的文件都需要进行声明。 | 如果一个事件文件使用一个命名空间,那么它必须在文件开头声明 <code>namespace = <namespace></code> 。对每个使用该命名空间的文件都需要进行声明。 | ||
=== | === 旗帜 === | ||
这些 是决定你的事件种类和外观的顶级变量。它们有一组有限的取值。 | |||
{| class="wikitable" | {| class="wikitable" | ||
第52行: | 第51行: | ||
|- | |- | ||
| type | | type | ||
|| 事件的类型决定了根(root)的 | || 事件的类型决定了根(root)的 范围(scope)。 | ||
|| | || | ||
* character_event | * character_event | ||
* letter_event | * letter_event | ||
* none (当一个事件完全不使用作用域时) | |||
* none (当一个事件完全不使用 | * empty (一个无角色事件 必须的 触发 器 。注意:这意味着输入 type = empty ) | ||
* empty ( | |||
|- | |- | ||
| hidden | | hidden | ||
第66行: | 第64行: | ||
== 人物肖像 == | == 人物肖像 == | ||
在《十字军之王3》中,人物肖像是3D的,而且 | 在《十字军之王3》中,人物肖像是3D的,而且 还有 动 画 啦! 肖像由 不同的 肖像位置 列表 和动画 列表 决定。 | ||
=== 人物肖像定位 === | === 人物肖像定位 === | ||
第82行: | 第80行: | ||
| lower_left_portrait || 在事件框的左下方显示肖像。 | | lower_left_portrait || 在事件框的左下方显示肖像。 | ||
|- | |- | ||
| lower_center_portrait || 在事件框的下方 | | lower_center_portrait || 在事件框的 正 下方显示肖像。 | ||
|- | |- | ||
| lower_right_portrait || 在事件框的右下方显示肖像。 | | lower_right_portrait || 在事件框的右下方显示肖像。 | ||
|} | |} | ||
这是一个同时使用所有人物肖像位置的示例,效果截 | 这是一个同时使用所有人物肖像位置的示例, 附 效果截图: | ||
<pre> | <pre> | ||
example_event.1001 = { | example_event.1001 = { | ||
left_portrait = { | left_portrait = { | ||
character = ROOT # | character = ROOT # Whoever this is scoped to will show up in this event window position, exhibiting the chosen animation. | ||
animation = fear # | 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. | ||
} | } | ||
right_portrait = { | right_portrait = { | ||
第127行: | 第125行: | ||
| triggered_outfit|| 设置事件中使用的服装 ||<pre>triggered_outfit = { | | triggered_outfit|| 设置事件中使用的服装 ||<pre>triggered_outfit = { | ||
trigger = {} | trigger = {} | ||
outfit_tags = no_clothes | outfit_tags = no_clothes (also accepts multiple tags, in the format outfit_tags = { tag1 tag2 } | ||
remove_default_outfit = yes/no | remove_default_outfit = yes/no | ||
}</pre> | }</pre> | ||
|- | |- | ||
| hide_info|| 避免显示人物的任何信息 (提示文字 | | hide_info|| 避免显示人物的任何信息 (提示文字, 盾徽, clicks 等). 只 会 显示人物肖像 ||<code>hide_info = yes/no</code> | ||
|} | |} | ||
=== | === Animations === | ||
{|class="wikitable" | {|class="wikitable" | ||
|- | |- | ||
!colspan=" | !colspan="4"|Animation | ||
|- | |- | ||
| | | admiration | ||
| | | anger | ||
| | | beg | ||
| | | boredom | ||
|- | |- | ||
| disapproval | | disapproval | ||
| disbelief | | disbelief | ||
| disgust | | disgust | ||
| dismissal | |||
|- | |||
| ecstasy | |||
| fear | | fear | ||
| flirtation | | flirtation | ||
| flirtation_left | | flirtation_left | ||
|- | |- | ||
| | | grief | ||
| happiness | | happiness | ||
| | | idle | ||
| | | love | ||
|- | |- | ||
| | | newborn | ||
| pain | | pain | ||
| | | paranoia | ||
| | | personality_bold | ||
|- | |- | ||
| | | personality_callous | ||
| | | personality_compassionate | ||
| | | personality_content | ||
| | | personality_coward | ||
|- | |- | ||
| | | personality_cynical | ||
| | | personality_dishonorable | ||
| | | personality_forgiving | ||
| | | personality_greedy | ||
|- | |- | ||
| personality_honorable | | personality_honorable | ||
| | | personality_irrational | ||
| | | personality_rational | ||
| personality_vengeful | | personality_vengeful | ||
|- | |- | ||
| personality_zealous | | personality_zealous | ||
| | | prison_dungeon | ||
| | | rage | ||
| | | sadness | ||
|- | |- | ||
| | | schadenfreude | ||
| | | scheme | ||
| | | severelyinjured | ||
| | | severelywounded | ||
|- | |- | ||
| | | shame | ||
| | | shock | ||
| | | sick | ||
| | | stress | ||
|- | |- | ||
| | | war_attacker | ||
| | | war_defender | ||
| | | war_over_win | ||
| | | worry | ||
|} | |} | ||
== | == Themes == | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
第362行: | 第293行: | ||
|} | |} | ||
Individidual elements of the theme can be overridden using <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 | ||
第429行: | 第360行: | ||
|} | |} | ||
=== | === 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 | ||
第534行: | 第465行: | ||
|} | |} | ||
== | == Trigger == | ||
This is an additional requirement for an event to work. | |||
=== on_trigger_fail === | |||
Runs when the trigger fails. | |||
== Description == | |||
Explain how a description can be composed of multiple strings; with stuff like first_valid, and all the alternatives. | |||
== Immediate == | |||
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. | |||
== 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: | |||
{| 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. | ||
| 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> | ||
第665行: | 第527行: | ||
|- | |- | ||
| 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. | ||
| | | | ||
<pre> | <pre> | ||
第676行: | 第538行: | ||
|- | |- | ||
| trait | | trait | ||
| | | No | ||
| | | If the player has the given trait, show it on the left side of the option. Hovering over it will say the option is available because of the trait. This is only providing flavor, and does not actually affect the functionality of the option. | ||
| | | | ||
trait = honest | trait = honest | ||
第684行: | 第546行: | ||
|- | |- | ||
| skill | | skill | ||
| | | No | ||
| | | Show the chosen skill on the left side of the option. Hovering over it will say the option is available because of your high skill. This is only providing flavor, and does not actually affect the functionality of the option. | ||
| | | | ||
skill = prowess | skill = prowess | ||
第692行: | 第554行: | ||
|- | |- | ||
| add_internal_flag | | add_internal_flag | ||
| | | No | ||
| | | Can take the values "special" or "dangerous". The key "special" highlights the option as yellow, "dangerous" highlights the option as red. This is only providing flavor, and does not actually affect the functionality of the option. | ||
| | | | ||
add_internal_flag = special | add_internal_flag = special | ||
第700行: | 第562行: | ||
|- | |- | ||
| 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 | ||
|} | |} | ||
== | == 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). | |||
== Widgets == | |||
What types of widgets are there, with screenshots for each of what they look like. | |||
== On_actions == | |||
{{Expand|with=An explanation on what on_actions are, and how and for what they are used.}} | |||
On_actions are divided into two main types: | |||
# Those that are called from code. | |||
# Those that are called from script. | |||
=== | === On_actions from code === | ||
{| class="wikitable sortable" width="100%" | {| class="wikitable sortable" width="100%" | ||
! width="15%" | | ! width="15%" | Name | ||
! width="15%" | | ! width="15%" | Description | ||
! width="25%" | From code | ! width="25%" | From code | ||
! width="20%" | | ! width="20%" | Expected scope | ||
! width="20%" | | ! width="20%" | Other | ||
|- | |- | ||
|on_prestige_level_loss | |on_prestige_level_loss | ||
第1,455行: | 第1,139行: | ||
|} | |} | ||
=== | === On_actions from script === | ||
{{Expand}} | {{Expand}} | ||
== | == Strategy == | ||
=== | === Triggering the event === | ||
{{Expand}} | {{Expand}} | ||
Should probably become its own page. | Should probably become its own page. |