en:yaml:choix
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédente | |||
| en:yaml:choix [2026/05/03 18:47] – Harmonize FR/EN language switch cyrilfiesta | en:yaml:choix [2026/05/03 23:59] (Version actuelle) – mise a jour wiki cyrilfiesta | ||
|---|---|---|---|
| Ligne 3: | Ligne 3: | ||
| ====== Choices and Buttons (YAML) ====== | ====== Choices and Buttons (YAML) ====== | ||
| - | Choices define navigation | + | Choices define |
| - | ===== Base Syntax | + | ===== Minimal syntax |
| + | |||
| + | The simplest form: a destination, | ||
| <code yaml> | <code yaml> | ||
| choices: | choices: | ||
| - | - command: north | + | - to: forest |
| - | button: "Go north" | + | - to: village |
| + | </ | ||
| + | |||
| + | The room '' | ||
| + | |||
| + | ===== Adding a button ===== | ||
| + | |||
| + | '' | ||
| + | |||
| + | <code yaml> | ||
| + | choices: | ||
| + | - button: "⬆️ | ||
| to: forest | to: forest | ||
| - | - command: back | + | - button: "🏠 Back to village" |
| - | to: home | + | to: village |
| </ | </ | ||
| - | * '' | + | ===== Typed command |
| - | * '' | + | |
| - | * '' | + | |
| - | ===== Button Defined on the Room ===== | + | '' |
| <code yaml> | <code yaml> | ||
| - | - id: timers_demo | + | choices: |
| - | button: "Timers" | + | |
| - | text: " | + | button: "⬆️ Go north" |
| + | to: forest | ||
| </ | </ | ||
| - | A choice | + | The player can click the button **or** type '' |
| + | Without '' | ||
| + | |||
| + | See [[en: | ||
| + | |||
| + | ===== Button inherited from the room ===== | ||
| + | |||
| + | If the destination room has a '' | ||
| + | |||
| + | <code yaml> | ||
| + | rooms: | ||
| + | - id: laboratory | ||
| + | | ||
| + | text: "..." | ||
| + | |||
| + | - id: corridor | ||
| + | choices: | ||
| + | - to: laboratory | ||
| + | </ | ||
| ===== to: previous ===== | ===== to: previous ===== | ||
| + | |||
| + | '' | ||
| <code yaml> | <code yaml> | ||
| choices: | choices: | ||
| - command: back | - command: back | ||
| - | button: " | + | button: "↩️ |
| to: previous | to: previous | ||
| </ | </ | ||
| - | ===== Access | + | ===== Access |
| + | |||
| + | '' | ||
| <code yaml> | <code yaml> | ||
| choices: | choices: | ||
| - command: enter | - command: enter | ||
| - | button: " | + | button: "🚪 Enter" |
| to: secret_room | to: secret_room | ||
| - | if: " | + | if: " |
| - | text_ko: "The door remains closed." | + | text_ko: "The door is locked." |
| + | text_ok: "You enter the secret room." | ||
| </ | </ | ||
| - | ===== Conditional | + | * '' |
| + | * '' | ||
| + | |||
| + | Without a condition, '' | ||
| + | |||
| + | ===== Conditional | ||
| <code yaml> | <code yaml> | ||
| choices: | choices: | ||
| - command: expert | - command: expert | ||
| - | button: " | + | button: "🏆 Expert mode" |
| to: expert_room | to: expert_room | ||
| - | visible-if: " | + | visible-if: " |
| - | - command: | + | - command: |
| - | button: "Move on" | + | button: "💀 Move on" |
| to: next_room | to: next_room | ||
| - | disabled-if: | + | disabled-if: |
| </ | </ | ||
| - | ===== Click Effect ===== | + | * '' |
| + | * '' | ||
| - | '' | + | ===== Click effect (effect:) ===== |
| + | |||
| + | '' | ||
| <code yaml> | <code yaml> | ||
| choices: | choices: | ||
| - command: buy | - command: buy | ||
| - | button: "Buy (-10 gold)" | + | button: "🪙 Buy (-10 gold)" |
| to: shop | to: shop | ||
| - | effect: " | ||
| if: " | if: " | ||
| + | effect: " | ||
| </ | </ | ||
| - | ===== Clear HUD on Click ===== | + | ===== Clear HUD on click ===== |
| <code yaml> | <code yaml> | ||
| choices: | choices: | ||
| - command: back | - command: back | ||
| - | button: " | + | button: "↩️ |
| to: home | to: home | ||
| clear-hud: | clear-hud: | ||
| - all | - all | ||
| </ | </ | ||
| + | |||
| + | **Join us on [[https:// | ||
| + | |||
en/yaml/choix.1777826864.txt.gz · Dernière modification : de cyrilfiesta
