Skip to content

Serialize mob programs in one ROM 2.4-shaped list per mob - #21

Merged
ctoth merged 4 commits into
masterfrom
feat/normalized-mob-programs
Oct 6, 2026
Merged

ctoth merged 4 commits into
masterfrom
feat/normalized-mob-programs

Conversation

@ctoth

@ctoth ctoth commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Every mob in the JSON output gains mob_programs: a list of {trigger, phrase, lines, source, vnum, group} in ROM 2.4 trigger words and syntax, whatever the dialect.

  • ROM 2.4 files: the join of each mob's M trigger records with the #MOBPROGS bodies.
  • Inline MOBprograms (SMAUG, SWR/FUSS, ACK): trigger names, mp* commands, if check(arg) conditions and SMAUG echo colour tokens are translated. A line with no confident ROM form is left as written and reported as untranslated_mobprog_line.
  • A trigger whose program body is not in the file is reported as missing_mobprog and gets empty lines.
  • A word-list phrase (any-word match) becomes one entry per word, sharing a group.

The existing mprogs, programs and top-level mobprogs keys and the native writer are unchanged. The list is computed in as_dict; nothing new is stored on the model.

Checked against area files from the Mongoose corpus: mthydra 31 entries, no diagnostics; peeks 69 missing_mobprog (the file has no #MOBPROGS section); asgard 111 entries / 16 untranslated lines; cursenec 156 / 30; xchan1 266 / 52.

Not verified against source: the SMAUG colour token table (_red is taken as dark red) and ROM's cmd_eval argument forms.

ctoth added 4 commits October 5, 2026 19:14
Each mob in the JSON output gets mob_programs: ROM trigger records joined
with their #MOBPROGS bodies, and inline SMAUG/ACK/FUSS programs translated
to ROM 2.4 triggers and mob commands. A missing body, an unknown trigger and
a line or phrase with no confident ROM form are reported as diagnostics.
A SMAUG colour token on an echo becomes the ROM brace code, closed with {x.
An ACT or SPEECH word list becomes one entry per word; every entry carries
group, the index of its source program on the mob.
load_sections reads the sections, then appends the mob program diagnostics to
reader.diagnostics, the one list as_dict serializes. The per-dialect section
loops are now read_sections.
@ctoth
ctoth merged commit 3ff3737 into master Oct 6, 2026
4 checks passed
@ctoth
ctoth deleted the feat/normalized-mob-programs branch October 6, 2026 01:48
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.

1 participant