Skip to content

NPC speech as KOD resources instead of dlg text files - #368

Merged
skittles1 merged 1 commit into
OpenMeridian105:developfrom
Arantis:npc-speech
Nov 4, 2026
Merged

skittles1 merged 1 commit into
OpenMeridian105:developfrom
Arantis:npc-speech

Conversation

@Arantis

@Arantis Arantis commented Nov 4, 2026

Copy link
Copy Markdown

What

NPC talk (keyword answers and random quotes) is no longer loaded from the
dlg text files with read npcdlg.txt. It is now normal KOD code:

  • kod/util/npcspeech/: one class per town/group, English text in .kod,
    German text in .lkod (same as all other translated resources)
  • kod/util/library.kod: CreateSpeechLibrary / CreateRandomLibrary add
    the entries of these classes; same triggers, moods and actions as before
  • LIBACT_QUOTE_RSC: quotes with %NAME etc. are sent as resource
    parameters, so they work in both languages
  • the dlg sources and read npcdlg.txt are removed; the event .tab files
    and their converter stay in dlg/

Why

  • the text files only had one language and had to be read by hand after
    every new world
  • translations now work like everywhere else (.kod / .lkod)
  • the talk is part of the normal build and the savegame

Notes

  • Triggers are resources too (EN in .kod, DE in .lkod). Two trigger
    resources are compared only by their English value, so a few German
    triggers were changed where one word is part of another
    (e.g. hi -> hallo, rat -> ratsmitglied).
  • After updating, run recreateall (or a new world) once so the library is
    built from the new classes.

Tested

  • local server, both languages: all triggers of all 71 classes answered,
    random quotes and moods work
  • Windows build (qbscripts/build-105.ps1) and Linux build

- kod/util/npcspeech: one class per town/group, EN in .kod, DE in .lkod,
  same triggers, moods and actions as the old dlg files (3696 lines)
- triggers are resources as well (one per EN/DE pair); German triggers
  changed where one word contains another, because two trigger resources
  are compared only by their English value
- Library adds them in CreateSpeechLibrary / CreateRandomLibrary;
  LIBACT_QUOTE_RSC sends %NAME etc. as resource parameters; spam keys
  after the class's own keys
- dlg txt/tab sources and "read npcdlg.txt" removed (event tabs stay)
@skittles1 skittles1 added this to the 3.0.8 milestone Nov 4, 2026
@skittles1
skittles1 merged commit 1da7586 into OpenMeridian105:develop Nov 4, 2026
2 checks passed
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