MOD / Lua API
MOD Creation Tutorial & Lua API
Learn how to create a MOD, write Lua configuration scripts, tune creature stats, and understand priority and sandbox rules.
1. Quick Start
1.1 Create a MOD Folder
Create a new folder inside the game's Mods/ directory. The folder name becomes your MOD name:
| Platform | Mods Directory Path |
|---|---|
| Windows | GameDirectory/MesozoicDawn_Data/StreamingAssets/Mods/ |
| Linux Server | GameDirectory/MesozoicDawn_Data/StreamingAssets/Mods/ |
| Android | InternalStorage/Android/data/com.../files/Mods/ |
| iOS | AppSandbox/Documents/Mods/ |
Mods/
└── MyFirstMod/ ← Your MOD root directory
├── mod.json ← MOD manifest file (recommended)
└── CharacterAsset/ ← Place Lua scripts here
└── allo.txt ← Allosaurus configuration 1.2 Create mod.json (Recommended)
{
"Name": "MyFirstMod",
"Author": "Your Name",
"Version": "1.0",
"SupportedVersion": "0.6.*",
"Priority": 0,
"Description": "My first MOD"
} 1.3 Write Your First Lua Script
Put the following content into CharacterAsset/allo.txt:
-- Adjust Allosaurus health and damage
CharacterAsset = {
race = "allo", -- Race tag (must match an existing in-game race)
health = 30000.0, -- Health points
damage = 350.0, -- Base damage
speed = 30.0, -- Movement speed (km/h)
} 1.4 Enable the MOD In Game
- Launch the game and open MOD Management from the login screen.
- Click Load MOD to scan local MODs.
- Find your MOD and click Enable.
- Click Save to exit the MOD manager.
- Join a server and the modified values take effect immediately.
2. Character Stat Modification
Character stat configuration lets you adjust creature attributes. All supported fields must be written inside the Lua script's CharacterAsset table. Any field you omit will keep the original game value.
Basic And Category Settings
| Field | Description |
|---|---|
race | Required. The race tag you want to modify. |
name | The display name of the creature. |
volume | Creature size classification from 0 to 5. |
habit | Habit type from 0 to 5 (0 = terrestrial, 1 = hydrophilic, 3 = aquatic...). |
type | Creature category from 0 to 5 (0 = carnivore, 1 = herbivore...). |
Survival And Combat Stats
| Field | Description |
|---|---|
health | Maximum health limit. |
stamina | Maximum stamina reserve. When empty, sprinting and heavy attacks are unavailable. |
hunger / water | Maximum hunger and water reserves. |
attack / defend | Base damage output and base torso defense. |
pen / ten | Attack penetration level and defense tenacity level. |
3. Skills And Hitbox Modifications
3.1 Skill Configuration Template
CharacterSkill = {
bite = {
Race = "allo", -- Required race tag
AttackName = "Bite", -- Attack name
AttackOrder = 1, -- Attack order index
AttackType = 0, -- 0 = mouth, 1 = tail, 2 = stomp
DamageMode = 0, -- 0 = single target, 1 = AOE
AttackRange = 1.5, -- Collision radius (meters)
Modify = 1.5, -- Damage multiplier
}
} 3.2 Hitbox Override
Use CharacterHitGroup to change how vulnerable the Allosaurus head is:
CharacterHitGroup = {
head = {
Race = "allo",
PartType = 0, -- 0 = head
PenetrationRate = 0.6, -- Armor penetration multiplier
DamageMultiplier = 1.5, -- Incoming damage multiplier
}
} 4. Advanced: Environment And Management
Priority Mechanism
When multiple MODs modify the same field of the same race, a larger Priority value runs later and therefore wins. The default value is 0.
Lua Sandbox Security
os,io: system commands and file I/O are blocked.dofile,package: executing arbitrary local files or external dynamic libraries is blocked.
Server Management
Administrators can use /modReload to reload numeric values, skills, and skin configuration from the current MOD files. Adding new races still requires a restart.