Write a Story

This page will take you through the basics of writing your own story for Story Engine.

Metadata

name: My Story # the name of your story
description: |
  My Story Description
author: My Name or Screenname
starts_with: first-page
steps:
  # ...
Field Type Description
title string The title of your story
description string A short description of the story, shown on the first message when your story begins.
author string The author… oh that’s you! :wave:
starts_with string Where do you want the reader to begin? Use one of the key’s from steps.
steps object This will be covered later.

Steps

steps:
  first-page:
    payload: |
      This is my first page.
    routing:
      next: second-page
  second-page:
    payload: |
      We'll include a branch here...
    components:
      - type: 1 # Action row
        components:
          - type: 2 # Button
            style: 3 # Green - Success
            label: Truth
            custom_id: truth
          - type: 2
            style: 4 # Red - Danger
            label: Dare
            custom_id: dare
    routing:
      truth: truth-page
      dare: dare-page

      # additionally - random chance
      truth: [truth-1, truth-2]
      # or - weighted chance
      truth:
        truth-1: 0.4
        truth-2: 0.6

  truth-page:
    payload:
      embeds:
        - title: You chose TRUTH
          color: 0x00FF00
          description: |
            What's the most embarrassing moment you can remember.
            (END)
    routing: end
  dare-page:
    payload:
      embeds:
        - title: You chose DARE
          color: 0xFF0000
          description: |
            Try not to blink for 30 seconds.
            (END)
    routing: end

Editor note: I’m aware that this is a very bad ‘narrative’, I’m just trying to get the structure across.

This next section is also quite long, so feel free to take notes if you need to.

Structure (Steps - steps.*)

Field Type Description
{step_name} object A step in the story
{step_name}.payload string or object A discord message payload to be sent back to the user, if a string it will be resolved as an embed.
{step_name}.components array If payload is string, a list of components to be rendered in the message
{step_name}.routing "end" or object A map of routing options for the next step

Structure (Routing - steps.*.{step_name}.routing)

This property can accept a number of different values:

Structure (External)

Components (Buttons)

Right now, only the button component is supported (action_row just groups it together).