Skip to content

Fix/dialog fixes#379

Merged
BoroBongo merged 6 commits into
mainfrom
fix/dialog-fixes
Jun 16, 2026
Merged

Fix/dialog fixes#379
BoroBongo merged 6 commits into
mainfrom
fix/dialog-fixes

Conversation

@BoroBongo

@BoroBongo BoroBongo commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Prevent dialog queue freeze when an NPC audio file is missing — Output action no longer blocks the queue waiting for a clip that will never load; falls through gracefully so the conversation continues (Temple Guard if he has nothing to say)
  • Fix ambient NPC dialogs showing total=0 for guild NPCs — NpcService now correctly counts available ambient dialog options for NPCs whose dialogs are registered by guild rather than by individual instance (Shadow, OC Guard, Not-named-NPCs)
  • Play hero greeting SVM in parallel with the NPC turn animation — previously the hero's greeting line waited for the NPC to finish turning, causing an unnatural silence; now both run concurrently. Required adding PlayInParallel support to INpcSubtitles/VRSubtitles and updating OutputSvm and DialogModel (Hey du!)
  • Add missing $sc_heywaitasecond SVM mapping in ZenKitExtension — the "hey wait a second" voice line was falling through unresolved and playing silently

How to test

  1. Find an NPC with a missing voice line (or temporarily rename an audio file to simulate), start a conversation — verify the dialog does not freeze and subsequent lines play normally (PSI Temple Guard after we tell him that Lester had sent us - talk to him after and he won't softlock player anymore)
  2. Walk up to a group of generic guild NPCs (e.g. Old Camp guards) and trigger ambient smalltalk — verify the conversation starts and lines are spoken (not total=0 - Above Temple Guard is what we don't want for those)
  3. Walk up to any NPC and let the auto-greeting trigger — verify the hero's SVM greeting plays at the same time as the NPC turns to face the player, with no awkward gap
  4. Walk to Ratford -> he should talk to the hero. 'Important' dialog options don't trigger hero SVM

BoroBongo and others added 5 commits June 15, 2026 21:44
Output.Start() was throwing NullReferenceException on audioClip.length
when a .wav wasn't found, leaving _audioPlaySeconds=0 and
_randomDialogAnimationName=null. IsFinished() then threw on every frame
trying to StopAnimation(null), so the action never completed and the
player stayed locked with LockPlayerInPlace() forever.

Fix: null-guard audioClip with a 3s fallback display duration; guard
_randomDialogAnimationName in IsFinished() before calling StopAnimation.

DialogService.StartDialog() was also calling ShowDialog([]) when the
selectableDialogs list came up empty after a choice callback (e.g. after
the PSI temple guard says "Lester is trustworthy, you may pass"). Now
calls StopDialog() instead, properly releasing the player.
ZenKit fails to execute `B_AssignAmbientInfos` Daedalus member assignments
like `Info_Grd_6_EXIT.npc = X` inside function bodies ("C_INFO.NPC without
an instance set"). Added `TryAssignAmbientDialogs` in `NpcService.SetDialogs`
which matches C_INFO symbol names by guild abbreviation and voice number
(e.g. INFO_GRD_6_*, INFO_STT_10_*) and sets InfoInstance.Npc directly via
the ZenKitCS C# setter, bypassing the Daedalus bug.
The hero's "hey you!" SVM (AI_OutputSvm in ZS_Talk) was blocking the NPC's
animation queue, causing the NPC to stand still until the hero finished
speaking before turning around to face the player.

OutputSvm.Start() now calls StartHeroFireAndForget() for hero SVM lines,
which schedules subtitle auto-hide via INpcSubtitles.ScheduleHide (Invoke)
and immediately marks the action finished so the NPC queue continues.

Regular AI_Output dialog lines (Output.cs) remain fully blocking so dialog
conversations are unaffected.

Also adds WasPlayerInitiated flag to suppress hero reactive SVM lines when
the NPC is the one who initiated the conversation (important dialog).
@BoroBongo BoroBongo marked this pull request as ready for review June 15, 2026 22:39
@BoroBongo BoroBongo requested a review from JaXt0r June 16, 2026 09:57
@BoroBongo BoroBongo merged commit 3a71991 into main Jun 16, 2026
@BoroBongo BoroBongo deleted the fix/dialog-fixes branch June 16, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants