Outils pour utilisateurs

Outils du site


en:yaml:texte

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:texte [2026/08/30 22:27] – maj 4.14 : dialogues, videos hebergees, mise en page, doc EN completee cyrilfiestaen:yaml:texte [2026/11/04 23:30] (Version actuelle) – Documentation 4.17 : objets, evenements et mise en page verifies cyrilfiesta
Ligne 44: Ligne 44:
  
 Supported languages: ''diff'', ''yaml'', ''python'', ''js'', ''json'', ''bash'', and every language handled by highlight.js on web and desktop. On Discord, they fall back to a plain code block. Supported languages: ''diff'', ''yaml'', ''python'', ''js'', ''json'', ''bash'', and every language handled by highlight.js on web and desktop. On Discord, they fall back to a plain code block.
- 
  
 ===== Story Blocks ===== ===== Story Blocks =====
Ligne 89: Ligne 88:
     text: "A styled badge"     text: "A styled badge"
 </code> </code>
 +
 +^ Key ^ Value ^
 +| ''size:'' | Size in pixels, such as ''18'' or ''24''. |
 +| ''font:'' | CSS font family, such as ''Georgia'', ''monospace'' or ''cursive''. |
 +| ''background:'' | CSS background color, such as ''"#111827"''. |
 +| ''text-color:'' | CSS text color, such as ''"#facc15"''. |
 +
 +These keys apply to the whole block on Web and Desktop; Discord and Terminal ignore them. Use inline Markdown to style a single word.
  
 ===== Room Background ===== ===== Room Background =====
Ligne 98: Ligne 105:
   text: "The room is dark."   text: "The room is dark."
 </code> </code>
- 
  
 ===== The global markdown: field ===== ===== The global markdown: field =====
Ligne 111: Ligne 117:
 | ''quote'' | Blockquote | | ''quote'' | Blockquote |
 | ''story'' | Story blocks enabled | | ''story'' | Story blocks enabled |
-| ''py'' / ''yaml'' / ''js'' / … | Highlighted code block | +| ''py'' / ''yaml'' / ''js'' / ... | Highlighted code block |
  
 ===== Interactive Inline Elements ===== ===== Interactive Inline Elements =====
Ligne 119: Ligne 124:
  
 <code yaml> <code yaml>
-text: "The %%{{door:?An old door.}}%% is locked." +text: 
-text: "Touch the %%{{lever:@pull_lever}}%%." +  - "The {{door:?An old door.}} is locked." 
-text: "Drop the %%{{key:>key}}%% onto the %%{{door:$door}}%%."+  - "Touch the {{lever:@pull_lever}}." 
 +  - "Drop the {{key:>key}} onto the {{door:$door}}."
 </code> </code>
  
Ligne 127: Ligne 133:
  
 Tiles and grids use the extended picture syntax: [[en:yaml:tiles-tilemaps|Tiles and tilemaps]]. Tiles and grids use the extended picture syntax: [[en:yaml:tiles-tilemaps|Tiles and tilemaps]].
- 
  
 ===== Reusing the text of another room ===== ===== Reusing the text of another room =====
Ligne 143: Ligne 148:
 To build a conversation rather than plain text, see [[en:yaml:dialogues|Dialogues and sequences]]. To build a conversation rather than plain text, see [[en:yaml:dialogues|Dialogues and sequences]].
  
 +===== Listing choices in the text =====
 +
 +''%%[[choice_vertical]]%%'' lists the current room's choice aliases on separate lines. ''%%[[choice_horizontal]]%%'' separates them with "/". The French forms ''%%[[choix_vertical]]%%'' and ''%%[[choix_horizontal]]%%'' work too.
 +
 +<code yaml>
 +rooms:
 +  - id: start
 +    text: |
 +      What would you like to do?
 +
 +      [[choice_vertical]]
 +    choices:
 +      - command: search
 +        to: chest
 +      - to: corridor
 +  - id: chest
 +    text: The chest.
 +  - id: corridor
 +    text: The corridor.
 +</code>
 +
 +The list shows "search" and "2". Without an alias, a choice uses its position in the declared list, usable directly or with ''go''. Edited aliases and added choices are included during play and in the preview. Choices hidden by conditions are omitted; the other choices keep their numbers.
 +
 +The [[en:editeur:generation|interactive fiction generator]] can add this text, numbered aliases and choice buttons. Directional exit text for mazes and dungeons is replaced during generation instead.
 +
 +===== Composed text and loops (4.17) =====
 +
 +A group can carry a condition and style, then contain other text blocks or loops. Styles are inherited; children can override them.
 +
 +<code yaml>
 +text:
 +  - if: v_visible_v = 1
 +    size: 23
 +    text:
 +      - for_each: item
 +        in: bag
 +        do:
 +          - text: t_item_t
 +</code>
 +
 +Declare ''visible'' in ''vars:'' and ''bag'' in ''lists:''. In text or a HUD, loops cannot change data. The usual media are allowed, without pauses or interactions; repetition depends on author conditions and the client's playback rules.
 +
 +Write media tags in the scenario: ''%%[[t_item.image_t]]%%'' reads an address. An inserted value such as ''t_item.name_t'' stays text even if it contains tags. See [[en:yaml:listes-boucles|Lists and loops]]. In the editor, **Composed content** creates this group.
 +
 +===== Furniture item and vertical inventory =====
 +
 +''%%[[ITEM_IN:coffre]]%%'' inserts the identifier of the first item present in that furniture in the current room, or empty text if it is empty. The French form is ''%%[[OBJET_DANS:coffre]]%%''.
 +
 +''%%[[INVENTORY_VERTICAL]]%%'' lists one item per line, using item identifiers and grouped quantities. The French form is ''%%[[INVENTAIRE_VERTICAL]]%%''.
 +
 +<code yaml>
 +title: 'Wiki 4.17: inventory'
 +language: en
 +rooms:
 +  - id: atelier
 +    auto_refresh: true
 +    text: |
 +      Inventory:
 +      [[INVENTORY_VERTICAL]]
 +      First item in coffre: [[ITEM_IN:coffre]]
 +    objects:
 +      - name: cle
 +        location: coffre
 +        pickup_reaction: Take
 +    choices:
 +      - command: regarder
 +        button: Look
 +        to: atelier
 +</code>
 +
 +''pickup_reaction: Take'' adds the native pickup button for this item in its furniture. ''auto_refresh: true'' refreshes the text after pickup: the key appears in the vertical inventory and the chest is empty. The "Look" choice displays the room again without taking an item.
 +
 +===== Previous room name =====
 +
 +''%%[[SALLE_PRECEDENTE]]%%'' inserts the known previous room ID, not its text or button label. Before the first move, the result is empty. Keep this French tag on English pages too: it has no English alias.
 +
 +<code yaml>
 +title: 'Wiki 4.17: previous'
 +rooms:
 +- id: entree
 +  text: 'Previous: [[SALLE_PRECEDENTE]]'
 +  choices:
 +  - button: Continue
 +    to: atelier
 +- id: atelier
 +  text: 'Previous: [[SALLE_PRECEDENTE]]'
 +  choices:
 +  - button: Back
 +    to: entree
 +</code>
 +
 +===== Local alignment and sized splits =====
 +
 +On Web, Desktop and in HTML exports, ''%%[[align:left]]text[[/align]]%%'' aligns a block. Directions are ''left'', ''center'', ''right'' or ''gauche'', ''centre'', ''droite''. A text variable such as ''t_cote_t'' can provide the direction. Close the block with ''%%[[/align]]%%''.
 +
 +''%%[[split]]%%'' separates zones. ''%%[[split:40]]%%'' gives 40% to the previous zone; the next receives the remainder. Splits and alignment also work in HUD panels.
 +
 +<code yaml>
 +title: 'Wiki 4.17: alignment'
 +vars_text:
 +  cote: right
 +rooms:
 +- id: atelier
 +  text: |
 +    [[align:left]]Left.[[/align]]
 +    [[align:center]]Center.[[/align]]
 +    [[align:t_cote_t]]Right.[[/align]]
 +    [[split:40]]
 +    Second zone.
 +  choices:
 +  - command: rester
 +    button: Stay
 +    to: atelier
 +</code>
  
en/yaml/texte.1788121647.txt.gz · Dernière modification : de cyrilfiesta