From 9d4b799db4868bcab291b83599ff088763cd4ed6 Mon Sep 17 00:00:00 2001 From: historia <[not public]> Date: Wed, 24 Jun 2026 20:58:25 -0400 Subject: feat: new type of non-violent 'combat': work --- building_guide/conditions.md | 80 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 building_guide/conditions.md (limited to 'building_guide/conditions.md') diff --git a/building_guide/conditions.md b/building_guide/conditions.md new file mode 100644 index 0000000..ea17ed6 --- /dev/null +++ b/building_guide/conditions.md @@ -0,0 +1,80 @@ +## Conditions Reference + +Conditions are used in talk options, exit gates, on-enter scripts, and use_interactions checks. + +### Simple conditions + +A bare `flag:` / `player_flag:` check passes when the flag is **set to a truthy +value** (`true`, a non-zero number, a non-empty string). Add `value:` only when +you need to match a specific value (e.g. a numeric quest stage). `not: true` +inverts any check. + +```yaml +# Check a world flag is set +condition: + flag: gate_open + +# Check a world flag is NOT set +condition: + flag: gate_open + not: true + +# Check a player flag is set +condition: + player_flag: finished_tutorial + +# Check a player flag is NOT set (e.g. only on the first visit) +condition: + player_flag: finished_tutorial + not: true + +# Match a specific (non-boolean) value +condition: + player_flag: quest_stage + value: 3 + +# Check if player has an item +condition: + has_item: bronze_key + +# Check if player does NOT have an item +condition: + has_item: bronze_key + not: true + +# Check if player has enough credits +condition: + min_credits: 50 +``` + +### Compound conditions + +All must pass: +```yaml +condition: + all_of: + - flag: gate_open + - has_item: pass_stub +``` + +Any one must pass: +```yaml +condition: + any_of: + - has_item: bronze_key + - has_item: iron_key + - player_flag: master_of_unlocking +``` + +Nested compounds: +```yaml +condition: + all_of: + - player_flag: quest_started + - any_of: + - has_item: wolf_pelt + - has_item: bear_pelt +``` + +--- + -- cgit v1.2.3