feat(editor): add WGOT JSON round-trip authoring workflow

Closes the WGOT open-format loop with --export-wgot-json /
--import-wgot-json, mirroring the JSON pairs added for
every other novel binary format. All 10 binary formats
added since WOL now have full JSON round-trip authoring.

Each game object round-trips all 13 scalar fields plus
dual int + name forms for typeId (16 enum values) and the
flags bitset.

The flag bitset emits string-array form so a hand-author
can write ["despawn"] instead of having to remember that
Despawn = 0x08. typeName makes "door/chest/herb-node/..."
obvious without needing to know typeId=11 means HerbNode.

Verified byte-identical round-trip on the dungeon preset
(5 objects: door + button + 2 chests + trap with full
WLOT cross-references and lockId fields preserved).

Adds 2 flags (516 documented total now).
This commit is contained in:
Kelsi 2026-05-09 15:39:50 -07:00
parent 4868f780cc
commit 062258de8a
3 changed files with 170 additions and 0 deletions

View file

@ -933,6 +933,10 @@ void printUsage(const char* argv0) {
std::printf(" Print WGOT entries (objectId / type / lock / loot / required skill / name)\n");
std::printf(" --validate-wgot <wgot-base> [--json]\n");
std::printf(" Static checks: objectId>0+unique, size>0, time min<=max, gathering needs skill, chest warns on no loot\n");
std::printf(" --export-wgot-json <wgot-base> [out.json]\n");
std::printf(" Export binary .wgot to a human-editable JSON sidecar (defaults to <base>.wgot.json)\n");
std::printf(" --import-wgot-json <json-path> [out-base]\n");
std::printf(" Import a .wgot.json sidecar back into binary .wgot (accepts type/flag int OR name forms)\n");
std::printf(" --gen-factions <wfac-base> [name]\n");
std::printf(" Emit .wfac starter: 3 factions (Friendly id=35 / Hostile id=14 / Player id=1) matching WCRT defaults\n");
std::printf(" --gen-factions-alliance <wfac-base> [name]\n");