该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。
最后版本 | 您的文本 | ||
第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>目录 也 可以 有包含自己事件文件的 子文件夹 (如果愿意的话) 。 | ||
== | == 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. | |||
< | |||
<pre> | |||
example.1 = { | example.1 = { | ||
desc = example.1.desc | desc = example.1.desc | ||
第19行: | 第19行: | ||
} | } | ||
} | } | ||
</ | </pre> | ||
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. | |||
=== ID and namespace === | |||
Namespaces can be any alphanumeric string (without the '.' character), and are used as prefix in the form <code><namespace>.<id></code>. The ID uniquely identifies your event. | |||
If an event file uses a namespace, it has to be declared at the beginning of the file with <code>namespace = <namespace></code>. This has to be done for every file the namespace is used in. | |||
=== | === Flags === | ||
These are top-level variables that determine your event's kind and appearance. They have a limited set of values. | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Flag !! | ! Flag !! Meaning !! Possible values | ||
|- | |- | ||
| type | | type | ||
|| | || The kind of event. It determines what sort of scope the root is. | ||
|| | || | ||
* character_event | * character_event | ||
* letter_event | * letter_event | ||
* none (when an event doesn't use the root scope at all) | |||
* none | |||
|- | |- | ||
| hidden | | 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. | ||
|| | |||
|| 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. | |||
=== | === Portrait Positions === | ||
[[File:Example event.png|thumb|left| | [[File:Example event.png|thumb|left|Portrait Positions]] | ||
{| class="wikitable" | {| class="wikitable" | ||
第76行: | 第55行: | ||
! Portrait Position !! Description | ! Portrait Position !! Description | ||
|- | |- | ||
| left_portrait || | | left_portrait || Shown on the left side of the event scene. | ||
|- | |- | ||
| right_portrait || | | right_portrait || Shown on the right side of the event scene. | ||
|- | |- | ||
| lower_left_portrait || | | lower_left_portrait || Shown on the lower left part of the event scene. | ||
|- | |- | ||
| lower_center_portrait || | | lower_center_portrait || Shown on the lower center part of the event scene. | ||
|- | |- | ||
| lower_right_portrait || | | lower_right_portrait || Shown on the lower right part of the event scene. | ||
|} | |} | ||
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 # | 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 = { | ||
第110行: | 第89行: | ||
</pre> | </pre> | ||
Portraits can take the following parameters: | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! | ! Parameter !! Description !! Example | ||
|- | |- | ||
| character|| | | character|| The character whose portrait is shown. || <code>character = scope:event_target</code> | ||
|- | |- | ||
| animation|| | | animation|| The animation that will play || <code>animation = anger</code> | ||
|- | |- | ||
| triggered_animation|| | | triggered_animation|| Plays a certain animation if the triggers are met. If not, will default to animation set with <code>animation = </code> || <pre>triggered_animation = { | ||
trigger = {} | trigger = {} | ||
animation = fear | animation = fear | ||
}</pre> | }</pre> | ||
|- | |- | ||
| triggered_outfit|| | | triggered_outfit|| Set an outfit for use in this event. || <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|| Prevents the game from showing any info on the character (tooltip, COA, clicks, etc). Only the portrait will be shown. || <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行: | 第274行: | ||
|} | |} | ||
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行: | 第341行: | ||
|} | |} | ||
=== | === 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行: | 第446行: | ||
|} | |} | ||
== | == 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行: | 第508行: | ||
|- | |- | ||
| 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行: | 第519行: | ||
|- | |- | ||
| 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行: | 第527行: | ||
|- | |- | ||
| 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行: | 第535行: | ||
|- | |- | ||
| 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行: | 第543行: | ||
|- | |- | ||
| 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,120行: | ||
|} | |} | ||
=== | === On_actions from script === | ||
{{Expand}} | {{Expand}} | ||
== | == Strategy == | ||
=== | === Triggering the event === | ||
{{Expand}} | {{Expand}} | ||
Should probably become its own page. | Should probably become its own page. |