You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
playable:true, // ← this character is player-controllable
20
+
wanderer:true, // ← if inactive, this character wanders the scene
20
21
largeBubble:false, // ← thought bubble anchors normally
21
22
outfits: {
22
23
pajamas: { // alternate render config (see below)
@@ -71,7 +72,20 @@ When more than one playable character is registered, the engine automatically of
71
72
72
73
1. Stores the new active character id
73
74
2. Rebuilds the active walker with the new character's render config
74
-
3. Emits a `characterchange` event that NPC reactions can listen for
75
+
3. Repositions the newly active character to where the previous active character stood
76
+
4. Updates the inactive wandering characters (see below)
77
+
5. Emits a `characterchange` event that NPC reactions can listen for
78
+
79
+
## Wanderers (Inactive Characters)
80
+
81
+
When multiple playable characters are registered, the currently unselected (inactive) characters can autonomously wander around the scene. The engine manages these characters through `engineScene.idleCharacters`.
82
+
83
+
To enable wandering, you must opt-in:
84
+
-**Registry Opt-in:** Set `wanderer: true` when registering the character. They will automatically wander whenever they are inactive.
85
+
-**Explicit Override:** Pass a `wanderers` array to the spawn method in your scene's `create()`: `this.spawnIdleCharacters({ wanderers: ["sister"] })`.
86
+
-**Suppressing:** Set `disableIdleCharacter: true` in your `AdventureSceneConfig` to completely disable wanderers for that scene.
87
+
88
+
You can also provide a `greeting` callback to `spawnIdleCharacters` to give them click-to-speak dialogue lines.
0 commit comments