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
en:yaml:choix [2026/10/09 23:51] – Documentation 4.16 : generation et mises a jour de l'editeur cyrilfiestaen:yaml:choix [2026/10/19 21:20] (Version actuelle) – Textes des choix : tentative, resultat et ordre des effets cyrilfiesta
Ligne 75: 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) =====
en/yaml/choix.txt · Dernière modification : de cyrilfiesta