2
Guide Save Editor
bryanthaboi edited this page 2026-08-15 23:44:59 -04:00

Save editor

A built-in editor for party, boxes, items, event flags, map location, and Pokedex flags, no play-through required. It ships inside every build and edits Red, Blue, Yellow, and Gold saves: a generation adapter (tools/save-editor/Gen.lua) routes every read and write, so a Gold edit lands in Gold's save shape rather than the Gen 1 fields.

Two ways in

From the launcher. Every SAVE SLOT row that holds a save carries an Edit control next to Delete. Edit suspends the launcher, mounts that game's cache, and opens that slot's file; Close hands the launcher back with the slot list re-read. This is the path most people use, and it works on every game tab, Gold included. Hopping between games is safe: Close unmounts the version's cache and evicts the loaded data and editor modules, so the next Edit (or Play) on the other game cannot see this one's species or item tables.

Standalone, where Close quits instead. Close the game first, then from the repo root:

love . --editor
# or
POKEPORT_EDITOR=1 love .
# edit Gold (or blue / yellow) instead of Red
POKEPORT_VERSION=gold love . --editor
# open a specific save file (any path)
love . --editor --save "/path/to/slot1.lua"

POKEPORT_VERSION picks which game's cache and data the editor loads (Red unless overridden), which matters: a Gold save edited against Red's tables would be wrong, so match the variable to the save you open.

Which save it opens

The game stores playthroughs as save slots: one Lua file per slot under saves/<version>/ (slot1.lua, slot2.lua, ...) in the LÖVE save directory, with the slot registry in options.lua. The launcher's Edit opens exactly the slot you clicked. A bare standalone run falls back to the legacy flat save.lua under:

OS Path
macOS ~/Library/Application Support/LOVE/pokemon-love2d/ (without the LOVE/ segment in a packaged build)
Linux ~/.local/share/love/pokemon-love2d/
Windows %APPDATA%\love\pokemon-love2d\

On a slotted install that flat file usually no longer exists, so pass --save with the slot file's path, or take the launcher route. Once the editor is up, Open... and dropping a save file onto the window also work.

If options.lua is ever reset or loses its slot registry, nothing is lost: the next boot rescans saves/<version>/ and re-registers every slot file it finds, so orphaned saves reappear in the launcher on their own.

Editing Gold saves

The six tabs are the same (PARTY, BOXES, ITEMS, EVENTS, MAP, DEX); the adapter redirects what they touch:

  • BOXES edits Gold's 14 boxes of 20 (Gen 1 has 12 of 20).
  • ITEMS labels each item with its Gold pocket, and its wallet column writes money and coins to Gold's player fields. Badge chips cover both the Johto and the Kanto set.
  • EVENTS lists Gold's named event flags (src/core/gen2/FlagNames.lua) plus any flags scraped from enabled mods.
  • MAP browses the Gold map set, including maps mods add.

Mods merge into the editor's data the same way the game loads them, so modded species, items, and flags are editable. Opening a save from a different game than the previous editor session reloads the data and mod set for that game automatically.

Safety

Every write makes a <file>.bak-YYYYMMDD-HHMMSS backup first. Saves are plain Lua data files parsed by a data-only reader; the editor (and the game) never execute code from a save. When a loaded save carries content the game would quarantine (lost mons, items, script state), the status bar reports it on load, before you change anything.

Headless test instructions live in tools/save-editor/README.md.