Outils pour utilisateurs

Outils du site


en:yaml:evenements

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:evenements [2026/08/30 22:25] – maj 4.14 : dialogues, videos hebergees, mise en page, doc EN completee cyrilfiestaen:yaml:evenements [2026/11/04 21:35] (Version actuelle) – Documentation 4.17 : objets, evenements et mise en page verifies cyrilfiesta
Ligne 3: Ligne 3:
 ====== Events (YAML) ====== ====== Events (YAML) ======
  
-Events are action blocks triggered automatically when entering a room, or manually through buttons.+Events are action blocks run automatically or called through an interaction, such as a button, shortcut or ''trigger_event:id''. A button waits for a click. Without a button, ''manual: true'' or a shortcut makes the event manual. Merely referencing its ID in ''trigger_event:'' never makes it manual: otherwise it is still evaluated on entry and after commands.
  
 ===== Base Syntax ===== ===== Base Syntax =====
Ligne 26: Ligne 26:
 | ''score.=.v_other_v'' | Copy another variable. | | ''score.=.v_other_v'' | Copy another variable. |
 | ''score.=.%1:6'' | Random value from 1 to 6. | | ''score.=.%1:6'' | Random value from 1 to 6. |
 +| ''score.=.%1:70,5:20,10:10'' | Weighted draw: 1 has weight 70, 5 and 10 have weights 20 and 10. |
 | ''object&&inventory&&Description'' | Add an object. | | ''object&&inventory&&Description'' | Add an object. |
 | ''-object&&inventory&&null'' | Remove an object. | | ''-object&&inventory&&null'' | Remove an object. |
Ligne 33: Ligne 34:
 | ''timer_global:id:ON'' | Start a global timer. | | ''timer_global:id:ON'' | Start a global timer. |
 | ''timer_global:id:OFF'' | Stop a global timer. | | ''timer_global:id:OFF'' | Stop a global timer. |
-| ''trigger_event:id'' | Trigger a global event directly. |+| ''trigger_event:id'' | Call an enabled local or global event by its id. | 
 + 
 +Several actions in one event: 
 + 
 +<code yaml> 
 +do: 
 +  - "hp.+.5" 
 +  - "score.+.10" 
 +  - "event_global:visit_bonus:ON" 
 +</code>
  
 ===== Endings ===== ===== Endings =====
Ligne 46: Ligne 56:
     text: "Congratulations!"     text: "Congratulations!"
 </code> </code>
 +
 +''do:'' can be combined with ''end:''; its effects run before the game ends.
  
 ===== Redirection ===== ===== Redirection =====
Ligne 101: Ligne 113:
 ''visible-if:'' hides the button when the condition is false. ''disabled-if:'' keeps the button visible but inactive when the condition is true. ''visible-if:'' hides the button when the condition is false. ''disabled-if:'' keeps the button visible but inactive when the condition is true.
  
-⚠ On Discord, buttons are frozen inside the message that was sent. Clicking 🔄 (refresh) forces a redisplay with up to date buttons.+On Discord, buttons are frozen inside the message that was sent. Clicking 🔄 (refresh) forces a redisplay with up to date buttons.
  
 ===== Conditional text on an event ===== ===== Conditional text on an event =====
Ligne 118: Ligne 130:
 ===== Sequential behaviour ===== ===== Sequential behaviour =====
  
-⚠ Important: events run in order. Each one sees the values **already changed** by the previous ones. An event carrying ''to:'' or ''end:'' **stops** the ones after it.+Important: events run in order. Each one sees the values **already changed** by the previous ones. An event carrying ''to:'' or ''end:'' **stops** the ones after it.
  
 ===== Timer started by an event ===== ===== Timer started by an event =====
Ligne 159: Ligne 171:
 Local events can be controlled with ''event:id:ON'', ''event:id:OFF'' and ''event:id:SWITCH''. Local events can be controlled with ''event:id:ON'', ''event:id:OFF'' and ''event:id:SWITCH''.
  
 +===== Manual event without a button =====
 +
 +^ Key ^ Effect ^
 +| ''manual: true'' | Prevents automatic execution, without adding a button. |
 +
 +A choice can call this event explicitly. Its conditions, state and usage limits still apply.
 +
 +<code yaml>
 +title: 'Wiki 4.17: manual'
 +rooms:
 +- id: depart
 +  text: Start.
 +  events:
 +  - id: alerte
 +    manual: true
 +    text: Called only by the choice.
 +  choices:
 +  - command: appeler
 +    button: Call
 +    to: depart
 +    effect: trigger_event:alerte
 +</code>
 +
 +The alert text is absent on entry. The "Call" choice triggers it. Removing ''manual: true'' also makes it automatic; ''trigger_event:'' does not change that rule. French: ''manuel: true'' and ''declencher_event:alerte''.
  
en/yaml/evenements.1788121545.txt.gz · Dernière modification : de cyrilfiesta