Events are the meat of every well-rounded mod; smaller and larger bits of story that can happen to a player during the campaign. In order to mod new ones in, you should start with an empty txt file in the events directory below your mod's root folder.
Structure
The overall structure is similar to that of a 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.
example.1 = { desc = example.1.desc option = { name = example.1.a } }
There you go! Add this to your mod, trigger it from the in-game console, 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.
Flag | Meaning | Possible values |
---|---|---|
type | The kind of event. It determines what sort of scope the root is (WHY WOULD ONE ADD THIS FLAG?). | * character_event
|
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 |
Isn't there one for pausing too?
Portraits
Positions. List of possible animations.
Themes
A list of implemented themes.
override_background, override_icon, override_sound, override_environment
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
Name is required.
After
This is a block of effect script that runs after the event has ran its course and an option has been chosen.
Widgets
What types of widgets are there, with screenshots for each of what they look like.
Strategy
Triggering the event
Should probably become its own page.
Techniques and design patterns
Pinging events, message events.
Other fancy ideas.
文档 | Effects • 触发器 • 修正 • 作用域 • 变量 • 数据类型 • 本地化 • 可定制的本地化 |
脚本 | AI • 剧本 • 角色 • 效果指令 • 内阁 • 文化 • 决议 • 宗族 • 事件 • 政体 • 历史 • 地产 • 生活方式 • 军队 • 宗教 • Story cycles • 头衔 • 特质 |
地图 | 地图 • 地形 |
图形 | 3D模型 • Exporters • 界面 • Coat of arms • Graphical assets • Fonts • Particles • Shaders • Unit models |
音频 | Music • Sound |
其他 | 控制台指令 • 校验码 • 模组结构 • Troubleshooting |