Actions are the [Name(args)] tags you write in chapter content. Some are built in and handled directly by the Revealer; anything else dispatches to a handler your scene script registers with Revealer.Register. See Coding for the event-object shape handlers receive.
Flow control
| Action | Effect |
|---|---|
[AwaitClick()] |
Pauses the reveal until the player clicks or presses Space. |
[ClickClear()] |
Same as AwaitClick, then wipes the text box (open style tags are re-opened so formatting continues). |
[Clear()] |
Wipes the text box straight away and carries on, without waiting for a click. Open style tags carry on the same way. |
[AutoLink(nodeId)] |
Jumps straight to another node, with no player input. |
[LinkOption(nodeId, text)] |
Collects a player choice. All LinkOptions in a node fire together via the OptionsReady event once the node finishes. |
[SwitchScene(name)] / [SwitchScene(name, fadeDuration, fadeHold)] |
Switches the active scene, with optional fade timing. |
[Pause(seconds)] |
Waits N seconds before continuing (1 second if the number isn't valid). |
[Pause()] |
Pauses the reveal until your scene script calls Revealer.Unpause(). |
[TextSpeed(multiplier)] |
Changes reveal speed from that point on. 0.5 is twice as fast, 2 is twice as slow. |
Characters
| Action | Effect |
|---|---|
[SetCharacter(key)] / [SetCharacter(key, variant=value)] |
Fires a SetCharacter event and pauses the reveal until the scene calls Revealer.Unpause(). Pass a variant as a kwarg to switch expression/outfit in the same call. |
[UnsetCharacter(key)] |
Fires an UnsetCharacter event, which also pauses until unpaused. There's no built-in logic beyond dispatching; your scene script decides what "unset" means, e.g. playing a leave animation. |
[UnsetCharacterAll()] |
Same as above, for clearing every on-screen character at once. |
None of these have dedicated built-in behavior beyond the pausing noted above. They all fall through to the generic custom-action dispatch, so it's entirely up to your scene's Revealer.Register handlers what actually happens on screen.
Audio
| Action | Effect |
|---|---|
[Music(key)] / [Music(key, fadeSeconds)] |
Plays or crossfades background music. |
[StopMusic()] / [StopMusic(fadeSeconds)] |
Fades out and stops music. |
[Ambient(key)] / [Ambient(key, fadeSeconds)] |
Plays or crossfades an ambient loop. |
[StopAmbient()] / [StopAmbient(fadeSeconds)] |
Fades out and stops the ambient loop. |
[SFX(key)] |
Plays a one-shot sound effect. |
[Voice(key)] |
Plays a one-shot voice line. |
Project functions
| Action | Effect |
|---|---|
[Call(functionName, value1, value2, name=value)] |
Calls a function from a project script at this point in the text. If the function returns a Promise, or is async, the text waits until it's done. |
The values after the function name are read like this:
- Numbers are numbers, and
true,falseandnullare what they say. - Text in quotes is text, and so is a plain word, so
"sword"andswordboth pass the textsword. $variablespass their current value, such as$goldor$player.- Anything else is worked out as an expression, such as
$gold + 5orrandomInt(1, 6).
Values written as name=value are collected into one object, passed as the last argument. [Call(openShop, discount=10, theme=dark)] calls openShop({ discount: 10, theme: "dark" }).
The function can be anything declared at the top level of a project script, or a function inside an object, such as [Call(Shop.open)]:
function giveItem(name: string, count: number) {
Store.Set("inventory", [...Store.Get("inventory", []), ...Array(count).fill(name)]);
}
async function shakeScreen(seconds: number) {
document.getElementById("game")?.classList.add("shake");
await new Promise((done) => setTimeout(done, seconds * 1000));
document.getElementById("game")?.classList.remove("shake");
}
You found a sword![Call(giveItem, "sword", 1)]
The ground rumbles.[Call(shakeScreen, 2)] Then silence.
If there's no function with that name, an error is logged and the text carries on. The same happens if the function throws an error. $variables are read when the action runs, so inside a {for} loop, the loop variable has its last value by then.
The Chapter Editor's preview doesn't run project functions, so test them with Play. To call a function as the node starts, or to use what it returns, see Calling a function.
Custom actions
Anything not listed above, such as [AnyName(arg1, arg2, key=value)], dispatches to whatever you've registered:
Revealer.Register("AnyName", (event) => {
event.args; // ["arg1", "arg2"]
event.kwargs; // { key: "value" }
});
This is how you build your own game-specific actions (camera shakes, achievements, custom character behavior, anything at all) without touching the Revealer itself.
A note on newlines
If an action tag is immediately followed by a newline in your source text, that newline is swallowed rather than showing up as a blank line in the revealed output. That means you can put one action per line for readability without it affecting spacing on screen.