diff options
Diffstat (limited to 'building_guide')
| -rw-r--r-- | building_guide/triggers.md | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/building_guide/triggers.md b/building_guide/triggers.md index 7ef9b4c..60b1c82 100644 --- a/building_guide/triggers.md +++ b/building_guide/triggers.md @@ -53,7 +53,6 @@ its steps run as a scripted sequence. aps_node: false on_player_flag: "" # on_flag_change only on_global_flag: "" # on_global_flag_change only - value: null # value-match filter for flag triggers ``` Field meanings: @@ -66,7 +65,6 @@ Field meanings: | `steps` | all | Ordered list of Step entries run as a scripted sequence. | | `on_player_flag` | on_flag_change only | Player flag this trigger watches. | | `on_global_flag` | on_global_flag_change only | Global flag this trigger watches. | -| `value` | flag triggers | Optional value-match filter; trigger only fires when the flag changes to this value. | ### Step vocabulary @@ -261,7 +259,8 @@ triggers watching that flag. `on_flag_change` and `on_global_flag_change` replace the old room `triggers:` block. Each entry carries the flag it watches (`on_player_flag` or `on_global_flag`), an optional -`value` filter, an optional `condition`, and a `steps` list. +`condition` (use `player_flag`/`global_flag` + `value` to match a specific flag value), and +a `steps` list. Key behaviors: @@ -293,21 +292,28 @@ To migrate the old room `triggers:` block, replace `triggers:` with `on_flag_cha ### Value-matching flag triggers -By default a flag trigger fires when the watched flag becomes truthy. Add `value:` to -require a specific value — enabling multi-stage quests off one numeric flag: +By default a flag trigger fires when the watched flag becomes truthy. Use a `condition` with +a `player_flag`/`global_flag` + `value` to require a specific value — enabling multi-stage +quests off one numeric flag: ```yaml on_flag_change: - on_player_flag: quest_stage - value: 1 + condition: + player_flag: quest_stage + value: 1 steps: - messages: ["Quest started — find the crystal shard."] - on_player_flag: quest_stage - value: 2 + condition: + player_flag: quest_stage + value: 2 steps: - messages: ["You found the shard — return to the elder."] - on_player_flag: quest_stage - value: 3 + condition: + player_flag: quest_stage + value: 3 steps: - messages: ["The ritual begins..."] - wait: 10 @@ -608,9 +614,11 @@ on_look: # data/rooms/city/5002_alley.yaml on_flag_change: - on_player_flag: investigation - value: 1 condition: - room: 5002 + all_of: + - player_flag: investigation + value: 1 + - room: 5002 steps: - wait: 3 messages: ["You notice a trail of blood leading east..."] @@ -624,9 +632,11 @@ on_flag_change: # data/rooms/city/5003_warehouse.yaml on_flag_change: - on_player_flag: investigation - value: 2 condition: - room: 5003 + all_of: + - player_flag: investigation + value: 2 + - room: 5003 steps: - wait: 3 messages: ["A glint of metal catches your eye under a crate."] @@ -639,9 +649,11 @@ spawns boss # data/rooms/city/5004_docks.yaml on_flag_change: - on_player_flag: investigation - value: 3 condition: - room: 5004 + all_of: + - player_flag: investigation + value: 3 + - room: 5004 steps: - wait: 5 broadcast: "A shadow detaches itself from the warehouse wall..." |
