diff options
Diffstat (limited to 'building_guide/behaviors.md')
| -rw-r--r-- | building_guide/behaviors.md | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/building_guide/behaviors.md b/building_guide/behaviors.md index c7b091d..ce266c1 100644 --- a/building_guide/behaviors.md +++ b/building_guide/behaviors.md @@ -185,7 +185,8 @@ name: Guard talk: nodes: start: - message: "\"Halt! This area is restricted.\" The guard eyes you suspiciously." + messages: + - "\"Halt! This area is restricted.\" The guard eyes you suspiciously." options: - text: "\"What's behind that gate?\"" goto: about_gate @@ -202,7 +203,8 @@ talk: # no goto = end conversation about_gate: - message: "\"Supplies. Weapons.\" He shifts his weight. \"Bring me some copper ore and I'll stamp you a pass.\"" + messages: + - "\"Supplies. Weapons.\" He shifts his weight. \"Bring me some copper ore and I'll stamp you a pass.\"" action: set_player_flags: talked_to_guard: true @@ -214,7 +216,8 @@ talk: has_item: copper_ore trade_ore: - message: "\"Good quality ore.\" He stamps a pass and hands it to you." + messages: + - "\"Good quality ore.\" He stamps a pass and hands it to you." action: take_item: copper_ore give_item: pass_stub @@ -224,7 +227,8 @@ talk: - text: "\"Thanks.\"" has_pass: - message: "\"Alright, I'll open the gate.\"" + messages: + - "\"Alright, I'll open the gate.\"" action: set_flags: gate_open: true @@ -236,9 +240,8 @@ talk: | Field | Type | Description | |---|---|---| -| `message` | string or list | NPC dialogue. May be a single string or a list of strings (pick one at random). | -| `sequence` | []string | NPC monologue — each message shown one at a time, player presses enter to advance. Options appear after the last message. Takes priority over `message` if both present. | -| `condition` | Condition | Optional. If the condition fails, the node is skipped entirely — its message, action, and options are not shown. Use with `goto` to auto-advance to a different node. | +| `messages` | []string | NPC dialogue, shown one at a time. The player presses enter to advance through each message. Options appear after the last message. A single-element list works like a simple one-shot line. | +| `condition` | Condition | Optional. If the condition fails, the node is skipped entirely — its messages, action, and options are not shown. Use with `goto` to auto-advance to a different node. | | `action` | NodeAction | Fires when the node is entered (give items, set flags, etc). | | `options` | []TalkOption | Player choices. If empty and `goto` is set, auto-advances. | | `goto` | string | Node ID to auto-advance to when there are no visible options OR when the node condition fails. | @@ -262,14 +265,12 @@ talk: | `take_item` | Removes an item from the player's inventory. | | `teleport` | Moves the player to a room ID. | | `heal` | Restores that many hitpoints. | -| `cost` | Credits charged for the action. | -| `assign_task` | Assigns a random assassin task based on assassin level. | -| `skip_task` | Cancels current assassin task, costs 30 reputation, resets streak. | -| `extend_task` | Adds 50% more kills to current task, costs 30 reputation. | +| `credits` | Credits charged (negative) or awarded (positive). | | `reputation_cost` | Deducts reputation from `assassin_reputation` flag before other actions. | -| `sawmill` | Opens sawmill plank conversion interface. | | `aps_node` | Marks this room's APS node as unlocked. | +> **Planned (not yet implemented):** `assign_task`, `skip_task`, `extend_task`, and `sawmill` are under design and will be added in a future update. + All fields in a single action are processed together — give an item, take an item, set flags, and heal in one node. @@ -294,11 +295,12 @@ simple transactions: ```yaml nodes: start: - message: "Welcome! Houses are 10 credits. Interested?" + messages: + - "Welcome! Houses are 10 credits. Interested?" options: - text: "Yes, I'll buy one." action: - cost: 10 + credits: -10 set_player_flags: owns_house: true goto: purchased @@ -307,7 +309,8 @@ nodes: not: true - text: "No thanks." purchased: - message: "Excellent! The plot is yours." + messages: + - "Excellent! The plot is yours." options: - text: "Thanks!" goto: start @@ -316,9 +319,9 @@ nodes: If an option has both an `action` and a `goto`, the action runs first, then the player navigates to the target node (which may also have its own action, fired on entry). -#### Sequences +#### Multi-message nodes -`sequence` is a flat list of NPC messages shown one at a time. The player presses +`messages` is a list of NPC lines shown one at a time. The player presses enter to advance through each message. After the last message, the node's options (if any) are displayed. This is the preferred way to deliver NPC monologues — no named nodes or `goto` chains needed: @@ -326,7 +329,7 @@ named nodes or `goto` chains needed: ```yaml nodes: sign_reminder: - sequence: + messages: - "\"Yeah, just us two! Not a lot of people heading into the belt these days.\"" - "\"But we'll be landing shortly! Please look at the information sign.\"" options: @@ -335,11 +338,11 @@ nodes: ``` Each `[enter to continue]` prompt is automatic. The node's action fires once on -entry, before the first sequence message. Node conditions still work normally — +entry, before the first message. Node conditions still work normally — if the condition fails, the entire sequence is skipped via `goto`. -If a sequence node has no options after the last message and `goto` is set, it -auto-advances to the target node. Non-empty input during a sequence cancels the +If a multi-message node has no options after the last message and `goto` is set, it +auto-advances to the target node. Non-empty input during messages cancels the conversation (just like invalid input does during option selection). #### Randomized messages |
