Outils pour utilisateurs

Outils du site


en:txt:syntaxe-base

Ceci est une ancienne révision du document !


Language / Langue : FR | EN

Basic syntax (.txt format)

<note> The .txt format is the legacy JDR-Bot syntax, still supported. For new scenarios, prefer the YAML format, which is more powerful. </note>

A .txt scenario is a text file encoded in UTF-8, made of blocks separated by lines of stars.

General structure

Scenario title
Number of rooms
1 room_name_1
Text of room 1
|
2
exit->2
***************
2 room_name_2
Text of room 2
|
999|You win!
***************

Each block in detail

Line 1 - Scenario title

The title is shown when the game starts. It may be followed by options separated with “|” (see Aliases and reactions). ⚠ Do not use “|” inside the title itself, it is a delimiter.

Line 2 - Number of rooms

The total number of rooms in the scenario. A Discord markdown mode can be added next to it: 3 fix (fix is the default value).

Room blocks

Each room is made of exactly 4 lines, in this order:

  1. [number] [internal_name] - unique identifier of the room
  2. Text shown to the player (may be null for no text)
  3. Objects / variables / states (or | when empty - required)
  4. Available exits and events

Rooms are separated with * (at least five stars). Do not put a separator before the first room.

Available exits

Syntax Effect
2 Room 2 reachable with no condition
2|object|KO text|OK text Room 2 with an object condition
2|v_var_v.>=.5|KO text|OK text Room 2 with a variable condition
alias→2 The alias word leads to room 2
previous or precedent Allows going back to the previous room
997 Automatic event (see Events)
998|Defeat text End of game - defeat
999|Victory text End of game - victory

Ending examples

998 and 999 are special room numbers. If one of them appears in the exits of a room, the game ends with the matching text:

999|Congratulations! You solved the escape game!
998|Game over. The dungeon got the better of you...

Testing your scenario

To start your scenario on the Discord bot:

play https://your-url/your_scenario.txt

Or, if you have set a base URL:

play scenario_name

Find us on the Make&Play Discord

en/txt/syntaxe-base.1788117508.txt.gz · Dernière modification : de cyrilfiesta