Actions (actions)
Actions are the second half of the story language (the first is conditions). This
is what happens when the player enters a stage, clicks a point on the map, or takes control of a territory.
The format is an object { command: [arguments] }, and a single stage/point can carry several commands at
once.
"actions": {
"add": ["army_medkit:2", "sidorovich_job"],
"money": ["500"],
"openNotification": ["Task", "Sidorovich is asking you to bring five bloodsucker hides"]
}
Some commands run instantly on the device, others require confirmation from the backend (pdanetwork) — the
difference doesn't matter much in practice for a story writer, but it's useful to know the game is talking to
the network at that moment.
Inventory, money, experience
| Command | Arguments | What it does |
|---|---|---|
add | "item_id:quantity" or an arbitrary flag string | Gives the player an item or adds a text flag to the inventory (see flags) |
remove | "item_id:quantity" or the exact flag text | Takes away an item or removes a previously granted flag/quest marker |
money | a number (can be negative) | Changes the player's amount of money |
xp | a number (can be negative) | Changes the player's amount of experience |
reset | relation_N (see below) or items | items — fully clears the inventory; relation_N — resets the relation to a specific faction |
Item identifiers come from the backend's shared catalog — in the editor they're picked from a dropdown list, not typed by hand.
Faction relations
| Command | Arguments | What it does |
|---|---|---|
+ | "relation_<faction_id>:<amount>" | Improves the given faction's relation to the player by the given amount |
- | "relation_<faction_id>:<amount>" | Worsens the given faction's relation to the player by the given amount |
Faction identifiers (id) — see the faction reference. A detailed breakdown of the
relation scale is in The Relations System.
Notifications and notes
| Command | Arguments | What it does |
|---|---|---|
openNotification / showNotification | title, text | Shows a pop-up notification to the player |
note | "Title:Text" | Adds a note to the player's PDA — handy for "leads" the player will want to reread later |
Story navigation
| Command | Arguments | What it does |
|---|---|---|
openStage | [stage_id] or [chapter_id, stage_id] | A technical transfer to a stage, including one in another chapter (used on the utility stages type_stage: 5) |
openSeller | trader id | Opens a specific NPC trader's trading window |
syncNow | — | Forces an immediate sync of the player's progress with the server, without waiting for the background sync |
exitStory | — | Exits the story, leaving it unfinished (progress is saved) |
finishStory | — | Marks the story as completed |
Sound and music
| Command | Arguments | What it does |
|---|---|---|
playMusic | link to a track | Plays a track once |
loopMusic | link to a track | Plays a track on loop (scene/chapter background music) |
stopMusic | — | Stops the music |
playSound | link to a sound | Plays a sound effect |
pauseSound | — | Pauses the sound |
pauseAllSound / resumeAllSound | — | Pauses/resumes all sounds at once |
Scripts (advanced)
| Command | Arguments | What it does |
|---|---|---|
script / lua | Lua code | Runs an arbitrary Lua script synchronously |
asyncScript / asyncLua | Lua code | Same, but asynchronously, without blocking the UI |
In the story editor, script opens a full code editor (CodeMirror). This is a
"hatch for advanced users": if the standard actions aren't enough (complex logic, calculations), you can
implement them with a script. There isn't much documentation of the API available inside a Lua script in
public sources — see Open Questions; simple stories usually don't need
script at all.
Miscellaneous
showAd— shows an ad (videoorsimple); used in game mechanics that aren't directly tied to story content.- The backend code also has server-side commands
item,item_condition,state,set— their exact semantics aren't documented in the editor's open-source code and need clarifying with the developers before using them directly in a story (don't use them "blindly" — preferadd/remove/money/xp, which are confirmed to work and are available in the editor's UI).
Next
- Variables and Flags — how to design a story's state.
- Missions and Checkpoints — how to build a quest journal on top of flags.