drmod is a CLI for Carmageddon / Dethrace mod work.
It extracts and packs 8-bit FLI/FLC animations. It also decodes and encodes
encrypted game .TXT files.
- Odin compiler (
odinonPATH) ffmpegonPATHfor FLI/FLC extract- Aseprite CLI (
asepriteonPATH) forpackandrepackonly
make buildThe binary is written to dist/drmod.
make cleanmake clean removes dist/ and a stray drmod binary in the project root.
Run the binary without install:
./dist/drmod --helpPaths are stored in ~/.local/share/dethrace/mod/settings.ini.
If XDG_DATA_HOME is set, the file is
$XDG_DATA_HOME/dethrace/mod/settings.ini.
Set the paths once:
drmod settings set game /path/to/CARMA
drmod settings set work /path/to/dethrace-mod
drmod settings show
drmod settings get game
drmod settings get anim
drmod settings get fli_worksettings get game prints the path only and exits with code 0.
settings get anim prints <game>/ANIM.
settings get fli_work prints the FLI work folder under work.
Override paths for one process with environment variables:
DRMOD_GAME_DIRDRMOD_WORK_DIR
With settings set, short paths work:
drmod extract
drmod repack
drmod decode GENERAL.TXT
drmod encode GENERAL.plain.txt
drmod pack fli_work/STRTSTIL ANIM/STRTSTIL.FLIDefault map:
extractreads<game>/ANIMand writes<work>/fli_workrepackreads<work>/fli_workand writes<game>/ANIMdecode GENERAL.TXTwrites<work>/GENERAL.plain.txtencode GENERAL.plain.txtwrites<game>/GENERAL.TXT
Explicit paths override the defaults.
Read or write one value in an encrypted .TXT file without a full decode edit
encode cycle:
drmod config get GENERAL.TXT line.1
drmod config get PARTSHOP.TXT line.42
drmod config get PARTSHOP.TXT line.42.field.1
drmod config set RACES.TXT line.5.field.0 newvalue
drmod config keys DATA/GENERAL.TXTThe tool searches under the configured game path: install root, DATA/, and
DATA/*/.
drmod --helpExtract every animation in the game ANIM folder:
drmod extract /path/to/game/ANIM ./fli_workExtract one file:
drmod extract /path/to/game/ANIM ./fli_work --file STRTSTIL.FLIEach animation becomes a subfolder with frame_0000.png, frame_0001.png, and
so on, plus a manifest.json.
Extract overwrites existing frame_*.png files in the target folder.
drmod pack ./fli_work/STRTSTIL /path/to/game/ANIM/STRTSTIL.FLIdrmod repack ./fli_work /path/to/game/ANIMRepack uses the source name from each folder manifest.json when present.
If the manifest is missing, it writes over an existing .FLI or .FLC with the
same stem, or creates NAME.FLI.
drmod decode PARTSHOP.TXT
drmod encode PARTSHOP.plain.txt PARTSHOP.TXTUse --method auto|1|2 to select Carmageddon 1 or C2/Splat encoding.
Use --wrap on encode when the ciphertext wraps at 24 columns.
- Keep frames in indexed (palette) mode when you edit them. FLI color limits stay intact that way.
- Name frame files
frame_XXXX.pngwith four zero-padded digits. - Extract needs
ffmpeg. Pack and repack need Aseprite batch mode (aseprite -b).
Thanks to dethrace-labs/dethrace for the reference that made this project possible.