Card Battle Arena
Documentation
Card Battle Arena Docs

Story Mode

Story Mode is the narrative layer of Card Battle Arena. It combines story arcs, chapters, media, dialogue, and script commands so an admin can build a complete battle-driven episode instead of a single standalone fight.

What Story Mode does

Story Mode runs in a fixed flow: intro content first, then chapter by chapter battles, then post-battle cutscenes, and finally the ending sequence. Each story arc can keep its own hero series, enemy pool, media, and script logic.

Intro pathStory Script runs first. If it is empty, the editor falls back to intro media and intro dialogues.
Chapter pathChapter Script runs before battle. If it does not request a battle, the chapter can still use intro dialogue, cutscenes, and manual prompts.
After battle pathAfter Battle Script runs after the fight, then the chapter can show post-dialogues and cutscene media.
Ending pathEnding Script can override the fallback ending media and ending dialogues.
The story editor is stateful. Custom variables can be created with SET and updated with ADD, then read later with {{var_name}}.

Script Editor introduction

The script editor is not a shortcode box. It is a line-based command language used inside the story boxes. Each line can act as dialogue, logic, media, audio, animation, or battle control.

Where it appears

  • Story Script
  • Chapter Script
  • After Battle Script
  • Ending Script

What the admin sees

  • A plain textarea editor for fast editing.
  • One command per line.
  • Simple IF and RANDOM branching.
  • Built-in support for dialogues, images, videos, music, sound, and animation triggers.

Use the full command reference on the dedicated Script Editor page whenever you need exact syntax, branching rules, or examples.

Story fields to fill first

FieldPurposeBest practice
Story TitleThe arc name shown in the editor and story prompts.Use a clear arc title that fits the series.
Hero SeriesThe player-controlled card series for the story arc.Select the exact series you want the player to use.
Enemy Series PoolFallback enemy pool used when a chapter does not force one.One series per line or comma-separated values.
Intro Media / Intro DialoguesFallback intro content when Story Script is empty.Use these for a simpler opening scene.
Story ScriptRuns before the first chapter starts.Use it for custom branching, setup logic, and cinematic control.
Ending Media / Ending Dialogues / Ending ScriptEnding sequence for the whole arc.Use Ending Script when you need custom closing logic.
ActiveTurns the story arc on or off.Keep only finished story arcs active.

Chapter flow and battle control

Each chapter can have its own title, enemy series, battle mode, pre-battle dialogue, chapter script, after-battle script, post-dialogues, and cutscene media.

Before battle

Use chapter_script for scene logic. If the script reaches BATTLE, the engine jumps into combat. If the script finishes without a battle request, the chapter shows the battle prompt afterward.

After battle

Use after_battle_script for victory beats, rewards, warnings, or a final twist. Then the page can continue into post-dialogues and cutscene media.

The chapter battle mode can be Manual Start or Auto Fight. Auto chapters can flow into the next chapter with the configured delay after a win.

Story Mode settings

Dialogue durationControls how long dialogue cards stay visible before auto-advancing. Set to 0 for manual advance only.
Image and video durationsUsed for intro, ending, and cutscene media playback timing.
Continue chancesHow many times the player can retry after a defeat in Story Mode.
Battle promptsCustomize the text shown before chapter battles and after chapter completion.

Practical tips

  • Keep a Story Script short and reserve heavy branching for chapter scripts.
  • Use custom variables to pass information from one line to the next.
  • Use chapter scripts for battle gating and after-battle scripts for payoff scenes.
  • Use media URLs that are already reachable from the front end.
  • Test one chapter at a time before activating the full arc.