MOD / Lua API
MOD Creation Tutorial & Lua API
Learn how to create character stat MODs, skill MODs, gene BUFF MODs, skin MODs, and hitbox MODs. Understand MOD management, priority, and sandbox limits.
1. Quick Start
1.1 What is a MOD?
A MOD is a player-made content pack that modifies creature stats, skills, skins, and hitbox properties. The game ships with two example MODs β DemoCharacterMod and DemoSkinsMod β located in the gameβs MOD directory (see path above). Copy and modify them to get started quickly.
1.2 MOD Directory Location
| Platform | Mods Directory Path |
|---|---|
| Windows (Steam) | Steam Workshop auto-manages subscribed MODs |
| Windows (Local) | C:\Users\{User}\AppData\LocalLow\NEXTINDIE Studio\Mesozoic Dawn\Mods\ |
| Linux Server | GameDirectory\MesozoicDawn_Data\StreamingAssets\Mods\ |
| Android | InternalStorage/Android/data/com.../files/Mods/ |
| iOS | AppSandbox/Documents/Mods/ |
1.3 MOD Directory Structure
Mods/
βββ DemoCharacterMod/ β Full example (stats+skills+hitbox+skin)
β βββ mod.json β MOD manifest
β βββ preview.jpg β Preview image
β βββ CharacterAsset/
β β βββ allo.txt β Allosaurus config (all 4 types)
β βββ SkinsAsset/
β βββ Crooked mouth.png β Skin texture
β
βββ DemoSkinsMod/ β Skin-only MOD example
β βββ mod.json
β βββ preview.jpg
β βββ SkinsAsset/
β βββ allo_deser_allo.txt β Skin script
β βββ deser_allo.png β Skin texture
β
βββ MyFirstMod/ β Your MOD root directory
βββ mod.json
βββ CharacterAsset/
βββ allo.txt 1.4 Create mod.json
{
"Name": "MyFirstMod",
"Author": "Your Name",
"Version": "1.0",
"SupportedVersion": "0.6.*",
"Priority": 0,
"Description": "My first MOD",
"PreviewImagePath": "preview.jpg",
"Tags": "Character"
} | Field | Required | Description |
|---|---|---|
Name | β | Unique MOD identifier. Match the folder name. |
Author | β | Author name. |
Version | β | MOD version number. |
SupportedVersion | β | Compatible game version. Supports * wildcards (e.g. 0.6.*). |
Priority | β | Execution priority (default 0). Higher values run later and win. |
Description | β | Short MOD description. |
PreviewImagePath | β | Relative path to preview image (e.g. preview.jpg). |
Tags | β | Comma-separated tags (e.g. Character,Skin). |
1.5 The In-Game MOD Interface at a Glance
On the login screen click MOD Management to open the MOD interface. It has three tabs β Local MODs, Workshop, Manage MODs β plus the Create MOD and Set Directory buttons, covering a MOD author's whole journey from creation to testing.
| Tab / Button | Purpose |
|---|---|
| Local MODs | MODs already previewed to the local load list. Enable/disable and delete here. What the game actually loads is the enabled MODs on this tab. |
| Workshop | Steam only. Browse and manage the Workshop MODs you subscribe to (view, unsubscribe), with install/download status shown. |
| Manage MODs | Your own MOD-draft workbench. Each MOD offers Preview, Export, Edit, Delete (and Upload to Workshop on Steam). |
| Create MOD | Create a new MOD draft, choosing a template: Blank / Skin example / Character stats example / Gene stats example. |
| Set Directory | Point to an external writable folder as your MOD root, so you can edit scripts with a desktop text editor and sync them back into the game. |
1.6 Create Your MOD (Recommended for Beginners)
The game has a built-in MOD creation tool β no need to make folders by hand:
β Log in (creating a MOD requires login; the MOD is bound to your account).
β‘ MOD Management β click Create MOD.
β’ Fill in the name (letters/digits/underscore/hyphen only, 1β64 chars), author, version, supported version, description, tags, and pick a template.
β£ Click Create β the system generates the directory skeleton (mod.json plus the template's example script folder).
β€ The MOD then appears on the Manage MODs tab as a draft, not yet on the local load list.
| Template | What it generates |
|---|---|
| Blank | Only mod.json β start from scratch. |
| Skin example | SkinsAsset/ skin-script skeleton. |
| Character stats example | CharacterAsset/ character-stats skeleton. |
| Gene stats example | GeneBuff/ gene-override skeleton. |
1.7 Edit and Preview
β Find your MOD on Manage MODs. If you have "Set Directory," the MOD is synced to that external folder and you can open it directly in a text editor; otherwise edit the Lua scripts (CharacterAsset/*.txt, etc.), skin PNGs, and preview.jpg inside its folder in the game MOD directory.
β‘ Use the inline Edit button to change version, supported version, description, and tags (the name is locked).
β’ When done, click Preview to push the draft into the Local MODs load list.
1.8 Test in Game (Author Dev-Test Loop)
- Create: MOD Management β Create MOD β pick a template β Create (generates a draft; see 1.6).
- Edit: edit the scripts and metadata on Manage MODs (see 1.7).
- Preview: click Preview to move the draft into the Local MODs load list.
- Enable: switch to Local MODs, confirm the MOD status is "Enabled" (green) and "Supported Version" is green (red means it is incompatible with the current game version β fix
SupportedVersion). - Test: enter single-player or create a room β the modified stats/skills/skins take effect immediately.
- Iterate: go back to Manage MODs and edit the scripts β create a local Host room so the preview snapshot refreshes from the latest draft β re-enter the match to verify. After Sync Preview is enabled once, neither a game restart nor another Sync Preview click is needed.
- Distribute: when satisfied, use Export to produce a
.modfile to share; on Steam you can also Upload to Workshop to publish publicly.
1.9 Sync Preview Mode (Development Testing)
Sync Preview in Manage MODs creates a separate runtime snapshot of your draft and registers it in the local load list. The authoring source stays in the Manage MODs directory; Sync Preview is not publishing and does not upload the MOD to the Workshop.
1.10 Export .mod (Sharing and Installation)
Export packages the current working copy from Manage MODs into a compressed .mod file and opens the system save-location picker. The package is rooted at the directory containing mod.json and includes scripts, images, and other MOD files. Export does not enable preview, alter your draft, make the MOD public, or upload it to the Workshop.
- Author: in Manage MODs, click Export, save the
.modthrough the system file picker, then send that file to testers or players. - Recipient: on the Local MODs tab, click Import MOD, select the received
.mod(or a supported.zip), then confirm it appears in the local load list and is enabled. - Multiplayer: before joining or creating a MOD-enabled room, every participant should use the same MOD content, version, and enabled state. An exported package is not a substitute for publishing to the Workshop.
2. Character Stat MOD
Create a .txt file in the CharacterAsset/ directory and define a CharacterAsset table to modify creature attributes. Omitted fields keep original values. Below is the complete allo.txt from the bundled DemoCharacterMod, showing every available field.
2.1 Full Example (allo.txt from DemoCharacterMod)
-- Complete Allosaurus stat configuration (*do not delete below)
CharacterAsset = {
name = "Allosaurus", -- Display name
enable = true, -- Enable creature
jump = false, -- Allow jumping (needs matching animation)
race = "allo", -- Race tag (*required, unique match key)
ropoda = 0, -- Nest type (-1=none, 0=theropod, 1=sauropod, 2=ornithischian)
ropode = 0, -- Egg type (-1=none, 0=theropod, 1=sauropod, 2=ornithischian)
volume = 2, -- Size class 0~5 (lightβsuper)
rank = 7, -- Star rating 0~12 (S1~SS tier)
branch = 3, -- Family classification 0~25
habit = 0, -- Habit (0=land, 1=hydrophilic, 2=marine reptile, 3=aquatic, 4=amphibian, 5=flying)
type = 0, -- Category (0=carnivore, 1=herbivore, 2=aquatic, 3=arthropod, 4=mammal, 5=flying)
taste = 0, -- Diet (0=carnivore, 1=flowers, 2=leaves, 3=omnivore)
spawn = 0, -- Reproduction (0=oviparous, 1=viviparous)
health = 26503.0, -- Max health
hunger = 12227.0, -- Max hunger
water = 3128.0, -- Max water
oxygen = 474.0, -- Max oxygen
stamina = 100.0, -- Max stamina
attack = 2802.0, -- Base attack damage
defend = 779.0, -- Base defense
pen = 5, -- Penetration level 0~10
ten = 3, -- Tenacity level 0~10
restore = 266.0, -- Natural recovery rate
consume = 100.0, -- Cruise consumption
weight = 3600.0, -- Body weight (kg)
speed = 27.01, -- Walk speed (km/h)
swim = 13.5, -- Swim speed (km/h)
flying = 0.0, -- Flight speed (km/h)
runSpeed = 54.01, -- Sprint speed (km/h)
turnSpeed = 0.61, -- Turn rate (degrees/sec)
growtime = 1560.0, -- Time to reach adult (seconds)
ovumtime = 1080.0, -- Egg generation interval (seconds)
hatching = 2210.0, -- Incubation time (seconds)
safe = 1800.0, -- Juvenile protection period (seconds)
skill = "LifeDrain,3;", -- Innate EX skill
gene = "", -- Innate gene
} 2.2 Classification & Identity
| Field | Type | Description |
|---|---|---|
race | string | Required. Race tag (e.g. allo, rex, sauro). |
name | string | Display name for the creature. |
enable | bool | Allow use in selection screen (true/false). |
jump | bool | Allow jumping (must have matching animation). |
volume | int | Size class 0~5 (lightβsuper). |
rank | int | Star rating 0~12 (S1~SS tier). |
branch | int | Family classification 0~25. |
habit | int | Habit 0~5 (0=land, 1=hydrophilic, 2=marine reptile, 3=aquatic, 4=amphibian, 5=flying). |
type | int | Category 0~5 (0=carnivore, 1=herbivore, 2=aquatic, 3=arthropod, 4=mammal, 5=flying). |
taste | int | Diet 0~3 (0=carnivore, 1=flowers, 2=leaves, 3=omnivore). |
spawn | int | Reproduction 0~1 (0=oviparous, 1=viviparous). |
ropoda | int | Nest type -1~2 (-1=none, 0=theropod, 1=sauropod, 2=ornithischian). |
ropode | int | Egg type -1~2 (-1=none, 0=theropod, 1=sauropod, 2=ornithischian). |
2.3 Survival & Combat
| Field | Type | Description |
|---|---|---|
health | float | Max health points. |
stamina | float | Max stamina. |
hunger | float | Max hunger. |
water | float | Max water. |
oxygen | float | Max oxygen. |
attack | float | Base attack damage. |
defend | float | Base defense. |
pen | int | Penetration level 0~10. |
ten | int | Tenacity level 0~10. |
restore | float | Natural recovery rate. |
consume | float | Cruise consumption rate. |
weight | float | Body weight (kg). |
force | float | Physical force 0~10000. |
2.4 Movement Speed (km/h)
| Field | Type | Description |
|---|---|---|
speed | float | Walk speed. |
runSpeed | float | Sprint speed. |
swim | float | Swim speed (0 if not aquatic). |
flying | float | Flight speed (0 if not flying). |
turnSpeed | float | Turn rate (degrees/sec). |
2.5 Time Parameters
| Field | Type | Description |
|---|---|---|
growtime | float | Time to reach adult (seconds). |
ovumtime | float | Egg generation interval (seconds). |
hatching | float | Egg incubation time (seconds). |
safe | float | Juvenile protection duration (seconds). |
2.6 Organ Efficiency (0.0 ~ 1.0)
| Field | Type | Description |
|---|---|---|
muscle | float | Muscle efficiency. Affects attack stamina recovery. |
stomach | float | Stomach efficiency. Affects food/water consumption rate. |
lung | float | Lung efficiency. Affects oxygen output. |
heart | float | Heart efficiency. Affects health regen speed. |
breed | float | Breed efficiency. Affects egg generation rate. |
2.7 Body Dimensions & Innate Traits
| Field | Type | Description |
|---|---|---|
length | float | Body length (m) 0.1~100. |
width | float | Body width (m) 0.1~100. |
height | float | Body height (m) 0.1~100. |
tempMin | float | Min comfortable temp (Β°C). |
tempMax | float | Max comfortable temp (Β°C). |
humidMin | float | Min comfortable humidity (%). |
humidMax | float | Max comfortable humidity (%). |
skill | string | Innate EX skill. Format: "GeneName,Level;". |
gene | string | Innate gene. Same format. |
3. Skill MOD
Use the CharacterSkill table to modify creature attack skills. Each skill is a key-value pair (keys can be named freely). Can be combined with CharacterAsset in the same .txt file.
3.1 Full Example (from DemoCharacterMod)
CharacterSkill = {
attack1 = {
Race = "allo", -- *Required* race tag
AttackOrder = 1, -- Attack slot index (1=mouth1, 2=mouth2...)
AttackType = 0, -- Attack type 0~7 (see enum below)
DamageMode = 0, -- Damage mode 0~2 (see enum below)
Area = nil, -- Allowed areas: nil=any, {0,1}=land+shallow only
AttackRange = 1.0, -- Collision radius (meters)
Modify = 2.0, -- Damage multiplier (1=no change)
UseStamina = 0.01, -- Stamina cost percentage (0=default)
TriggerSkill = "Scars,2;", -- Skill triggered on hit (format: "Name,Level;")
},
attack2 = {
Race = "allo",
AttackOrder = 2,
AttackType = 1, -- Tail
DamageMode = 1, -- AOE
AttackRange = 3.0,
Modify = 0.8,
UseStamina = 0.03,
TriggerSkill = "Blood,2;",
},
} 3.2 AttackType Enum
| Value | Name | Notes |
|---|---|---|
| 0 | BITE | Bite attack |
| 1 | TAIL | Tail swipe |
| 2 | STEP | Stomp |
| 3 | HAND | Forelimb attack |
| 4 | BODY | Body slam |
| 5 | HEAD | Headbutt |
| 6 | FOOT | Kick |
| 7 | DASH | Dash charge |
3.3 DamageMode Enum
| Value | Name | Notes |
|---|---|---|
| 0 | Single Target | Single-target attack |
| 1 | AOE | Area-of-effect (the first valid target has no decay; later targets decay in order) |
| 2 | Charge | Charge attack (requires charge animation) |
3.4 Area Enum
| Value | Name |
|---|---|
| 0 | Land |
| 1 | Shallow Water |
| 2 | Deep Water |
| 3 | Sky |
4. Hitbox MOD
Use the CharacterHitGroup table to modify armor penetration rate and damage multiplier for each body part β create weak spots or reinforced armor.
4.1 Body Part Constants
| Constant | Value | Part |
|---|---|---|
BODY_HEAD | 0 | Head (high penetration weak spot) |
BODY_BODY | 2 | Body / Torso (armored) |
BODY_TAIL | 3 | Tail |
BODY_BELLY | 7 | Belly (fatal weak spot) |
4.2 Example (from DemoCharacterMod)
CharacterHitGroup = {
head = {
Race = "allo",
PartType = BODY_HEAD,
PenetrationRate = 0.6, -- 0~1 (higher = easier to penetrate)
DamageMultiplier = 1.5, -- 0.5~2 (>1 = more damage taken)
},
body = {
Race = "allo",
PartType = BODY_BODY,
PenetrationRate = 0.05, -- Almost impenetrable
DamageMultiplier = 0.8, -- 20% damage reduction
},
belly = {
Race = "allo",
PartType = BODY_BELLY, -- Belly (value=7)
PenetrationRate = 0.9, -- Very high penetration
DamageMultiplier = 1.8, -- Heavy bonus damage
},
} 5. Gene BUFF MOD
The Gene BUFF MOD overrides the values and config of existing genes/skills/BUFFs via the global table CharacterGeneBuff. Like CharacterAsset, the script is XLua (.txt) and can live in the same file or a dedicated GeneBuff/ subfolder.
5.1 Config Structure (CharacterGeneBuff)
CharacterGeneBuff = {
-- Key = the existing gene tag to override (get TAGs from the Skills & Genes list page)
Bleed = {
Repeat = "COVER", -- Optional: overwrite rule
Upgrade = "EXP", -- Optional: upgrade mode
With = "", -- Optional: attached effect DSL, format tag,level;
Copes = "", -- Optional: counter target tag
Effects = { -- *Required* per-level table (replaces the original per-level values)
{ Level = 1, Probability = 0.55, Effect = 0.03, Duration = 5 },
{ Level = 2, Probability = 0.65, Effect = 0.05, Duration = 7 },
}
}
} 5.2 Modifiable Top-Level Fields
| Field | Type | Description | Required |
|---|---|---|---|
Repeat | enum | Overwrite rule (see 5.4) | Optional |
Upgrade | enum | Upgrade mode (see 5.4) | Optional |
With | string | Attached effect DSL tag,level; | Optional |
Copes | string | Counter target tag | Optional |
Effects | array | Per-level value table (see 5.3) | Required |
5.3 Effects Per-Level Fields
| Field | Type | Description | Range |
|---|---|---|---|
Level | int | Level number (β€0 falls back to index) | β₯1 |
Probability | float | Trigger probability | 0~1 |
Chance | float | Synthesis chance | 0~1 |
Range | int | Effect range | 0~100 |
Limit | int | Max affected players | 0~10 |
Effect | float | Core strength value | Depends on effect type |
Count | int | Count (with TRIGGER) | β |
Skillful | float | Proficiency needed to reach this level | β |
Duration | float | Duration (for counter genes = % reduction of DEBUFF time) | -99999~99999 |
Forever | bool | Is this level's BUFF permanent | β |
IsEffectFixed / IsDurationFixed | bool | Whether value/time is a fixed number (display only) | β |
5.4 Available Enums
| Enum | Allowed values |
|---|---|
Upgrade mode | NONE (no upgrade) / TIME (proficiency by survival time) / EXP (proficiency by kills) / ALL (all sources) |
Repeat rule | ONE (reject repeat) / ADD (stack) / COVER (refresh) |
5.5 Full Example (bundled DemoCharacterMod/GeneBuff/gene_buff.txt)
CharacterGeneBuff = {
-- β Override the per-level values of the existing gene Metabolism
Metabolism = {
Effects = {
{ Level = 1, Effect = 0.12, Skillful = 0 },
{ Level = 2, Effect = 0.18, Skillful = 100 },
}
},
-- β‘ Override the trigger probability, values and duration of the existing skill gene Bleed
Bleed = {
Effects = {
{ Level = 1, Probability = 0.55, Effect = 0.03, Duration = 5 },
{ Level = 2, Probability = 0.65, Effect = 0.05, Duration = 7 },
}
}
} 5.6 Grant Innate Genes to a Creature
-- In the creature's CharacterAsset script, use the gene field to grant innate genes. Format: GeneName,Level;
CharacterAsset = {
race = "allo",
gene = "Metabolism,2;",
} 5.7 Loading & Constraints
- Applies immediately: once the override succeeds, birth / trigger / execution all read the overridden values.
- Strict reference validation:
Withmust betag,level, no self-reference, the referenced tag must exist, and the level must be in range;Copesmust exist and not self-reference. Any failure rejects the override (never fails silently). - No valid
Effectsβ that override fails. - Session-level restore: leaving / disabling / resetting the MOD automatically restores the overridden genes, preventing cross-match residue.
- Dual-side parity: the server must load the same MOD via
GAME_MODS; hashes must match to join;/modReloadhot-reloads gene values.
6. Skin MOD
Use the CharacterSkin table to add custom skins. Each .txt file defines one skin. Texture files go in a SkinsAsset/ folder within your MOD directory. See the bundled DemoSkinsMod for a complete example.
6.1 Skin Script
CharacterSkin = {
Race = "allo", -- *Required* race tag
Name = "Crooked mouth", -- *Required* unique skin name
Path = "SkinsAsset/Crooked mouth.png", -- *Required* texture path (relative to MOD root)
} 6.2 Texture Requirements
- Format: PNG or JPG.
- Resolution: match the original texture (typically 2048Γ2048 or 4096Γ4096).
- Path must be relative to MOD root β no absolute paths.
6.3 Multi-Skin Directory Example
MySkinMod/
βββ mod.json
βββ preview.jpg
βββ SkinsAsset/
βββ allo_crooked.txt β CharacterSkin { Race="allo", Name="Crooked mouth", ... }
βββ crooked_allo.png β Texture file
βββ rex_volcano.txt β Multiple races in one MOD is fine
βββ volcano_rex.png 7. Advanced: Management & Distribution
7.1 Priority System
When multiple MODs modify the same field of the same race, the larger Priority value runs later and wins. Default is 0. Same-priority MODs run in alphabetical order.
7.2 Lua Sandbox Security
os,io: system commands and file I/O are blocked.dofile,loadfile,package: arbitrary file execution and dynamic library loading are blocked.
7.3 Packaging as .mod File
Compress all files in your MOD folder as ZIP, then rename to .mod. Ensure mod.json is at the archive root. Both .mod and .zip are recognized.
7.4 Server MODs
Servers specify MODs via the GAME_MODS environment variable (comma-separated):GAME_MODS=DemoCharacterMod,MySkinMod
All server-required MODs must be installed and enabled on clients to join. Extra client-only MODs will not apply on that server. Admins can use /modReload to hot-reload MOD config.