From 5c0d56f97c14820813ac93c81b7608fdf449490e Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 15 Apr 2026 09:06:20 +0200 Subject: [PATCH] Update NPC dialogue handling in runtime scene build --- src/runtime-three/runtime-scene-build.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/runtime-three/runtime-scene-build.ts b/src/runtime-three/runtime-scene-build.ts index c7580d96..cc967782 100644 --- a/src/runtime-three/runtime-scene-build.ts +++ b/src/runtime-three/runtime-scene-build.ts @@ -61,7 +61,9 @@ import { type WorldSettings } from "../document/world-settings"; import { + cloneProjectDialogue, cloneProjectDialogueLibrary, + type ProjectDialogue, type ProjectDialogueLibrary } from "../dialogues/project-dialogues"; import { @@ -236,7 +238,8 @@ export interface RuntimeNpc { position: Vec3; yawDegrees: number; modelAssetId: string | null; - dialogueId: string | null; + dialogues: ProjectDialogue[]; + defaultDialogueId: string | null; collider: FirstPersonPlayerShape; activeRoutineTitle: string | null; animationClipName: string | null; @@ -510,7 +513,8 @@ export function createRuntimeNpcFromDefinition( position: cloneVec3(npc.position), yawDegrees: npc.yawDegrees, modelAssetId: npc.modelAssetId, - dialogueId: npc.dialogueId, + dialogues: npc.dialogues.map(cloneProjectDialogue), + defaultDialogueId: npc.defaultDialogueId, collider: cloneRuntimeCharacterShape(npc.collider), activeRoutineTitle: npc.activeRoutineTitle, animationClipName: npc.animationClipName, @@ -1333,7 +1337,8 @@ function buildRuntimeSceneCollections( yawDegrees: entity.yawDegrees, authoredYawDegrees: entity.yawDegrees, modelAssetId: entity.modelAssetId, - dialogueId: entity.dialogueId, + dialogues: entity.dialogues.map(cloneProjectDialogue), + defaultDialogueId: entity.defaultDialogueId, collider: createRuntimeCharacterShape(entity.collider), animationClipName: null, animationLoop: undefined,