Outils pour utilisateurs

Outils du site


en:txt: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:txt:conditions [2026/05/03 18:47] – Harmonize FR/EN language switch cyrilfiestaen:txt:conditions [2026/08/31 20:47] (Version actuelle) – Wiki : fins de pages homogènes, liens Discord retirés cyrilfiesta
Ligne 1: Ligne 1:
 **Language / Langue :** [[fr:txt:conditions|FR]] | **EN** **Language / Langue :** [[fr:txt:conditions|FR]] | **EN**
  
-====== TXT — Conditions ======+====== Conditions (.txt format) ======
  
-Legacy conditions are used in events and exitsYAML offers clearer condition syntax, but legacy scenarios remain supported.+Conditions restrict access to a room depending on the player's inventory or variables. 
 + 
 +===== Object condition ===== 
 + 
 +<code> 
 +room_number|object1 object2|text_if_not|text_if_yes 
 +</code> 
 + 
 +Several objects mean the player must hold **all** of them (logical AND). 
 + 
 +To forbid entry when the player **does** hold the object, prefix it with ''-'': 
 + 
 +<code> 
 +3|-lamp|You cannot enter carrying a lamp!|You enter without a lamp. 
 +</code> 
 + 
 +===== Variable condition ===== 
 + 
 +<code> 
 +room_number|v_score_v.>=.50|You do not have enough points.|You enter. 
 +</code> 
 + 
 +^ Operator ^ Meaning ^ 
 +| ''.=.'' | Equal to | 
 +| ''.!=.'' | Different from | 
 +| ''.>.'' | Greater than | 
 +| ''.>=.'' | Greater than or equal to | 
 +| ''.<.'' | Less than | 
 +| ''.<=.'' | Less than or equal to | 
 +| ''.in.X-Y'' | Between X and Y | 
 +| ''.out.X-Y'' | Outside the X-Y range | 
 + 
 +For text variables: 
 + 
 +<code> 
 +2|t_class_t.=."warrior"|Warriors only.|You enter. 
 +</code> 
 + 
 +===== Combining objects and variables ===== 
 + 
 +Separate the conditions with space: 
 + 
 +<code> 
 +2|lamp v_hp_v.>.0|You do not have everything you need.|You enter. 
 +</code> 
 + 
 +===== OR condition ===== 
 + 
 +Repeat the room line with different conditions. The bot tests them in order and stops at the first one that succeeds: 
 + 
 +<code> 
 +2|lamp|No lamp and no torch!|You enter with the lamp. 
 +2|torch|No lamp and no torch!|You enter with the torch. 
 +</code>
  
-Common checks: 
-  * object name: object owned 
-  * ''-object'': object missing 
-  * ''v_hp_v.<=.0'': variable comparison 
en/txt/conditions.1777826879.txt.gz · Dernière modification : de cyrilfiesta