Outils pour utilisateurs

Outils du site


en:yaml:conditions

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:conditions [2026/08/31 20:51] – Wiki : fins de pages homogènes, liens Discord retirés cyrilfiestaen:yaml:conditions [2026/10/19 22:45] (Version actuelle) – Comparaisons de texte sans distinction de casse cyrilfiesta
Ligne 17: Ligne 17:
 | ''v_hp_v in 3-7'' | Inside range 3 to 7. | | ''v_hp_v in 3-7'' | Inside range 3 to 7. |
 | ''v_hp_v out 3-7'' | Outside range 3 to 7. | | ''v_hp_v out 3-7'' | Outside range 3 to 7. |
 +
 +===== Compare Text =====
 +
 +Text comparisons with ''='', ''!='', ''in'' and ''out'' ignore letter case, including inside loops. For example, ''t_answer_t = dawn'' also accepts ''Dawn'' and ''DAWN''.
 +
 +List operations (''remove'', ''draw'', ''index_of'', ''count'') remain case-sensitive. Number comparisons are unchanged.
  
 ===== Compare Two Variables ===== ===== Compare Two Variables =====
Ligne 22: Ligne 28:
 <code yaml> <code yaml>
 if: "v_hp_v > v_enemy_hp_v" if: "v_hp_v > v_enemy_hp_v"
 +</code>
 +
 +Or:
 +
 +<code yaml>
 if: "v_score_v = v_record_v" if: "v_score_v = v_record_v"
 </code> </code>
Ligne 40: Ligne 51:
 <code yaml> <code yaml>
 if: "key"      # player owns object key if: "key"      # player owns object key
 +</code>
 +
 +Or:
 +
 +<code yaml>
 if: "-key"     # player does not own object key if: "-key"     # player does not own object key
 </code> </code>
  
 Do not use ''o_key_o'': that is not the YAML condition syntax. Do not use ''o_key_o'': that is not the YAML condition syntax.
 +
 +===== Events =====
 +
 +<code yaml>
 +events:
 +  - if: "v_hp_v <= 0"
 +    to: game_over
 +    text: "You died..."
 +  - if: "v_hp_v <= 5"
 +    text: "You are badly wounded!"
 +  - if: ~
 +    to: next_room
 +</code>
 +
 +Events are evaluated in order. The first event that redirects with ''to:'' stops the following events.
  
 ===== Choices ===== ===== Choices =====
en/yaml/conditions.1788202301.txt.gz · Dernière modification : de cyrilfiesta