OPENTYRIAN2000 / ENHANCED WIKI Site EN · wiki in English Download
Wiki / Modding / mod.json and items
Modding

Tyrian modding: mod.json and items

mod.json is JSON with comments (// and /* */) and trailing commas allowed. Every unknown key is an error, at every level, so a typo is always reported.

Top level

{
  "$schema": "https://raw.githubusercontent.com/Patm4nzzz/opentyrian-enhanced/rewrite/godot-rust/rewrite/mods/mod.schema.json",
  "format_version": 1,        // required: the only version that exists
  "name": "My Mod",           // required
  "author": "Me", "version": "1.0", "description": "…",
  "enabled": false,           // initial state; Setup → Mods overrides it
  "tint": "green",            // hue applied to every PNG of the mod
  "weapons": [ … ], "ships": [ … ], "sidekicks": [ … ],
  "shields": [ … ], "specials": [ … ],
  "enemy_weapons": [ … ], "enemies": [ … ],
  "starter": { … }
}
KeyTypeMeaning
$schemastringOptional path or URL of the schema, for editors. Ignored by the game.
format_version1Required. Any other value, or none, is an error.
namestringRequired. Display name.
author, version, descriptionstringShown in Setup → Mods.
enabledboolInitial state (default true).
tintstring or numberRecolors the mod's PNG files (Tint).
weapons, ships, sidekicks, shields, specialsarraysPlayer items, below.
enemy_weapons, enemiesarraysEnemies and behaviors.
starterobjectStarting loadout.

Fields shared by every item

FieldMeaning
nameRequired and unique in the mod. It is the item's identity in saves and in starter.
baseName of an original item to copy. Case, spaces, dashes and underscores are ignored. Every field you set overrides the copy.
costShop price.
icon_spriteName of the shop icon: a PNG of the mod or an original sprite.
always_availableSold in every shop.

All mods together can add at most 20 weapons, 14 ships, 13 sidekicks, 9 shields and 16 specials. The names of the original items are the ones in the shop, listed on the equipment pages.

Weapons

FieldDefault without baseMeaning
power_use20Energy used per volley.
cost1000Price at power 1.
tint—Hue of this weapon's sprites only.
front[], rear[]—Power levels, 11 at most each.

A weapon with only front[] or only rear[] has one firing mode; with both, the player switches with the change-fire key. With always_available, a weapon with front[] is sold as a front gun, one with rear[] as a rear gun, and one with both (or neither) in both shops.

Power levels

Each entry of front[] or rear[] is one power level. Enemy weapons use the same fields plus a name.

FieldMeaning
fire_delayFrames between two volleys.
projectile_countProjectiles per volley.
max_on_screenLength of the cycle through projectiles[].
animationAnimation speed; 0 means no frame cycling.
offset_x, offset_ySpawn offset.
homingtrue or a number; above 5 the shot is guided towards the nearest enemy.
accel_x, accel_yAcceleration per frame.
circle_radiusOrbit radius.
soundSound effect index.
trailTrail effect; 255 means none (the default).
ship_blast_filterDamage type mask.
projectiles[]Up to 8 projectiles, below.

Projectiles and damage

FieldDefaultMeaning
damage0Damage code, below.
sub_delay255Lifetime in frames; 255 means until it leaves the screen. Never 0 (the shot would never be drawn).
speed_x, speed_y0Velocity. For a player weapon a positive speed_y goes up; for an enemy weapon it goes down.
spawn_x, spawn_y0Spawn position offset.
sprite—Name of the projectile sprite.
damageEffect
0 to 98Damage per hit.
"freeze"No damage; freezes the enemy.
{ "pierce": n } (n = 0 to 5)Goes through enemies, n damage to each.
{ "chain": "<original weapon>" }Chain reaction: 1 damage, and the hit fires that original enemy weapon.

Any other number (99 and above) is an error: the engine's internal codes are never written by hand.

Ships

FieldDefault without baseMeaning
damage_resistance20Armor.
cost5000Price.
ship_sprite—Name of a 24×28 ship image; the engine uses it for all banking poses.
ship_poses—{ "neutral", "left_full", "left", "right", "right_full" }, one name each, to draw the poses yourself.

Sidekicks

FieldDefault without baseMeaning
trail0Movement: 0 fires with the player, 1 follows, 2 orbits, 3 independent, 4 stationary orbit.
ammo0Shots before recharge; 0 means unlimited.
cost5000Price.

Shields

FieldDefault without baseMeaning
shield_power9Recharge rate, 0 to 28 (clamped with a warning).
max_power14Maximum, 0 to 18 (clamped with a warning). The strongest original shield has 14.
cost10000Price.

Specials

FieldDefault without baseMeaning
power100Effect strength.
subtype1Effect kind.

A special fires the weapon of its base. Shops never sell specials: give one through starter.

Shop slots

always_available items are added to every shop, 16 per category at most. A shop shows at most 10 items per category including the level's own items, so items past the free places are not shown. Keep about eight flagged items per category.

Starting loadout

"starter": { "ship": "Xeno Vanguard", "front_weapon": "Alien Vulcan Cannon",
             "rear_weapon": "…", "shield": "…", "generator": "…",
             "sidekick_left": "…", "sidekick_right": "…" }

Each value is the exact name of an item, original or from any loaded mod. Names are resolved after every mod has loaded; an unknown name is an error.