该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。
最后版本 | 您的文本 | ||
第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 structure\Mod folder | 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行: | 第23行: | ||
} | } | ||
} | } | ||
</ | </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 === | |||
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. | |||
{| 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 | * 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行: | 第56行: | ||
! 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行: | 第90行: | ||
</pre> | </pre> | ||
=== Animations === | |||
{|class="wikitable" | {|class="wikitable" | ||
|- | |- | ||
!colspan=" | !colspan="4"|Animation | ||
|- | |- | ||
| | | happiness(高兴) | ||
| | | dismissal(免职) | ||
| | | prison_dungeon(监狱地牢) | ||
| | | admiration(敬佩) | ||
|- | |- | ||
| | | disgust(厌恶) | ||
| schadenfreude(幸灾乐祸) | |||
| stress(紧张) | |||
| | | personality_compassionate(同情) | ||
| | |||
| | |||
|- | |- | ||
| | | pain(痛苦) | ||
| | | ecstasy(狂喜) | ||
| | | fear(恐惧) | ||
| | | rage(愤怒) | ||
|- | |- | ||
| | | anger(生气) | ||
| flirtation_left (挑逗[左侧]) | |||
| shame(害羞) | |||
| flirtation_left | | boredom(厌倦) | ||
| | |||
| | |||
|- | |- | ||
| | | shock(震惊) | ||
| | | worry(担忧) | ||
| | | scheme(诡计) | ||
| personality_bold(大胆) | |||
| | |||
|- | |- | ||
| | | personality_callous(无情) | ||
| | | personality_irrational(歇斯底里) | ||
| | | personality_content(满足) | ||
| | | flirtation(挑逗) | ||
|- | |- | ||
|- | |- | ||
| | | disbelief(怀疑) | ||
| | | personality_cynical(愤世嫉俗) | ||
| | | personality_rational(理性) | ||
| | | personality_dishonorable(无耻) | ||
|- | |- | ||
| | | idle(无所事事) | ||
| | | paranoia(偏执) | ||
| | | personality_vengeful(复仇) | ||
| | | disapproval(不同意) | ||
|- | |- | ||
| | | sick(生病) | ||
| | | beg(恳求) | ||
| | | personality_zealous(热情) | ||
| newborn | | newborn (婴儿) | ||
|- | |- | ||
| | | love(喜爱) | ||
| | | sadness(沮丧) | ||
| | | personality_honorable(可敬) | ||
| | | personality_forgiving(宽容) | ||
|- | |- | ||
| | | personality_greedy(吝啬) | ||
| | | personality_coward(懦弱) | ||
| severelyinjured(受伤) | |||
| severelywounded(创伤) | |||
| | |||
| | |||
|- | |- | ||
| | | war_attacker(进攻者) | ||
| | | war_defender(防御者) | ||
| | | war_over_win(胜利者) | ||
| | | grief(悲伤) | ||
|} | |} | ||
== | === Themes === | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
第362行: | 第252行: | ||
|} | |} | ||
override_background, override_icon, override_sound, override_environment | |||
==== | ==== Backgrounds ==== | ||
{| class="wikitable" | {| class="wikitable" | ||
!colspan="4"|Background | !colspan="4"|Background | ||
第429行: | 第319行: | ||
|} | |} | ||
=== | ==== 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行: | 第424行: | ||
|} | |} | ||
== | === 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行: | 第486行: | ||
|- | |- | ||
| 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行: | 第497行: | ||
|- | |- | ||
| 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行: | 第505行: | ||
|- | |- | ||
| 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行: | 第513行: | ||
|- | |- | ||
| 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行: | 第521行: | ||
|- | |- | ||
| 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 | ||
第978行: | 第621行: | ||
| | | | ||
|Yes | |Yes | ||
| | |Character | ||
| | | | ||
|- | |- | ||
第1,271行: | 第914行: | ||
| | | | ||
|Yes | |Yes | ||
| | |None | ||
| | | | ||
|- | |- | ||
第1,455行: | 第1,098行: | ||
|} | |} | ||
=== | === On_actions from script === | ||
{{Expand}} | {{Expand}} | ||
== | == Strategy == | ||
=== | === Triggering the event === | ||
{{Expand}} | {{Expand}} | ||
Should probably become its own page. | Should probably become its own page. | ||
第1,467行: | 第1,110行: | ||
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]] |