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.
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
IFandRANDOMbranching. - 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
| Field | Purpose | Best practice |
|---|---|---|
| Story Title | The arc name shown in the editor and story prompts. | Use a clear arc title that fits the series. |
| Hero Series | The player-controlled card series for the story arc. | Select the exact series you want the player to use. |
| Enemy Series Pool | Fallback enemy pool used when a chapter does not force one. | One series per line or comma-separated values. |
| Intro Media / Intro Dialogues | Fallback intro content when Story Script is empty. | Use these for a simpler opening scene. |
| Story Script | Runs before the first chapter starts. | Use it for custom branching, setup logic, and cinematic control. |
| Ending Media / Ending Dialogues / Ending Script | Ending sequence for the whole arc. | Use Ending Script when you need custom closing logic. |
| Active | Turns 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.
Story Mode settings
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.