-
Notifications
You must be signed in to change notification settings - Fork 2
Cookbook Species And Moves
Record shapes: Concepts: Data Model and Reference: Registries. Worked paths: Tutorial 03, Tutorial 05.
mod.content.moves:register("MODSTRIKE", {
id = "MODSTRIKE", name = "MODSTRIKE",
type = "NORMAL", category = "physical",
power = 70, accuracy = 100, pp = 15,
effect = "NO_ADDITIONAL_EFFECT",
})
mod.content.pokemon:patch("RATTATA", {
learnset = { __append = { { level = 15, move = "MODSTRIKE" } } },
})Checkpoint: Rattata learns MODSTRIKE at 15 and it deals plain damage.
Browse effect ids with mod.content.move_effects:each().
mod.content.move_effects:register("MODDRAIN_EFFECT", {
kind = "secondary",
run = function(ctx)
if ctx.rng(0, 255) < 85 then
ctx.changeStage(ctx.target, "speed", -1)
end
end,
})Checkpoint: a move with effect = "MODDRAIN_EFFECT" drops speed about a
third of the time. The ctx facade (say, anim, damage, inflict,
changeStage, rng) is the supported surface
(src/battle/EffectRegistry.lua).
mod.content.pokemon:register("MODMON", {
id = "MODMON", name = "MODMON", dex = 152, types = { "NORMAL" },
baseStats = { hp = 60, attack = 70, defense = 55, speed = 90, special = 65 },
catchRate = 120, baseExp = 100, growthRate = "MEDIUM_FAST",
level1Moves = { "TACKLE" }, learnset = {}, evolutions = {},
spriteFront = mod.assets:path("assets/front.png"),
spriteBack = mod.assets:path("assets/back.png"),
frontSize = 5,
})Checkpoint: modkit validate passes; the mon battles and the dex counts
152. Full field list and the catchable checkpoint:
Tutorial 03.
mod.content.icons:register("MODMON", {
image = mod.assets:path("assets/icon.png"),
})Checkpoint: the party menu shows the icon. The registry is keyed by species id — a species past dex 151 gets an icon without touching any list.
mod.content.cries:register("MODMON", { file = mod.assets:path("assets/cry.wav") })
-- or derive from a vanilla cry:
mod.content.cries:patch("PIKACHU", { pitch = 200 })Checkpoint: the cry plays on send-out and in the dex. Def shapes: a
file, a { base, pitch, length } derivation, or a chip program.
mod.content.growth_rates:register("ERRATIC", {
expForLevel = function(level) return level * level * level end,
})Checkpoint: a species with growthRate = "ERRATIC" levels on your
curve. The curve must strictly increase — validation calls it at levels
1 and 2 and rejects a flat one.
mod.content.evolution_methods:register("FRIENDSHIP", {
check = function(game, mon, evo, trigger)
return trigger.kind == "levelup" and (mon.friendship or 0) >= 220
end,
})
mod.content.pokemon:patch("MODMON", {
evolutions = { { method = "FRIENDSHIP", species = "MODMON2" } },
})Checkpoint: the evolution fires when check returns true (vanilla
methods: LEVEL, ITEM, TRADE — src/pokemon/Evolution.lua). The
evolution.check hook wraps every check if you need to intercept
globally.
Engine 1.0.0 · mod API 2 · repository · Discord
This project ships no ROM data. All game content is decoded on the player's machine from their own verified Pokemon Red ROM; mods ship recipes and original assets, never extracted content.
Start here
Concepts
Tutorials
- The ladder
- 01 Sprite and Text Tweak
- 02 Balance Patch
- 03 New Species
- 04 New Item and Ball
- 05 New Move
- 06 NPC and Dialogue
- 07 New Map
- 08 Quest
- 09 Custom Music
- 10 New Mechanic
- 11 Custom UI Screen
- 12 Mini Total Conversion
Reference
Guides
Playing