Which chapter element would you like to add?

Reveals

Chapter 4 by Friedman Friedman

Reveals

Reveals place part of a chapter behind a labeled button. Readers can open and close the passage without moving to another chapter, making reveals useful for optional descriptions, clues, notes, explanations, and expandable interface elements.

Preview

Select Inspect the desk to open the hidden passage. Select it again to close the passage.

{reveal "Inspect the desk"}
A folded note is taped beneath the drawer.
{endreveal}

A simple reveal works without an active game. Opening it changes only what the reader can currently see on the page.

Copyable syntax

Give the opening tag a non-empty quoted label, put the hidden content after it, and close the passage with {endreveal}:

{reveal "Read the message"}
Meet me beneath the clock tower at midnight.
{endreveal}

The reader first sees a Read the message button. Opening it reveals the passage; closing it hides the same passage again.

Format and combine the hidden passage

The hidden passage can contain ordinary Markdown and supported chapter elements. For example, a reveal can open a complete Random Draw:

{reveal "Open the envelope"}
The card inside bears a single symbol.

{draw "Turn over the card"}
The Key
The Moon
The Crown
{enddraw}
{endreveal}

Close inner elements before {endreveal}. A reveal cannot be placed inside another reveal, and a second reveal cannot be opened inside its hidden passage.

Change Game State when the passage opens

A reveal can set one existing game variable as it opens. Create the variable first as described in Game State Variables and Inventory, then add one set game:... assignment after the label:

{reveal "Take the key" set game:has_key = true}
You slip the brass key into your pocket.
{endreveal}

The reader sees the same reveal button and hidden passage. With an active game, opening it also sets has_key to Yes. Game State, inventory, conditional content, and continuation choices refresh immediately. Before a game starts, the reveal can still open visually, but it cannot save the change; unlike a state-changing lock or action, it does not become a disabled Start game control.

In a compact example, the same pattern may be written as {reveal "Inspect" set game:found_key = true}...{endreveal}. Replace ... with the passage readers should uncover.

A state-changing reveal needs an active game and the exact name of an existing game variable. It can change one variable as it opens.

Use a value that matches the variable type:

  • Yes/No accepts true, false, yes, no, 1, or 0.
  • Number accepts a whole number from -100,000 through 100,000.
  • Percent accepts a whole number from 0 through 100.
  • Age accepts a whole number from 18 through 150.
  • Text and Dropdown accept text; quote a value that contains spaces. For a Dropdown, use one of the choices configured for that variable.

For a Number, Percent, or Age target, the assignment may use a formula. This reveal adds the current income to wealth:

{reveal "Collect income" set game:wealth += game:income}
You collect the day's earnings.
{endreveal}

The compact form is {reveal "Collect income" set game:wealth += game:income}...{endreveal}. Use = to replace the target with the formula result, += to add the result, or -= to subtract it. A formula can use the arithmetic, checks, existence checks, rounding, and random functions described in Game-State Formulas. Formula assignments cannot target Yes/No, Text, or Dropdown variables.

The change is saved as a game step the first time the reveal opens. Closing and reopening the same completed reveal does not apply the change or calculate its formula again. A random formula therefore chooses its result once for that completed reveal. Going Back past the game step restores the earlier Game State and makes the reveal's change available again. A simple reveal has no saved game step.

If a formula cannot be calculated, no Game State change is saved and the reveal's saved interaction is not completed, so it can be attempted again.

Labels, limits, and combinations

Use straight matching quotation marks around a non-empty button label. Braces and other chapter tags do not belong inside the label. Always include one matching {endreveal}.

Reveal content may include formatted prose and supported self-contained elements, but all blocks must close in the reverse order in which they opened. In particular, place an entire Random Draw inside a reveal rather than trying to put reveal tags inside one of the draw's one-line outcomes.

Keep essential information outside a reveal when every reader must see it. A reveal is an interface convenience, not a way to protect private or sensitive information.

Before publishing

  • Check that the label is quoted, clear, and describes what will open.
  • Confirm that every opening tag has one {endreveal} and that nested blocks close first.
  • Test the passage with keyboard controls as well as a pointer.
  • Make sure essential instructions remain visible without opening optional content.
  • For a state-changing reveal, verify the exact variable name and a value that matches its type.
  • For a formula reveal, test every value it calculates, every intended missing-value fallback, and the smallest and largest possible result.
  • Start a test game and confirm that opening the reveal refreshes any affected Game State display or continuation.
  • Close and reopen the reveal to confirm its saved change is applied only once, then go Back past it and confirm it becomes available again.
Start your own immersive adult AI roleplay story
Ad

You've reached the end of this Guide topic.

Back Start Over View Story Map

0 comments