Outils pour utilisateurs

Outils du site


en:yaml:actions

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
en:yaml:actions [2026/05/03 18:29] – Add English wiki page using real engine keys cyrilfiestaen:yaml:actions [2026/10/20 22:22] (Version actuelle) – Modèles sur_place, portée des encadrés et objets 4.17 cyrilfiesta
Ligne 1: Ligne 1:
-**Language:** [[fr:yaml:actions|Français]] | **English**+**Language / Langue :** [[fr:yaml:actions|FR]] | **EN**
  
 ====== Custom Actions (YAML) ====== ====== Custom Actions (YAML) ======
Ligne 43: Ligne 43:
  
 ^ Variable ^ Value ^ ^ Variable ^ Value ^
-| ''t_action_cible_t'' | Raw target typed by the player. |+| ''t_action_cible_t'' | Typed target, or resolved identifier when an object's display name is recognised. |
 | ''t_action_cible_ok_t'' | Last valid target. | | ''t_action_cible_ok_t'' | Last valid target. |
  
Ligne 49: Ligne 49:
  
 Several actions with the same ''verb'' and ''target'' are tested in order. The first true condition wins. Several actions with the same ''verb'' and ''target'' are tested in order. The first true condition wins.
 +
 +<code yaml>
 +actions:
 +  - verb: combine
 +    target: herb
 +    if: "herb t_combination_t.=.nothing"
 +    do:
 +      - object: herb
 +        to: inventory
 +        remove: true
 +      - text_var: combination
 +        value: "herb"
 +    text_ok: "The herb goes into the still."
 +    text_ko: "You do not have any herb."
 +
 +  - verb: combine
 +    target: all
 +    if: ~
 +    text_ok: "t_action_cible_t is not a known ingredient."
 +</code>
 +
 +Declare ''combination'' in ''text_vars:'' with the initial value ''nothing''. Local actions are tested before global actions.
  
 ===== Action Alias ===== ===== Action Alias =====
Ligne 81: Ligne 103:
     text_ko: "You do not have a potion."     text_ko: "You do not have a potion."
 </code> </code>
 +
 +===== Data, loops and shortcuts (4.17) =====
 +
 +''do:'' accepts spaced effects such as ''health + 10'', list operations, conditional groups and loops. See [[en:yaml:listes-boucles|Lists, collections and loops]].
 +
 +Actions, choices and events can have a [[en:yaml:raccourcis|keyboard, mouse or gamepad shortcut]], with or without a button. Interaction conditions and limits still apply.
 +
 +===== Object display names =====
 +
 +Action targets and ''t_action_target_t'' retain the object identifier, even when the player types its display name. Explicit targets keep priority. To change the visible name during play:
 +
 +<code yaml>
 +do:
 +  - display_name: workshop_key
 +    value: identified key
 +</code>
 +
 +An empty value restores the original identifier. See [[en:yaml:objets|Objects: display names, renaming and secret scenery]] for rules and examples.
  
en/yaml/actions.1777825786.txt.gz · Dernière modification : de cyrilfiesta