Skip to main content

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

CommandArgumentsWhat it does
add"item_id:quantity" or an arbitrary flag stringGives the player an item or adds a text flag to the inventory (see flags)
remove"item_id:quantity" or the exact flag textTakes away an item or removes a previously granted flag/quest marker
moneya number (can be negative)Changes the player's amount of money
xpa number (can be negative)Changes the player's amount of experience
resetrelation_N (see below) or itemsitems — 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

CommandArgumentsWhat 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

CommandArgumentsWhat it does
openNotification / showNotificationtitle, textShows 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

CommandArgumentsWhat 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)
openSellertrader idOpens a specific NPC trader's trading window
syncNowForces an immediate sync of the player's progress with the server, without waiting for the background sync
exitStoryExits the story, leaving it unfinished (progress is saved)
finishStoryMarks the story as completed

Sound and music

CommandArgumentsWhat it does
playMusiclink to a trackPlays a track once
loopMusiclink to a trackPlays a track on loop (scene/chapter background music)
stopMusicStops the music
playSoundlink to a soundPlays a sound effect
pauseSoundPauses the sound
pauseAllSound / resumeAllSoundPauses/resumes all sounds at once

Scripts (advanced)

CommandArgumentsWhat it does
script / luaLua codeRuns an arbitrary Lua script synchronously
asyncScript / asyncLuaLua codeSame, 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 (video or simple); 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" — prefer add/remove/money/xp, which are confirmed to work and are available in the editor's UI).

Next