Outils pour utilisateurs

Outils du site


en:yaml: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:yaml:objets [2026/05/03 18:47] – Harmonize FR/EN language switch cyrilfiestaen:yaml:objets [2026/08/31 20:54] (Version actuelle) – Wiki : fins de pages homogènes, liens Discord retirés cyrilfiesta
Ligne 48: Ligne 48:
 | ''pickup_reaction:'' | Button shown to take the object. | | ''pickup_reaction:'' | Button shown to take the object. |
 | ''object_reaction:'' | Button shown to examine the object. | | ''object_reaction:'' | Button shown to examine the object. |
 +| ''inventory-limit:'' | How many copies the player may hold. Absent: one copy. ''0'': unlimited. |
 +| ''inventory-limit-message:'' | Optional text shown when the limit is reached. |
 +| ''throw-missing-message:'' | Optional text shown when the player throws an object they do not carry. |
  
 ===== Furniture, Object and Inventory ===== ===== Furniture, Object and Inventory =====
Ligne 55: Ligne 58:
 ''location: invisible'' means the object exists in the room but is not directly listed as a visible object to take. This is useful for internal states or event-managed objects. ''location: invisible'' means the object exists in the room but is not directly listed as a visible object to take. This is useful for internal states or event-managed objects.
  
-===== Progressive Stock =====+===== Several copies of the same object =====
  
-Declare the same ''name:'' multiple times on the same ''location:'' to simulate a decreasing stock. Each pickup activates the next slot.+Declaring the same ''name:'' several times now means several **real copies**, including across different furniture or rooms. Taking one no longer hides the others, and each keeps its own description in the scenery.
  
 <code yaml> <code yaml>
Ligne 63: Ligne 66:
   - name: coin   - name: coin
     location: chest     location: chest
-    furniture_description: "The chest contains three coins." +    description: "worn silver coin."
-    description: "gold coin." +
-    pickup_text: "You take a coin. Two remain."+
   - name: coin   - name: coin
-    location: chest +    location: purse 
-    furniture_description: "The chest still contains two coins." +    description: "A coin still warm from someone's hand."
-    description: "gold coin." +
-    pickup_text: "You take a coin. One remains."+
 </code> </code>
 +
 +The inventory groups them as ''coin x 2''. Throwing, using or removing an object only consumes one unit, and the historical ''object'' / ''-object'' conditions keep their meaning.
 +
 +===== How many copies can be held =====
 +
 +''inventory-limit:'' sets the maximum. Without it, the player holds **one** copy. ''0'' means unlimited.
 +
 +<code yaml>
 +objects:
 +  - name: torch
 +    location: wall
 +    inventory-limit: 3
 +    inventory-limit-message: "You already carry three torches."
 +</code>
 +
 +Going over the limit is a normal narrative answer, not an error: the engine states how many copies are already held and what the limit is, then leaves the commands available. The two optional messages accept the usual text processing, including ''v_variable_v'' and ''t_variable_t''.
  
 ===== Object Conditions ===== ===== Object Conditions =====
Ligne 81: Ligne 96:
 if: "-key"     # player does not own key if: "-key"     # player does not own key
 </code> </code>
 +
 +===== Quantity conditions =====
 +
 +A structured condition compares the number of copies held.
 +
 +<code yaml>
 +events:
 +  - if:
 +      object: coin
 +      quantity: 3
 +      operator: ">="
 +    text: "You have enough coins to pay the ferryman."
 +</code>
 +
 +The editor offers this setting in its condition builder.
  
 ===== Add or Remove an Object with do: ===== ===== Add or Remove an Object with do: =====
Ligne 110: Ligne 140:
  
 ''description:'' and ''furniture_description:'' accept the same media syntax as narrative text: images ''%%[[url]]%%'', sounds ''%%<<url>>%%'' and videos ''%%((url))%%''. ''description:'' and ''furniture_description:'' accept the same media syntax as narrative text: images ''%%[[url]]%%'', sounds ''%%<<url>>%%'' and videos ''%%((url))%%''.
 +
 +Clicking an object in the inventory automatically runs ''inspect <object>''.
 +
 +===== See also =====
 +
 +  * [[en:yaml:conditions|Conditions]]
 +  * [[en:yaml:actions|Custom actions]]
 +  * [[en:yaml:medias|Sounds, images and videos]]
 +
en/yaml/objets.1777826863.txt.gz · Dernière modification : de cyrilfiesta