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.

01

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:

PlatformMods Directory Path
WindowsGameDirectory/MesozoicDawn_Data/StreamingAssets/Mods/
Linux ServerGameDirectory/MesozoicDawn_Data/StreamingAssets/Mods/
AndroidInternalStorage/Android/data/com.../files/Mods/
iOSAppSandbox/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

  1. Launch the game and open MOD Management from the login screen.
  2. Click Load MOD to scan local MODs.
  3. Find your MOD and click Enable.
  4. Click Save to exit the MOD manager.
  5. Join a server and the modified values take effect immediately.
02

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

FieldDescription
raceRequired. The race tag you want to modify.
nameThe display name of the creature.
volumeCreature size classification from 0 to 5.
habitHabit type from 0 to 5 (0 = terrestrial, 1 = hydrophilic, 3 = aquatic...).
typeCreature category from 0 to 5 (0 = carnivore, 1 = herbivore...).

Survival And Combat Stats

FieldDescription
healthMaximum health limit.
staminaMaximum stamina reserve. When empty, sprinting and heavy attacks are unavailable.
hunger / waterMaximum hunger and water reserves.
attack / defendBase damage output and base torso defense.
pen / tenAttack penetration level and defense tenacity level.
03

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
    }
}
04

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.