OpenTPW

Extensions and mods#

OpenTPW has two kinds of add-ons, both labelled [EXT:mods] in the source (source/OpenTPW/Mods/):

Mods are data, plus sandboxed TPW Script. A mod may ship data files, and scripts (see SCRIPT-MODS.md) in TPW Script, a small deterministic language with its own interpreter inside OpenTPW. OpenTPW never loads native code or assemblies from a mod: .NET has no in-process security boundary, the browser build is trimmed and compiled ahead of time (so there is nothing to load), and third-party code would break the save and determinism guarantees. A script cannot reach files, the network, the clock or any host object: it only sees what a hook passes it, under a step budget, and it can only change the simulation through a typed hook result. Engine features a mod needs that scripts cannot express become official extensions instead.

New to modding? Start with the modding guide: folder layout, a minimal manifest, where to put a mod, and examples.

In code the system is called OpenTPW.Mods / "extensions"; OpenTPW.ModKit is the unrelated asset editor.

Current state#

Official extensions switched on or off apply at the next park start or load, without a restart; community mods, their inputs and a few extensions need the next start (see When a change applies). Nothing is swapped while a park simulates.

Defaults of the official extensions#

ExtensionOn by defaultSelectableChanges the simulationWhat it is
opentpw.onlineyesyesnoOnline play; no network request until the player acts
opentpw.poolsyesyesyes (recorded in a save only while the park has pool cells or a changing room)Swimming pools; not in a Theme Park Inc run
opentpw.pools-guest-artyesyesnoOpenTPW's own 2x kid and head sprites for land guests while pools is on; switch it off for the original guests
opentpw.umbrellasyesyesyes (recorded in a save only while the park has a brolly shop or a guest with an umbrella)Umbrellas: a brolly shop per theme and guests who carry an open umbrella in the rain; not in a Theme Park Inc run; simulation only until its art lands
opentpw.rain-moodnoyesyes (recorded in every save while it is on)Rain mood: guests lose or gain happiness, thirst and hunger in rain, storm and snow, once per qualifying day; an open umbrella softens the loss; not in a Theme Park Inc run
opentpw.winteryesyesyes (recorded in a save only while the park has a winter kiosk, a glühwein stall or a guest with a warm item)Winter: a winter kiosk (hat or earmuffs, then mittens; sells all year, demand by season and snow) and a glühwein stall (a drinks shop with no drunk effects) per theme; not in a Theme Park Inc run; the items are drawn from phase W4
opentpw.winter-weathernoyesyes (recorded in every save while it is on)Wintry Decembers: a December weather roll in the jungle and fantasy parks is snow instead of a thunderstorm; what umbrellas and the rain mood read changes with it; not in a Theme Park Inc run
opentpw.winter-alwaysnoyesyes (recorded in every save while it is on)Always winter: every month rolls December's weather and its rain and thunderstorms are snow (jungle, fantasy; Halloween snows by its own band; space is left alone), and the winter kiosk and the glühwein stall sell at their winter demand all year; implies Wintry Decembers; not in a Theme Park Inc run
opentpw.restored-adviceyesyesnoadvisor lines in the shipped data that the original never plays
opentpw.eveningyesyesyes (recorded in a save only while the park has a torch)Evening and night: a day and night cycle on play time with lamps that light at dusk (presentation only), and a torch per theme in the Features tab
opentpw.winter-snowyesyesnoSettling snow: snow settles on ground, roofs and objects while it snows and melts afterwards, paths turn to slush; presentation only; not in a Theme Park Inc run
opentpw.guest-insightsnoyesnorefusal counters in the park information window
opentpw.cross-edition-objectsnoyesyesengine support for mods that bring Theme Park Inc attractions into Theme Park World
opentpw.smarter-guestsnono, not yetyesguests that decide better; selectable once phase 6 shows an effect
opentpw.cheatsnoyesyes (recorded in a save only once the park has used one of its own cheats)Cheats: the Alt+C cheats window (arrivals by vehicle, the weather, a chosen golden ticket, money and research, a ride's vehicle limit); Theme Park World parks only. The original's own cheat mode (the secret park name and the Alt keys) is not part of it

Mods are off until switched on. Switch an extension off (or a mod on) for one run with --disable-extension <id> and --enable-mod <id>, or permanently on the Extensions and mods screen or in mods.json (below).

Quick start: your first data mod#

The modding guide walks through a first mod: the folder layout, a minimal manifest, where to put the folder on Windows, macOS and Linux, switching it on, a data override and a script.

The Extensions and mods screen#

Options > OpenTPW > Extensions and mods (UI/Original/Options/ModsScreen.cs, [EXT:mods-ui]) is the in-game way to edit mods.json. It uses the original options frame (f_screen) with two f_optpanel columns, OpenTPW extensions and Community mods, each a scrolling list. The selected row of a column is switched on or off with that column's original b_on switch (or by activating the row). Each row shows the name, the version and a status:

StatusMeaning
On / OffSwitched on and accepted, or switched off.
IncompatibleFor another OpenTPW version or the other game edition, or objects in a Theme Park Inc run.
Missing input folderAn inputs folder is not chosen or no longer exists, or the objects.json reads from an input that is not a game Data folder.
ConflictAnother enabled mod provides the same file or object archive, or reserves an overlapping Info.Id range, and neither lists the other in after.
Needs another modA dependency is missing, off, refused or out of range, or is part of a cycle.
Cannot be usedThe folder has no valid manifest, is shadowed by the same id elsewhere, its files cannot be read, or its objects.json or string tables are invalid.

The statuses are not a second rule set: the screen resolves the real ModSet with the pending choices (away from the game's thread) and words the refusal it gets (ModRefusal.Kind). The details pane under the lists shows the selected row's author, version, description, content digest (once the mod is on and accepted), dependencies, folder and the reason it is refused. A mod folder that cannot be read has no switch.

A mod with an original-data input shows an input row below the details: the chosen folder, Change... (the platform folder dialog of the Game files screen, or a typed path where there is none), Enter path..., Remove and, for a mod with several inputs, Next input. A chosen folder is inspected by the same helper process as Game files, and GameEditions.Detect (which uses GameEditions.HasKnownStandardSam for the known retail Theme Park Inc Standard.sam, else the folder structure) must find the edition the input asks for; the result is shown ("Theme Park Inc data found (known retail Standard.sam)", "This folder holds Theme Park World data, not Theme Park Inc", "No game data folder found here"). A folder of the wrong edition is not saved. Saved folders go to inputs in mods.json.

OK writes mods.json (only when a choice changed) and says when the choices apply; Cancel and Escape discard the edits. When only official extensions changed, they apply without a restart ([EXT:extensions-apply-at-load]): from the lobby at once, so the next park you start or load uses them ("The changes apply to the next park you start or load. No restart is needed."), and inside a park when you leave it or load another park ("The changes apply when you leave this park or load another one."). A change to a community mod or its input, and the cases in When a change applies, show the restart notice instead. The screen's own texts are in the eleven interface languages (OpenTpwText, SupplementaryStrings). The name and description of five extensions (smarter guests, guest insights, pool guest art, restored advice, evening and night) are translated too; the other extensions (online, cross-edition objects, pools) and every mod show the name and description from their code or manifest, which are English. In the browser build the community list holds the mods shipped with the page, and an input is the copy of your own game files that the page keeps in the browser: Change... opens the browser's folder dialog (a typed path or Remove would mean nothing there), and the copy is replaced only before a mod reads it (see Mods in the browser).

Manifest#

Each mod folder holds opentpw-mod.json:

{ "schema": 1, "id": "community.tpi-rides", "name": "Theme Park Inc rides", "version": "1.0.0",
  "category": "community", "openTpw": ">=0.8.0", "edition": "theme-park-world",
  "author": "Ann", "description": "Optional, up to 1000 characters.",
  "dependencies": [{ "id": "opentpw.cross-edition-objects", "version": ">=1.0.0" }],
  "after": ["community.other-rides"],
  "inputs": [{ "id": "tpi", "kind": "original-data", "edition": "theme-park-inc" }],
  "scriptApi": ">=1.0.0 <2.0.0",
  "content": { "overrides": "data/", "objects": "objects.json", "strings": "strings/",
               "scripts": { "files": ["scripts/main.tps"], "hooks": { "leaveQueue": "leaveQueue" } } } }
FieldRequiredMeaning
schemayesAlways 1.
idyesopentpw. or community. followed by lowercase letters, digits, ., - and _; at most 64 characters.
nameyesDisplay name, at most 80 characters.
versionyesMAJOR.MINOR.PATCH, optionally -prerelease (sorted before the release).
categoryyesofficial for opentpw. ids, community for community. ids.
openTpwnoThe OpenTPW versions the mod works with (a range, below).
editionnotheme-park-world or theme-park-inc; the mod is refused for the other edition.
author, descriptionnoShown in the mods screen later.
dependenciesnoUp to 32 mods or extensions this mod needs, each with an optional version range (default *).
afternoMods this one is ordered after when both are enabled; also lets its overrides win over theirs.
inputsnoUp to 16 folders the player supplies; kind is original-data (another original game's install).
scriptApiwith scriptsThe script API versions the mod's scripts target (a range, below); required when content.scripts is present and refused otherwise. The mod is refused when this build's API version (ScriptLimits.ScriptApiVersion, currently 1.0.0) is outside it.
contentnoMod-relative paths: overrides (a folder of files that replace game files), objects (object definitions), strings (a folder of string tables), scripts (script files and hooks). See Content.

Parsing is strict, like the online documents (StrictJson): unknown or duplicate fields, comments, trailing commas and numbers as strings are refused; the file may be at most 64 KiB; and every content path must stay inside the mod's folder (no .., no absolute paths, no drive letters or :, no empty or . segments).

Version ranges#

A range is one or more space-separated comparators that must all hold: >=, >, <=, < and = followed by a version (a bare version means =), or * alone for any version. For example >=0.8.0 <1.0.0.

Release builds check openTpw against their version (ModStartup.OpenTpwVersion, the assembly's informational version, for example 0.8.13): a mod whose range does not contain it is refused as incompatible. Use a range that includes the releases you tested, such as >=0.8.0; a range that starts above the current release refuses the mod on every build released so far. A development build without a version (the SDK default 1.0.0) does not check openTpw ranges.

Discovery#

Desktop builds look for mod folders in this order; the first folder of an id wins and later ones are reported as shadowed:

  1. --mod-dir <folder> (repeatable): one mod folder each, any folder name;

  2. OPENTPW_MOD_DIRS: mod folders separated by the platform's path separator (: or ;);

  3. <config>/mods/<id>/, where <config> is the configuration folder (OPENTPW_CONFIG_DIR, see SETUP.md);

  4. <program>/content/mods/<id>/: data-only content shipped with OpenTPW (the only place opentpw. ids may come from). The repository's content/mods/ folder is copied to the build output and to every release like the rest of content/ (OpenTPW.csproj), and embedded in the browser build (OpenTPW.Web.csproj). A mod there is listed in the screen like any other and is off by default.

In the last two places the folder must be named after the mod's id. A folder named on the command line or in OPENTPW_MOD_DIRS whose path cannot be used is reported as a refused entry.

Mod folders are treated as untrusted. Only regular files are read: a manifest, mods.json or mod file that is a symbolic link, reparse point, FIFO, device or socket refuses the mod (or, for mods.json, falls back to the defaults with a warning) without being read, and documents are read through a stream that stops one byte past their limit. The mod folder itself may be a link. More than 20000 files or 2 GiB, or two names that differ only by case or Unicode normalization (such as Foo.txt and foo.txt), refuse the mod. Content paths may not use names Windows cannot hold: a component ending in . or a space, or a device name such as CON, NUL, COM1 or LPT1 (with or without an extension).

The browser build discovers the program folder only: the mods shipped with the page are embedded and written below it at start (content/mods/<id>/, like the other content). It has no folders for community mods; those would come later as zips imported into the page's private file storage.

Settings: mods.json#

The choices live in <config>/mods.json (in the browser /config/mods.json, which the page mirrors into the browser's IndexedDB and puts back before the game starts):

{
  "enabled": { "opentpw.online": false, "community.tpi-rides": true },
  "order": ["community.tpi-rides"],
  "inputs": { "community.tpi-rides": { "tpi": "/games/Theme Park Inc" } }
}

A missing file means the defaults. A file that cannot be read, is larger than 256 KiB or is not valid strict JSON adds a startup warning and the defaults are used; invalid entries in an otherwise valid file are dropped one by one, each with a warning. Smoke tests (--smoke-test, and the co-op join smoke --coop-join-smoke) ignore mods.json and <config>/mods, like the compatibility and graphics settings.

--disable-extension <id> (repeatable) switches an extension or mod off for one run without changing mods.json; an id that names no extension or installed mod is an error. --enable-mod <id> (repeatable) switches an extension or mod on, and --mod-input <mod id>:<input id>=<folder> (repeatable) chooses an input folder, for one run each (also in smoke tests, which otherwise ignore mods.json); a malformed --mod-input or an unknown id is an error.

Content#

ModContentRoots.Activate installs the enabled mods' content once at startup, after the set is resolved. With no files-based mod enabled nothing is installed and every lookup is the game's own (the pinned determinism digests do not change). Mods are consulted in load order, later over earlier; since two mods that supply the same thing are refused unless one is ordered after the other, the winner is always the one that said so.

overrides#

Loose files below the overrides folder replace the game file at the same data-relative path, whatever the case: data/levels/jungle/sharetex/leaf.wct replaces /levels/jungle/sharetex/leaf.wct, and data/levels/jungle/rides/totem/totem.sam replaces that member of the archive totem.wad. Textures, sounds, UI art and any other file read through the game's file system work the same way. A file the game lacks is added. Reads, sizes and FileExists see the replacement; directory listings stay the game's, so an override cannot add an object archive (use objects). The game's folder is never written.

strings#

strings/<Language>/<NAME>.str (for example strings/German/UITEXT.str) replaces that language's string table completely; it is also an override of /Language/<Language>/<NAME>.str. Any other file below strings refuses the mod. Tables must have the same layout as the original's. Two mods supplying the same table of a language conflict like two overrides do.

objects#

objects.json (at most 256 KiB, StrictJson style: unknown or duplicate fields, comments and trailing commas are refused) adds object archives to the theme catalogs:

{ "schema": 1, "idRange": { "first": 20000, "last": 20099 },
  "objects": [
    { "archive": "objects/zoom", "theme": "jungle", "category": "rides", "infoId": 20001,
      "names": { "English": "Zoom", "German": "Sause" } },
    { "archive": "levels/jungle/rides/bumper", "input": "tpi", "theme": "jungle", "category": "rides", "infoId": 20002,
      "names": { "English": "Bumper Cars" } } ] }

New objects made from scratch (models, textures, scripts) are authored with the content kit (CONTENT-KIT.md).

Mod objects come after the game's and the official bonus objects in each category, in mod order. Each content root has its own file system (with WAD and SDT handlers); the catalog cache key includes the mod set's digest, so a different set never reuses a catalog.

In a park's asset manifest the members of a mod's archives, its own and those read from an input, are keyed mod:<id>:/<path> (ContentRoot.Mod(id)); game data stays data: and official bonus archives bonus:. The path is relative to the archive's file system, so an input archive keeps its game path (/levels/jungle/rides/bumper/...) and cannot collide with the mod's own, because one theme and category never lists two archives of one name.

scripts#

content.scripts has files (1 to 8 mod-relative script files, same path rules as the other content, no duplicates) and hooks (1 or more entries from a known hook name to the function that implements it). Only the hook names of script API v1 are accepted (scoreAttraction, joinQueue, leaveQueue, wanderGoal); the game runs them through the guest decision seam (SCRIPT-MODS.md). At resolve time every script file is compiled and checked against the script limits, and each hook must name a function that exactly one file defines, with the hook's parameter count. A compile error or a failed check refuses the mod with the file, line and message. The files, the caps (8 files, 256 KiB of source in all, 64 KiB each), safe mode and the rule that the executed bytes are the hashed bytes are in SCRIPT-MODS.md. A mod with scripts changes the simulation (next sections), and the mods screen says "Contains scripts" for it. The shipped example is opentpw.example.patient-guests (off by default; not in the web build).

A second shipped example is a data mod with a light, opentpw.example.lamp-lights (off by default; not in the web build): a lamp post object whose model carries a light dummy and whose RSE script pulses, flickers and colour-cycles the light with the ENABLELIGHT, DISABLELIGHT, SETLIGHT and COLOURLIGHT opcodes. To add lights to your own object, give its model light dummies (the content kit writes them from glTF point lights or ModelBuilder.AddLight), tune them with the Lights[n].* keys of the object's .sam and drive them from the object's script; the lights are presentation only and are not part of a save's simulation state (LIGHTS.md, CONTENT-KIT.md).

Resolution#

At startup, right after the compatibility settings, OpenTPW resolves the run's set once (ModStartup, ModSet.Resolve):

  1. Official extensions are on or off as chosen. Enabled mods are checked: the openTpw range, the edition and that every input has an existing folder, and the scriptApi range contains this build's script API version. In safe mode (SCRIPT-MODS.md) a mod with scripts is refused here without reading its files.

  2. Every dependency must be installed, enabled and within its range; a refused mod refuses the mods that need it.

  3. Two enabled mods that supply the same file (in overrides or strings, compared without case), the same object archive name in a theme and category, or overlapping Info.Id ranges are both refused; for files, unless one lists the other in after. There is no silent "last one wins".

  4. Dependency and after cycles refuse the mods involved.

  5. The rest is ordered: dependencies (and after) first, then official before community, then the player's order, then the ordinal id.

Refused mods and the reasons go to the startup log. Each enabled mod gets a content digest (ContentSha256): the SHA-256 of one UTF-8 path NUL sha256 LF line per file of the mod's folder, the manifest included, with '/' paths in Unicode normalization form C sorted by ordinal (UTF-16 code unit) order, and lowercase hex file hashes. A copy of a mod on macOS, Windows or Linux therefore gets the same digest (ModTests.TheGoldenDigestIsTheSameOnEveryPlatform pins one). Operating-system clutter is not part of a mod and is skipped everywhere: .DS_Store, AppleDouble ._* files, Thumbs.db and desktop.ini. Park saves record the digest of mods that change the simulation (below).

With no mods and the default extensions nothing changes: the pinned determinism hashes are the same with opentpw.online on or off (DeterminismTests.TogglingOnlyTheOnlineExtensionKeepsThePinnedDigests).

Mods in park saves#

A mod changes the simulation when it adds objects (content.objects), has scripts with a hook that is not UI-only (all v1 hooks change the simulation, so every mod with scripts does), or overrides a file that is not plainly presentation media (.fsh, .tga, .png, .jpg, .bmp, .wav, .mp3, .ogg, .flac, .str, .bf4, .ttf, .otf; any other type counts as simulation); an extension does when it declares AffectsSimulation. A park save records exactly these (Mods: id, version, content digest) and nothing else, so a park saved without them has no Mods field and keeps its bytes. Loading it needs the same mods, versions and content, in the same order; presentation-only mods and the online extension may differ. A save that needs a mod you do not have refuses with needs <id> <version>; the load list and the Continue entries keep it and add "(requires mod )". Exporting or publishing a park as a .tpwpark package is refused while a community mod is active, because packages record no community mods yet; OpenTPW's own extensions do not refuse it (below, "Parks that use extensions"). Some extensions are recorded only while the park uses them (ParkResumeMods.UsedOnlyExtensionIds): opentpw.pools (pool cells or a changing room), opentpw.umbrellas, opentpw.winter, opentpw.cheats and opentpw.evening (a torch), so a park that uses none of them saves, loads and exports identically with them on or off (POOLS.md, EVENING.md). The asset manifest keys archives of a mod mod:<id>:/… (data: and bonus: for the game data and the bonus content). Details: DETERMINISM.md "Mods".

When a change applies#

[EXT:extensions-apply-at-load] (user-approved 2026-10-19, "Ook ontbrekende extensie aanzetten"). The run's extensions and mods are resolved at startup. An official extension switched on or off afterwards (on the Extensions and mods screen, or by the load dialog below) becomes active without a restart, at a moment when no park simulates: at once in the lobby, else when the running park is left or another park is loaded or started (a Restart Park reloads the same park and keeps its set; a park started from inside a park while a choice waits is built in one go, so the running park never simulates with the new set). ModStartup.ApplyExtensions makes the switched set active: the feature gates read it at once, the official extensions' objects (pools, umbrellas, winter, the evening torches) are listed in the theme catalogs again (ModContentRoots.Activate; the catalog cache is keyed by those roots), and everything else that depends on an extension reads the set when a park is built: the guest simulation's rules and decision policy, the weather, the pools tool, slides and HUD rows, the guest sprites (PoolGuestSprites, the umbrella and warm-item renderers), the evening lamps and the snow. In the browser the page fetches the pools sprite sets when the extension comes on after the start. The set's order is the one a new start with the same choices resolves (ModSet.WithExtensions), so a park saved after a switch loads after the next start.

These still apply at the next start (in the browser, after a page reload), and the screen says so:

A change that combines an extension with any of these applies wholly at the next start.

Loading a park with other extensions#

[EXT:save-extension-switch] (user-approved 2026-10-19, "Ook ontbrekende extensie aanzetten"). Solo play is not blocked by rule options: when an own park save (the Load Park list, Continue, the automatic checkpoint or autosave) differs from the active official extensions in a way a player may switch, the load asks first instead of refusing. The question is the original confirm dialog with one line per kind of switch, in the eleven interface languages:

The X goes back without loading. One line says the park continues with the extensions that are on now: a switched park is a new run from the switch point, not a replay of the saved one (DETERMINISM.md).

Everything else stays strict, with the reasons above: a community mod that is missing or has another version or content, a script mod in safe mode, an extension switched off for the run with --disable-extension, a content extension in another version, the cross-edition objects extension (it changes which objects a park's catalog holds; it only matters with a community mod, which is strict anyway), the order of the mods, and any load that mixes one of those with a switch. A Theme Park Inc run never asks (it records none of these extensions and loads no own park saves). Replays and checks never switch: only the player's confirmation in the dialog does, so --park-resume-smoke, the tests, the online server and co-op, which compare the mod set, and the original-format export are unchanged.

Parks that use extensions#

[EXT:mods] A .tpwpark package, and so a published park, may use OpenTPW's official extensions. Official means built in and shipped with every build (OfficialExtensions.All, ids opentpw.*); anything else is a community mod. ParkSharing.ModsOf splits the simulation-changing mods the park would record (the same list a save records: a used-only extension only while the park uses it) into the two.

Smarter guests and guest insights (opentpw.smarter-guests, opentpw.guest-insights)#

Two official extensions for the park visitors (SMARTER-GUESTS.md has the plan, the architecture and the measurement): guest insights at version 1.0.0 and smarter guests at version 1.6.0. Both can be switched on on the Extensions and mods screen, in mods.json or with --enable-mod, and both are off by default. Guest insights has its first feature (phase 1). Smarter guests was released as opt-in in 1.6.0, once its rule set (phases 2 to 6b) had a measurable effect (less crowding, less litter) and its CPU cost per guest-turn met the gate of at most 1.10 times the original guests' (SMARTER-GUESTS.md, "Cost and release").

Their names and descriptions exist in the nine interface languages for the screen. Switching either on or off changes none of the pinned digests of the off path (DeterminismTests); with smarter guests on, DeterminismTests.SmarterGuestsFixedRunHash pins the world hash, which then includes the extension's state.

Restored advice (opentpw.restored-advice)#

An official extension that gives the advisor the lines the original game recorded but never says: tp.exe v2.0 scores 21 of its scanned messages with a constant-zero stub and nothing posts 82 more. The extension restores 42 of those 103 messages, by trigger: security cover gaps, long queues, blocked ride exits, riders stuck in a broken or condemned ride, low balances, land running out, buses, seaplanes and Ferries arriving, award news for the global golden tickets, upgrades without a mechanic, a few tutorial hints and the lines of the online screens. The messages, triggers, scores and the messages skipped on purpose are in reverse/ADVISOR-SCAN.md "Restored advice" (thirteen lines of the first 55, the golden ticket wins, the first challenge offer, the double-or-nothing lines 319 and 320 and the track ride hint 204, stood down because the original's own ticket advice 215-227, first-offer line 344, challenge lines 270 and 272 and kart and water line tool help 204 are now ported); the mechanism (one scan hook, one poll, a driver for events) is in LIPS.md "Restored advice".

The online extension (opentpw.online)#

Online is an official extension, on by default (it makes no network request until the player acts). When it is switched off ("opentpw.online": false in mods.json, or --disable-extension opentpw.online):

To check the switched-off extension in the real game, run the front-end smoke test with it off (the repository has no script or CI job that runs native smokes):

bash scripts/run.sh --game-path '/path/to/Theme Park World' --front-end --smoke-test --disable-extension opentpw.online

It skips the online steps and checks that the globe button and the pause menu's Go Online line are absent and that Publish Park is a disabled line.

The browser page has no control for the extension yet; a /config/mods.json saved in the page's storage is honoured at the next start. The page's own scripts make no request to an online server at startup (only the game's online client does, after the player acts), so there is no page-level fetch to check when the extension is off.

Cross-edition objects (opentpw.cross-edition-objects)#

An official extension, off by default, that lets a data mod bring attractions of another original game (Theme Park Inc) into Theme Park World. Nothing of Theme Park Inc ships with OpenTPW: the player supplies the install as a mod input ("inputs": [{ "id": "tpi", "kind": "original-data", "edition": "theme-park-inc" }]), and a mod that needs the extension lists it under dependencies (a mod refuses to run while the extension is off). Because objects it brings change the park, the extension is marked as changing the simulation (AffectsSimulation): while it is on, park saves record it (id, version, no files) and a park saved with it loads only with it on, and one saved without it only with it off (Mods in park saves). It is [EXT:cross-edition-objects].

What the extension provides in the engine:

Missing economy keys: with the Theme Park World category defaults (Rides.sam, Shops.sam, ...) under a Theme Park Inc object file, as for official bonus archives, every key that all Theme Park World objects of that category carry is present in each of the 183 Theme Park Inc archives that map onto the four Theme Park World themes, so no per-key default is needed for Theme Park World's economy. Theme Park Inc's Upgrades[n].RunningCost has no Theme Park World counterpart and is ignored; its Research.Group values reach 6, and the research table already treats groups past ResearchTech as threshold 0, as the original's zero-filled block does.

Loading the archives themselves is the content roots' job (objects.json with an input). When the extension is on, the engine registers each input that the manifest declares as theme-park-inc and that GameEditions.Detect recognises as Theme Park Inc data (ModContentRoots) as a sound root, as a root of shared textures and as a source of economy data, as the next section describes; an input folder that is not Theme Park Inc data gets a warning and no sound root, and with the extension off no input is registered, so every object keeps the running game's banks.

The shipped Theme Park Inc rides mod#

OpenTPW ships the rides mod of the next section as ready-made content: content/mods/opentpw.tpi-rides/ holds the manifest and the objects.json, two text files of about 30 KB with no Theme Park Inc bytes. It is a data mod with an opentpw. id (reserved for content shipped with OpenTPW, found in the program folder only), depends on the cross-edition objects extension and asks for one original-data input, tpi, with "edition": "theme-park-inc". Nothing is on by default: not the extension, not the mod.

Making a Theme Park Inc rides mod#

The mod above is made this way; a mod of your own works the same, with a community. id.

A mod that brings Theme Park Inc attractions into Theme Park World is two small text files. It copies nothing: the player's own Theme Park Inc install is the mod's input and the archives are read where they are.

  1. Make a folder named after the mod's id, for example community.tpi-rides, in <config>/mods/ (or anywhere, with --mod-dir).

  2. Write opentpw-mod.json in it. The mod needs the cross-edition objects extension, one original-data input for the install and an objects.json:

    { "schema": 1, "id": "community.tpi-rides", "name": "Theme Park Inc rides", "version": "1.0.0", "category": "community",
      "edition": "theme-park-world",
      "dependencies": [ { "id": "opentpw.cross-edition-objects", "version": ">=1.0.0" } ],
      "inputs": [ { "id": "tpi", "kind": "original-data", "edition": "theme-park-inc" } ],
      "content": { "objects": "objects.json" } }
  3. Write objects.json next to it. Each entry names one archive of the install (the path below its Data folder, without .wad), the Theme Park World theme and category it joins, an infoId from the range the mod reserves, and its names:

    { "schema": 1, "idRange": { "first": 40000, "last": 40099 }, "objects": [
      { "archive": "levels/arabian/rides/tbounce", "input": "tpi", "theme": "jungle", "category": "rides", "infoId": 40001,
        "names": { "English": "Turban Bounce", "German": "Turban-Huepfer" } },
      { "archive": "levels/science/rides/robot", "input": "tpi", "theme": "space", "category": "rides", "infoId": 40002,
        "names": { "English": "Giant Robot Swing" } },
      { "archive": "levels/science/Facilities/litbin", "input": "tpi", "theme": "space", "category": "features", "infoId": 40003,
        "names": { "English": "Science Litter Bin" } },
      { "archive": "levels/arabian/shops/drinks", "input": "tpi", "theme": "jungle", "category": "shops", "infoId": 40004,
        "names": { "English": "Desert Drinks" } } ] }
    • Which archives. Theme Park Inc keeps its objects below Data/levels/<world>/ in rides, shops, sideshow, features, upgrades and Facilities (litter bins, toilets, staff rooms); archive may name any of them, and category says where the object is listed in Theme Park World (the litter bin above is a feature). Its worlds are arabian, science and water; the example puts them into the jungle, space and fantasy parks.

    • Which ids. Pick a range of at most 4096 ids in 5000 to 65535 (see Cross-edition objects) and keep each object's id when you update the mod: saves and layouts join on it.

    • What an archive brings. The .sam with the model, its textures, its animations and its RSE script, and the object's own price, research cost and group. Theme Park World's category defaults (Rides.sam, ...) fill in what the archive does not say, as for the official bonus objects. The name in names replaces the archive's .sam name in the build lists, the HUD and the economy.

    • What does not load. An archive whose name the park already lists (the game's own gates, bus, end, tvsim, ...; the original keeps the first), an archive with no .sam that declares an Info.Id (ptract) and a broken archive are skipped with a warning in the log. The example mod's scale is fine: all 217 archives of the install's three worlds can be listed (the test EveryArchiveOfTheInstallLoads... does), 182 of them load, and the 35 others are the skipped names above.

  4. Turn it on. In the Extensions and mods screen switch on Cross-edition objects and the mod, then choose the install as the tpi input (the screen checks that the folder holds Theme Park Inc data); or edit mods.json:

    { "enabled": { "opentpw.cross-edition-objects": true, "community.tpi-rides": true },
      "inputs": { "community.tpi-rides": { "tpi": "/games/Theme Park Inc" } } }

    or for one run: --enable-mod opentpw.cross-edition-objects --enable-mod community.tpi-rides --mod-input 'community.tpi-rides:tpi=/games/Theme Park Inc' (--mod-input <mod id>:<input id>=<folder>; both options are repeatable and change nothing on disk). Start a Theme Park World park: the mod's objects are in the buy lists of their theme, after the game's own.

What the engine does with such an object (all [EXT:cross-edition-objects] unless it says otherwise):

What is not verified: Theme Park Inc's track rides (coasters, water and kart tracks) and tours in a Theme Park World park, the sound-driven synchronisation of TPI scripts with its engine events, and the TPI scripts' variables above.

Checking a TPI rides mod#

Source: docs/MODS.md in the project repository.