Phase 8: the quest book, generated from docs/quests.yaml

- tools/quests.py writes pack/config/ftbquests/quests/ in FTB Quests 2101's
  format (data.snbt, chapters/*.snbt, texts in lang/en_us.snbt) with ids
  derived from the YAML names, so progress survives regeneration. Flexible
  progression, no lock icons, no rewards (Adrian, 2026-11-03). tools/build.py
  runs it.
- docs/quests.yaml: 18 chapters, 74 quests. Getting Started; one chapter per
  zone and the End from a zone template (reach it, catch three of its
  Pokemon, mine its ores, beat its guardian) plus chapter extras (Mire
  Waders, Eyes of Ender, Eternatus); Pokemon Machines; Base and Jobs.
- Node positions: --pull reads them from an FTB Quests folder into the
  layout block (only moved nodes); tools/prism_instance.py pulls from the
  instance before each sync and rebuilds if something moved.
- The pack's own events as hidden advancements (cobblesurvival:events/...),
  granted by QuestEvents: zone reached, guardian beaten, machine filled, End
  boss beaten.
- Self-tests quest_book_loads and quest_events_mark_zones; the guardian and
  furnace tests check their events. Self-tests and island check pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
claudeandClaude Opus 5.5 committed 2026-11-03 10:57:35 +01:00
1 parent 9fb5e9895e
commit c5d1cf93f4
70 files changed
+3665 -7

No files matched your search

+13
View File
@@ -5,6 +5,8 @@ Writes instance.cfg and mmc-pack.json (Minecraft + NeoForge from pack.toml),
then syncs the client-side files with packwiz-installer. Run tools/build.py
first. Run it again after changing the pack; options and saves in the
instance are left alone. Close the instance in Prism before syncing.
Quest nodes moved in the instance's quest editor are first copied into
docs/quests.yaml (tools/quests.py --pull), and the pack rebuilt with them.
When build/world-template exists (tools/make_world.py), it is copied into the
instance as the save "Cobblemon Survival Island" unless that save already
@@ -16,6 +18,7 @@ Usage: tools/prism_instance.py [--name NAME] [--prism-dir DIR] [--memory MB] [--
import argparse
import json
import shutil
import subprocess
import sys
import tomllib
from pathlib import Path
@@ -78,6 +81,16 @@ def main():
instance = prism / "instances" / args.name
game = instance / "minecraft"
game.mkdir(parents=True, exist_ok=True)
# Node positions moved in the in-game quest editor go back into docs/quests.yaml first (Adrian, 2026-11-03),
# so the sync doesn't overwrite them; the pack is rebuilt with them.
quests = game / "config/ftbquests/quests"
if (quests / "chapters").is_dir():
source = ROOT / "docs/quests.yaml"
before = source.read_text()
subprocess.run([sys.executable, str(ROOT / "tools/quests.py"), "--pull", str(quests)], check=True)
if source.read_text() != before:
print("rebuilding with the moved quest nodes (commit docs/quests.yaml)")
subprocess.run([sys.executable, str(ROOT / "tools/build.py"), "--skip-mod"], check=True)
pack = tomllib.loads((stage / "pack.toml").read_text())
write_cfg(instance / "instance.cfg", args.name, args.memory)
write_components(instance / "mmc-pack.json", pack["versions"])