Piscopancer's Healing Campfires is an addon for a game S.T.A.L.K.E.R. Anomaly 1.5.2. Standing near lit campfires warms body and treats wounds, causing character's health to restore. The fashion in which health is restored can be configured via MCM.
This addon is a demonstration of the anomaly-packer package. Earlier it carried a hand-written copy of the transpilation and text-generation logic; now that logic lives in the package, and the addon only contains its own content. Building is a single call to pack() in pack.ts, which transpiles the scripts, generates the text files, and refreshes the addon inside Mod Organizer 2.
pnpm install,pnpm run build,- Archive the
buildfolder and treat it as an addon.
The gamedata directory mirrors the game's own structure and is the source pack() reads.
gamedata/scripts/*.tsare transpiled to flat global.scriptfiles. Each registered script is listed inpack.ts. These files are transpiled as modules but cannot meaningfullyimport/exportbetween each other — the engine loads every.scriptas a global table, so cross-script data is reached through a global (seepcprs_healing_campfires_mcm.defaultConfigused from the main script).gamedata/configs/text/{eng,rus}/*.tseach default-export a function that returns the XML for one text file, built with the package'stranslations()helper. The shared, strongly-typed translation data lives in texts.ts, whereengis the source of truth andrusis forced to mirror its keys.
Game globals (db, bind_campfire, ui_mcm, RegisterScriptCallback, …) come from the package and are wired into the scripts through triple-slash references in gamedata/scripts/env.d.ts:
/// <reference types="anomaly-packer/types/game/db" />The same file augments the package's empty McmConfig interface with this addon's config keys and declares the sibling-script global pcprs_healing_campfires_mcm.
