The common term for quests and missions in the framework is containers, since they contain everything that makes a quest or mission work.
Sections
A container is made up of one or more sections. Each section has acheck function and a table of zone handlers. The framework runs through all sections in order and executes the action from the highest-priority matching one.
The check function
The check function receives four arguments:
| Argument | Type | Description |
|---|---|---|
player | entity | The player object |
status | integer | Quest/mission status constant |
questVars | proxy table | Quest variables, fetched lazily by name |
globalVars | proxy table | Non-quest character variables, fetched lazily by name |
questVars and globalVars use lazy lookup: accessing questVars.Prog automatically fetches the Quest[X][Y]Prog char variable. Names with special characters use bracket syntax: questVars['my var'].
Framework flow
Player interacts with an NPC or zone event
The C++ core calls the framework’s dispatch function for the relevant event type (e.g.,
onTrigger).Framework collects candidates
All containers registered in
interaction_containers.lua that cover this NPC/zone are iterated. For each, the check function is called. All sections where check returns true are collected.Actions are sorted by priority
The framework collects the action returned by each matching section’s handler and sorts them. Progress events rank highest, regular events next, default actions last.
Highest-priority action executes
The winning action is executed. For events, this means calling
player:startEvent(). For messages, it calls player:messageSpecial().Fallback to NPC/zone Lua file
If no framework action applies, the NPC’s own
npcs/ file handler runs (if it exists).Priority order
- Progress events from the interaction framework (highest)
- Regular events from the interaction framework, alternating with the NPC/zone Lua file
- Default actions from
DefaultActions.lua(lowest)
Handlers
Here is the full set of handlers that can appear inside a section’s zone table:Framework internals
All containers are registered inscripts/globals/interaction_containers.lua. The framework’s core files are:
| File | Role |
|---|---|
interaction/interaction_global.lua | Server init, zone loading, !reloadquest support |
interaction/interaction_lookup.lua | Indexes containers by zone and NPC for fast lookup |
interaction/container.lua | Base Container class with action and variable helpers |
interaction/quest.lua | Quest subclass with begin() and complete() |
interaction/mission.lua | Mission subclass |
interaction/hidden_quest.lua | HiddenQuest subclass for non-log-entry quests |
interaction/action_util.lua | Action priority resolution |
interaction/actions/ | Event, Message, Sequence, KeyItem action classes |
DefaultActions.lua.
GM commands
Three GM commands support debugging the interaction framework. Reload a quest container (name must match exactly as ininteraction_containers.lua, case-sensitive):