FORGOTTEN TOWNS

FORGOTTEN TOWNS / MODDING DOCUMENTATION

Modding wiki ↗

Java API reference (Javadoc)

MOD API 15

Browse the wiki

Current Mod API documentation.

MODDING DOCUMENTATION

Author a complete scenario

JSON packs can add campaign entries, full quests, common bootstraps and ambient routes through the native authored-content pipeline. Opening/closing scenes, objectives, dialogue, typed cinematic operations and their progress use ordinary game saves. This requires no engine-class imports or numbered-campaign Java handler. The JSON-only Trailwatch example is a complete standalone mission with all thirteen translations.

Registry Native source / collection Added definition
campaignStages campaign_stages.json / stages Map entry, world seed/biome/size, scenes, progression, bootstrap, failures and transition
quests quests.json / quests Title, auto-start conditions, attributes, outcome tags and ordered stages
campaignBootstraps campaign_bootstraps.json / definitions Ordered common setup operations
ambientScenes campaign_ambient_scenes.json / scenes Saved actor routes, delays, points and paired conversation

Use ordinary manifest patches pointing at operation arrays. These registries accept add with a complete values object. They do not accept copyFrom, replacement or deletion of existing definitions. questStages still supports dependency-checked localized lesson/objective patches, including lessons added by another pack. Scenario catalogs are not the fourteen Java RegistryAccess definition catalogs.

{
  "registry": "quests", "op": "add", "id": "c100_my_mod_intro",
  "values": {
    "titleKey": "mods.my_mod.title", "autoStart": [],
    "stages": [{
      "id": "c100_my_mod_opening", "titleKey": "mods.my_mod.title",
      "bodyKey": "mods.my_mod.opening", "objectives": []
    }]
  }
}

Keep cN_<mod_id>_<local_id> identities for each campaign, quest, scene, objective, weather event, failure rule and bootstrap/cinematic operation. N matches levelNumber. Visible campaign levels must be unique across the enabled profile; coordinate level numbers with dependencies. IDs are save identities: never rename published content without a migration. Canonical filenames should match their owned definition IDs. Manifest order preserves authored order, including prerequisite stages.

Campaign entries must explicitly supply preScene, afterScene, progression, requiredCampaignActorIds, minimumCivilianSurvivors, inheritsCampaignRoster and inheritsCampaignKnowledge; they cannot accidentally inherit an unrelated pack's progression or cast. Use {"unrestricted":true} for unrestricted progression. A standalone mission normally uses empty prerequisites and false inheritance flags. Scenes must exist, belong to the level namespace, and occur before/after the objectives; the closing scene belongs to completionQuestId.

The standard native campaign fields are available except Steam achievements, development previews and private numbered-campaign runtime/sequence registrations. The shared scheduled_weather runtime is available with authored weather events. Cinematics use the common typed quest operations instead of private sequence handlers. world chooses an existing generator via biome, seed and size profile; new generator algorithms are not exposed.

Bootstrap operations include terrain clearing/leveling, existing blueprints, resources, physical storage, zones, deposits, vegetation, citizens/creatures, settlement founding, quest starts and ambient scenes. Quests use existing typed objectives and the explicit onEnter, onPromptShown, whileActive, onContinue, onExit phases. For example, camera.focus, camera.pan, wait.duration, actor.face, actor.move, actor.route and camera.restore execute through the shared presentation director with stable IDs and resume policies. The SDK also includes docs/data-driven-gameplay-contract.md for exact native operation semantics. That document retains its repository-oriented maintenance links; the runnable example needs only its own pack files.

All authored display text belongs in mods.<mod_id>.* catalogs. Existing shared translation keys can be referenced, but missing keys in any supported language fail composition. References to another pack's content or translations require a dependency. Native validators check objective/action types, phases, references, scene order, required actors, failure rules and ambient-route consistency before the profile is applied. Validation does not prove reachability of every authored coordinate: run the scenario, including save/load during its scenes, before sharing it.

Use requiresNewWorld: true when adding scenario-specific world setup. Enabling the pack exposes its map entry after restart; disabling it removes the entry. Saves requiring absent definitions are rejected through the ordinary mod/profile and content checks. Install/update/publish behavior is the same as other JSON packs. Generic content-ID migration tooling remains a separate feature.