Outils pour utilisateurs

Outils du site


en:txt:objets

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:objets [2026/07/06 00:12] – maj 4.13 : modes d'interface + corrections cyrilfiestaen:txt:objets [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:objets|FR]] | **EN** **Language / Langue :** [[fr:txt:objets|FR]] | **EN**
  
-====== TXT - Objects and States ======+====== Objects and states (.txt format) ====== 
 + 
 +===== Collectable objects ===== 
 + 
 +Objects are declared on **line 3** of a room (the objects/variables line). Each object has 5 fields separated with ''|'': 
 + 
 +<code> 
 +object_name|place|place_description|pickup_text|object_description 
 +</code> 
 + 
 +  * ''object_name'' - identifier (no space) 
 +  * ''place'' - furniture or spot where the object lies (used by the ''inspect place'' command) 
 +  * ''place_description'' - text shown when the player inspects the place 
 +  * ''pickup_text'' - text shown when the object is taken (''take object'' command) 
 +  * ''object_description'' - text shown when the player inspects the object (''inspect object'' command) 
 + 
 +Example: 
 +<code> 
 +lamp|table|A table with four legs. There is a lamp on it!|You pick up the lamp.|The lamp lets you light your way. 
 +</code> 
 + 
 +For several objects in the same room, separate them with ''|'' or use ''&&'' to spread them over several lines. 
 + 
 +===== Invisible objects and states ===== 
 + 
 +Invisible objects do **not** appear in the visible inventory: they act as states, conditions, classes, and so on. The keyword is ''invisible'' instead of the place: 
 + 
 +<code> 
 +state_name|invisible|unused_note|acquisition_text|state_description 
 +</code> 
 + 
 +They are **acquired automatically** when the player enters the room, with no need for the ''take'' command. 
 + 
 +To check that a player holds a state as a room condition: 
 +<code> 
 +2|tired_state|You are far too tired!|You enter the room. 
 +</code> 
 + 
 +To check that they do **not** hold it (negative condition): 
 +<code> 
 +2|-tired_state|You are not tired any more.|Good, you may enter. 
 +</code> 
 + 
 +===== Removing an object automatically ===== 
 + 
 +Put a ''-'' before the object name on the objects/variables line. If the object is in the inventory, visible or invisible, it is removed: 
 + 
 +<code> 
 +-lamp|invisible|note|The lamp breaks as it falls.|The lamp. 
 +</code> 
 + 
 +====Several copies of an object ===== 
 + 
 +Repeat the object several times in the same room. The player can take it as many times as there are copies: 
 + 
 +<code> 
 +lamp|table|There are two lamps on the table!|You take a lamp.|The lamp. 
 +lamp|table|One lamp is left on the table.|You take the last lamp.|The lamp. 
 +empty|table|The table is empty now.|How did you find that?|Nothing here. 
 +</code> 
 + 
 +The third object, ''empty'', exists to display a description once the table has been emptied.
  
-Legacy TXT objects are defined on the variable/object line. The YAML format is recommended for new object-heavy scenarios because it separates furniture, object descriptions, pickup text and reactions more clearly. 
en/txt/objets.1783289572.txt.gz · Dernière modification : de cyrilfiesta