Mod folders, load order, file mods
Where mods live
Every mod is a folder or a .zip file in the mods folder next to the game's executable. Both games of the PC
port, Carnivores: Dinosaur Hunter HD and Carnivores: Ice Age, share this one folder; each game loads only the mods made
for it (Games):
carnivores.exe (or carnivores on Linux)
data/ Dinosaur Hunter's own files (made by the first-run setup from your APK)
data-iceage/ Ice Age's own files
mods/
modlist.txt the load order (the game writes it)
hello/ a mod as a folder
mod.json
main.lua
RaptorPack.zip a mod as a zip (the same files inside)
A zip is unpacked by the game into mods/.unpacked/ (again whenever the zip is newer). Its id is the zip's file name,
RaptorPack.zip. Inside the zip, mod.json and main.lua sit at the top, or in the one folder that holds the whole
mod (a zip made from the mod's folder): the game then reads the mod from that folder. A folder that holds nothing but
the mod's own folder (mods/hello/hello/mod.json) is read the same way. The game files a mod replaces may sit in any
folder inside it.
To delete a mod, select it in the Mods screen and press Remove...: its folder (or zip) goes, its saved data and settings stay. A mod that came from the phone's Use a folder folder is deleted there instead.
When something keeps a mod from working, the Mods screen shows its name in orange; select it to read why (a main.lua
saved as main.lua.txt, a mod.json that is not valid JSON, the mod's folder buried deeper inside, a mod with nothing
but mod.json). The log says the same in lines starting mods: <id>:.
On an Android phone
The Android edition keeps its mods folder in Android/data/io.github.dinohunter213.carnivores/files/mods, which file
managers cannot open on Android 11 and later (a computer over USB can). Three ways to get mods there:
- Import mod (.zip) in the MODS screen (Installed tab): pick the zip with the system's file picker.
- Open with / Share: tap a downloaded mod zip (in the browser's downloads or a file manager) and choose Carnivores (Modded); the MODS screen opens and imports it.
- Use a folder... (for modders), in the same tab: pick a folder of your phone, e.g.
Download/mods. Its mods (sub-folders and zips) are copied into the app's mods folder at every start and on Reload scripts: new and changed files are copied, files you deleted there are deleted from the copy. Keep the mods in that folder: a mod you delete there is deleted from the game too. Edit a mod's Lua in any editor app, then tap Reload scripts. Stop using this folder keeps the copies as they are.
An imported zip must be a mod: mod.json at its top (the zip is used as it is), or inside the one folder that holds
the mod (unpacked into a folder mod of that name). A mod of the same name is replaced only when you say so. After an
import, Apply loads it.
mod.json
Optional, but every published mod should have one:
{
"name": "Raptor Pack",
"version": "1.2.0",
"author": "Nedry",
"description": "Smarter raptors that hunt in packs, and two new raptor species.",
"games": ["dinohunter"],
"main": "main.lua",
"api": 1,
"requires": ["uilib"],
"optional": ["scoreboard"]
}
| Field | Meaning |
|---|---|
name |
shown in the Mods screen and the mod menu (default: the id) |
version |
any text; shown next to the name |
author |
shown in the Mods screen |
description |
shown in the Mods screen |
games |
the games the mod is made for: ["dinohunter"], ["iceage"] or ["dinohunter", "iceage"]; without it, Dinosaur Hunter only (Games) |
main |
the Lua file that starts the mod (default main.lua); no main file = not a script mod |
api |
the lowest modding API version the mod needs (game.apiVersion()); an older game shows the mod as failed with the reason instead of running it |
requires |
ids of mods it cannot work without: it loads after them, and does not run when one is missing, off or failed |
optional |
ids of mods it uses when they are there: it loads after them |
JSON comments (//) and trailing commas are allowed in every JSON file the mod loader and the Lua API read.
Games
The PC port runs two games: Carnivores: Dinosaur Hunter HD ("dinohunter") and Carnivores: Ice Age ("iceage").
Each is its own copy of the game; one mods folder serves both, and mod.json "games" says which game a mod is for:
{ "name": "Creature Labels", "games": ["dinohunter", "iceage"] }
- A mod without
"games"(or without a mod.json) is a Dinosaur Hunter mod: the mods made before Ice Age came keep working as they are, and Ice Age leaves them alone. - Each game sees only its own mods: the Mods screen lists them, only they load (files, content packs, scripts),
mods.list()returns them. The other game's mods stay in the folder and inmodlist.txt, untouched; the mod menu's Installed tab (F1) lists every mod with its games. - A mod for both games runs the same scripts in each;
game.id()tells it which game it is in, so it can pick species ("trex"or"mammoth"), texts or maps. The species of each game are in the species tables. - File mods and content packs name game files and species, which differ between the games (Ice Age has its own animals, five maps, its own texts: The game's files), so most of them are made for one game.
Load order
The Mods screen (main menu → MODS) lists every mod with a checkbox (on / off) and arrows (order). Apply saves
the order to mods/modlist.txt and reloads the scripts. The file is plain text: one mod id per line, top first,
- in front of a switched-off mod:
# Load order: later lines win. A leading '-' switches a mod off.
# One list for both games: each game loads the mods whose mod.json "games" names it.
HuntersPack.zip
hello
-old_test_mod
Later wins. When two mods have a file with the same name, the one lower in the list is used; the Mods screen shows
these conflicts. Scripts (.lua) and content packs' .json files are read from each mod's own folder, so every script
mod's main.lua is its own and never a conflict. Script mods load in list order too, and content packs apply in list order (a later pack overrides
the same entry of an earlier one). New mods are added at the end, switched on.
File mods: replacing and adding game files
The game opens its files by file name only: the folders inside data/ do not matter for lookups. So a mod file
named like a game file replaces it, wherever it sits in the mod:
mods/BlueRex/tirex.cat replaces the T-Rex (model, animations and sounds)
mods/QuietGun/shot1.wav replaces a gunshot sound (example name)
A file with a new name is simply added; content packs and scripts use added files (new models, sounds, maps).
What can be replaced, and the formats: The game's files lists every file group, and Data file formats documents each format byte by byte.
When changes apply: files are looked up again when you press Apply or Look again in the Mods screen. Files the game already loaded (the menu art, the current map, species already in memory) change after a restart or the next time the game loads them (the next hunt, for maps and creatures).
Files a mod's scripts read with mod.read, or sounds it plays with sound.play, are found the same way, so a
script mod can ship its own .wav files and JSON data.
Mod data and settings
Script mods save their data with mod.save into the game's save folder, moddata/<id>.json; settings declared with
mod.setting go to moddata/<id>.settings.json. The save folder is %APPDATA%\carnivores on Windows and
~/.local/share/carnivores on Linux; Ice Age has its own, carnivores-iceage, so a mod for both games keeps separate
data and settings in each. Deleting a mod's files there resets it.
Publishing a mod
- Zip the mod's folder contents (or the folder) as
YourMod.zip; players drop it intomods. - Never include the game's own files unchanged: players have them already, and they are Tatem's. Ship only your own or changed files.
- Give the mod a
mod.jsonwith a version and its"games", and say in the description which other mods it needs.