Actions Reference

All built-in actions for scenes and choices.


Core Actions

ActionDescriptionExampleDelayed
notificationDisplay a notification popup"Hello!"
flashDisplay a flash message. Accepts a plain string, or { text, class } to wrap the text in a <span class="…">"Item received!" or { text: "small note", class: "flash-small" }
stateSet game states"game_state=battle, disable_ui=true"
popupManage the popup stack: "id" opens, "!id" closes that one, false closes all. Comma-separated tokens applied in order; popups stack on top of each other"my-popup", "popup1, !popup2", or false✓
propertyModify game properties (= set, > add, < subtract)"gold>100, score=0"
loreMark one or more lore records as discovered"kingdom_of_luminaria" or "goblins, orcs, trolls"

property Examples

// String format (= set, > add, < subtract)
{ property: "gold>100" }           // add 100 to gold
{ property: "score=0, lives<1" }   // set score to 0, subtract 1 from lives

// Object format (for setting complex values)
{ property: { settings: { volume: 80, theme: "dark" } } }

Dungeon Actions

ActionDescriptionExampleDelayed
musicPlay background music"battle_theme"
soundPlay a sound effect"sword_slash"
assetAdd, update, or remove assets(!)"bg1, alice(x=50)" or "!bg1"
flagSet flags (= set, > add, < subtract)"gold>10, count=5"
exitExit current scenetrue✓
enterEnter a room"room5"✓
scenePlay a scene"intro_scene"✓
redirectRedirect to a scene"&alt_scene"
choicesLoad choices from a scene"&choice_scene"
choices_overLoad choices (override mode: hide default scene ~choices)"&choice_scene"
actorAdd, move, or remove actors"alice->center, bob->left"
questAdd quest log entry"main_quest.goal1.log1"

Scene Params

ParamDescriptionExample
introPlay block 1 on first visit, block 2 on repeat visits{intro: true}

intro

Add {intro: true} to the first paragraph of a scene. On the first visit, column 1 plays normally. On any subsequent visit, the engine skips column 1 and plays column 2 instead.

Example (DryadScript):

#npc~talk{intro: true}
1
%
The old man looks up from his desk.

old_man: Ah, a visitor. I am Gareth, the keeper of this archive.

old_man: What brings you here?
%
Gareth nods as you approach.

old_man: Back again? What do you need?

Column 1 (before %) plays on first visit. Column 2 (after %) plays on every subsequent visit. Both share the same choices below.

Note: Column 2 must exist. If missing, the engine logs an error.

Character Actions

ActionDescriptionExampleDelayed
partyAdd / remove characters from party. ! prefix removes"alice, bob, !carol"
create_characterCreate a new character{ id: "npc1", template: "villager" }
update_characterUpdate character properties{ id: "alice", party: true }
delete_characterDelete a character{ id: "npc1" }
statusApply / remove status effects per target. & separates items; ! prefix removes"alice->buff1 & buff2, bob->!debuff"
charModify character property (= set, > add, < subtract)"alice.resource.health>10"
Types: trait, attribute, stat, resource, skinStyle"mc.attribute.belly=2"
attrShortcut for char with attribute type"ane.face = hurt"
traitShortcut for char with trait type"alice.name = Alice"
statShortcut for char with stat type (= > <)"alice.strength > 5"
resourceShortcut for char with resource type (= > <)"alice.health > 10"
skin_styleShortcut for char with skinStyle type (= set, > add, < remove)"alice.hat = class1"
skin_layerAdd / remove skin layers per target. & separates layers; ! prefix removes"alice->armor & helmet, bob->!cloak"
item_slotAdd / remove equipment slots per target. & separates slots; ! prefix removes"alice->ring & necklace, bob->!belt"
abilityGrant / remove innate abilities per target. & separates abilities; ! prefix removes"alice->fireball & ice_bolt, bob->!punch"
skillLearn a skill for character"alice.fire_magic.fireball"

Targeted-spec syntax (status, skin_layer, item_slot, ability)

Each action takes a string of the form targetId->item & item & ..., targetId->!item, ...:

  • Comma separates per-target groups.
  • Within a group, & separates items.
  • Items prefixed with ! are removed; bare items are added.
{ status: "alice->blessed & focused, bob->!cursed" }
{ skin_layer: "mc->armor_dirty, mc->!armor_clean" }
{ item_slot: "alice->extra_ring, bob->!ring_3" }

Item Actions

ActionDescriptionExampleDelayed
equipEquip/unequip items by character + item id"ordelia -> armor1, ane -> !sword1"
equip_itemEquip the active item (uid) — internal/advancedtrue
unequip_itemUnequip the active item (uid) — internal/advancedtrue
add_itemAdd item to inventory"sword, potion#5"
lootOpen loot exchange"chest_inventory"✓
tradeOpen trade exchange"merchant_inventory"✓
learn_recipeLearn a crafting recipe"iron_sword, steel_sword"

equip

Equip and unequip items using real character ids and item template ids (no uids). Comma separates specs; two spec shapes:

  • Targeted (char -> payload & payload): & separates payloads; a payload is itemId to equip or !itemId to unequip. char.slot_type targets a specific slot type (an equip fills its first empty slot, else the first; an !itemId is restricted to that type).
  • Clear (!char / !char.slot_type, no arrow): !char.slot_type unequips every occupied slot of that type; !char clears all of the character's equipment.

slot_type is the slot's id from Item Slots (e.g. outfit_ordelia), not a per-character instance name. On equip, if no matching instance exists in the character's inventory one is created from the template and the item.added flash shows (same as add_item); equipping an instance already in inventory stays silent. Invalid ids/slots log a console warning and skip that spec — the scene continues.

{ equip: "ordelia -> armor1 & ring1" }        // equip both (auto slot)
{ equip: "ordelia.trinket_ordelia -> ring1" } // equip into a slot type
{ equip: "ordelia -> !armor1" }               // unequip by item id
{ equip: "!ordelia.outfit_ordelia" }          // clear a slot type
{ equip: "!ordelia" }                         // clear all equipment

equip vs equip_item/unequip_item: prefer equip for scripting — it uses stable ids. equip_item/unequip_item act on the active item (its uid) and are mostly internal UI plumbing; { equip_item: true } / { unequip_item: true } stay useful inside active-item flows (e.g. the tutorial's equip/unequip cancel handling).