Outils pour utilisateurs

Outils du site


en:yaml:choix

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
en:yaml:choix [2026/07/06 00:35] – maj 4.13 : modes d'interface + corrections cyrilfiestaen:yaml:choix [2026/10/19 21:20] (Version actuelle) – Textes des choix : tentative, resultat et ordre des effets cyrilfiesta
Ligne 41: Ligne 41:
 </code> </code>
  
-The player can click the button **or** type ''go north''. +The player can click the button **or** type ''north'' or ''go north''. Without ''command:'', use the destination id, for example ''go forest''. 
-Without ''command:'', only ''go forest'' (the room id) works.+ 
 +With [[en:yaml:texte#listing_choices_in_the_text|choice lists in the text]], a choice without an alias uses its position in the list. An explicit numeric alias takes priority over a room number or an automatic button shortcut.
  
 See [[en:yaml:alias|Aliases and commands]] for global shortcuts and action aliases. See [[en:yaml:alias|Aliases and commands]] for global shortcuts and action aliases.
Ligne 74: Ligne 75:
 ===== Access condition (if:) ===== ===== Access condition (if:) =====
  
-''if:'' blocks access if the condition is not met. The player receives ''text_ko:'' as feedback.+''text:'' describes the attempt, including when ''if:'' fails. ''text_ok:'' and ''text_ko:'' describe the result of that condition.
  
 <code yaml> <code yaml>
 choices: choices:
   - command: enter   - command: enter
-    button: "🚪 Enter"+    button: Enter
     to: secret_room     to: secret_room
 +    text: "You push the door."
     if: "key"     if: "key"
-    text_ko: "The door is locked." +    text_ok: "The lock gives way." 
-    text_ok: "You enter the secret room."+    text_ko: "The door stays locked."
 </code> </code>
  
-  * ''text_ko:'' - shown if the condition fails (access denied) +^ Situation ^ Texts shown ^ Effect and movement ^ 
-  * ''text_ok:'' - shown if the condition succeeds, before moving+| No ''if:'' | ''text'' | Yes | 
 +| Condition passes | ''text'' and ''text_ok'' | Yes | 
 +| Condition fails | ''text'' and ''text_ko'' | No | 
 +| ''text_ok'' without ''if:'' | No OK text | Yes | 
 +| Disabled button | None | No |
  
-Without a condition, ''text_ok:'' and ''text_ko:'' are not used.+Texts follow their order in the YAML. In the editor, use the move buttons beside the text fields to change that order; a new choice starts with the Text field. 
 + 
 +''effect:'' runs after checking ''if:'', before the texts and movement. Texts therefore read the values updated by the effect, even when ''effect:'' is written after them. 
 + 
 +This rule applies to choices. An action uses ''text_ok:'' on success, including without a condition. An event uses ''text:'' when it runs; that text is not shown when its condition fails.
  
 ===== Conditional button (visible-if / disabled-if) ===== ===== Conditional button (visible-if / disabled-if) =====
Ligne 132: Ligne 142:
       - all       - all
 </code> </code>
- 
-**Join us on [[https://discord.gg/Z63DtVV|Discord Make&Play]]** 
  
en/yaml/choix.1783290903.txt.gz · Dernière modification : de cyrilfiesta