refactor scaffolding to Scenes and Characters for intuitive writing with

yarn
This commit is contained in:
2026-08-14 13:58:07 +02:00
parent 98fe1794c6
commit f8def361fa
9 changed files with 129 additions and 22 deletions
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3148b8572d5194e449b23abaac9e717f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,45 @@
// Everything the bouncer ever says.
//
// These nodes share a title, which makes them a node group. Callers just
// `<<detour Bouncer_Talk>>` and Yarn runs the most specific variation whose
// `when:` conditions pass. Adding a new variation later means adding a node,
// not editing a growing <<if>> chain.
//
// Each variation sets $went_inside so the calling scene knows the verdict.
title: Bouncer_Talk
when: once
---
Bouncer: Evening. Name on the list?
You: Depends who's asking.
-> I'm on the list.
<<set $claimed_to_be_on_list = true>>
Bouncer: ...you're not on the list.
Bouncer: But it's slow tonight. Go on.
<<set $went_inside = true>>
-> Actually, I'll head home.
Bouncer: Smart choice.
<<set $went_inside = false>>
===
title: Bouncer_Talk
when: $is_vip
---
Bouncer: Didn't even see you there. Go on in.
<<set $went_inside = true>>
===
title: Bouncer_Talk
when: $claimed_to_be_on_list
---
Bouncer: Still not on the list, I assume.
Bouncer: Go on, before I change my mind.
<<set $went_inside = true>>
===
title: Bouncer_Talk
when: always
---
Bouncer: Back again.
<<set $went_inside = true>>
===
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: e1b092662c3154b80b7e9207e2879c60
guid: 582cd3b2ab9274b8ca0737660a0d6b1a
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
@@ -0,0 +1,21 @@
// Shared declarations for the whole project.
//
// This node is never played. Declaring every variable in one place means the
// compiler catches typos ("$reputaton") instead of silently creating a second
// variable at runtime.
title: Declarations
---
// How much the door staff likes you.
<<declare $reputation = 0 as number>>
// Set when the player has tried the "I'm on the list" line at least once.
<<declare $claimed_to_be_on_list = false as bool>>
// The bouncer's verdict, read by the scene that called him.
<<declare $went_inside = false as bool>>
// Smart variable: derived, not stored. Can never drift out of sync with
// $reputation, so there's nothing to remember to update.
<<declare $is_vip = $reputation > 10>>
===
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 29774b2adf9214b77a6d280d2e604353
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 94073015eacc34c1d8fc6786e43d60ca, type: 3}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3c89177cea38e403eb2f13330e1245be
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,26 @@
// The door. Scene files stay thin: they set the stage, detour into character
// nodes for the actual talking, then branch on the outcome.
//
// `Start` is the DialogueRunner's entry node (set on the Dialogue System
// prefab), so this is where the game begins.
title: Start
---
Narrator: Neon bleeds across wet asphalt. The queue hasn't moved in ten minutes.
<<detour Bouncer_Talk>>
<<if $went_inside>>
<<jump Entrance_Inside>>
<<else>>
<<jump Entrance_Outside>>
<<endif>>
===
title: Entrance_Inside
---
Narrator: The bass hits you like a wall.
===
title: Entrance_Outside
---
Narrator: The night swallows you back up.
===
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: cb0faaa47fe2440d78e49de30f921218
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 94073015eacc34c1d8fc6786e43d60ca, type: 3}
@@ -1,21 +0,0 @@
title: Start
---
Bouncer: Evening. Name on the list?
You: Depends who's asking.
-> I'm on the list.
Bouncer: ...you're not on the list.
<<jump Inside>>
-> Actually, I'll head home.
Bouncer: Smart choice.
<<jump Outside>>
===
title: Inside
---
Narrator: The bass hits you like a wall.
===
title: Outside
---
Narrator: The night swallows you back up.
===