Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NPC Inspector

A tiny dev tool for gen1recomp mod authors. Talk to any NPC and it shows you the two strings you need to take over their dialogue:

MAP:
PEWTER_NIDORAN_H
OUSE
[A]
TEXT:
TEXT_PEWTERNIDOR
ANHOUSE_MIDDLE_A
GED_MAN

Press A and the NPC says whatever they normally say, completely untouched.

This is a development tool, not a gameplay mod. Install it while you're building something, then toggle it off (or uninstall) to play normally.

Why you want this

In gen1recomp there's no NPC registry — the way you add dialogue is to take over an existing NPC's TEXT_ constant on their map:

mod.content.map_scripts:register("PEWTER_NIDORAN_HOUSE", {
  talk = { TEXT_PEWTERNIDORANHOUSE_MIDDLE_AGED_MAN = MY_SCRIPT },
  priority = 500,
})

The problem: those constants are extracted from the ROM at load time, so they aren't greppable in the engine repo. Only the handful of maps with hand-ported scripts name them in source at all.

Worse, guessing them from the pokered disassembly fails in the way that hurts most — some objects are renamed between Red/Blue and Yellow. The Celadon Game Corner coin-giver is TEXT_GAMECORNER_CLERK2 in Red/Blue but TEXT_GAMECORNER_MIDDLE_AGED_MAN2 in Yellow. Register the wrong one and your mod does nothing at all — no error, no warning, just vanilla dialogue. That is a genuinely slow bug to find.

Reading the constant off the real running game is version-correct by construction. (And the renames are per-map, not universal, so it's worth checking each NPC on each version rather than assuming either way.)

Usage

  1. Install and enable alongside whatever you're building.
  2. Walk up to each NPC you want to target and talk to them. Note the two strings — the box hard-wraps at 16 characters, so read it as one continuous string ignoring the line breaks.
  3. Toggle SHOW NPC IDS off in the mod's options when you want to play normally. No restart needed.

Options

Option Default Effect
SHOW NPC IDS ON Show the map id and TEXT constant before each NPC's dialogue

Installation

  1. Download npc_inspector-<version>.zip from the latest release.
  2. In the launcher: MODS → Import mod .zip. On iOS, delete any older downloaded copy of the zip from Files first.
  3. Fully quit and relaunch.
  4. Requires gen1recomp 0.1.38 or newer. No other dependencies.

Updating: once installed, the launcher checks this repo for new releases — the mod's entry shows "vX.Y.Z available" → tap → Update → fully quit and relaunch.

How it works

OverworldState:showMapText(textConst, npc, onDone) is the single funnel every NPC talk passes through. This wraps that method, pushes one TextBox, and calls the original from its onDone — so real dialogue is never modified, reordered or suppressed, it just happens one box later.

Two deliberate safety choices:

  • The wrapper is rebuilt from a stashed original rather than guarded by a "already wrapped" sentinel. Engine module tables persist in Lua's module cache for the whole game process, so a sentinel makes a re-enabled updated mod silently keep running its old code.
  • Any error while building the debug box falls straight through to untouched vanilla dialogue, so this can never stop you talking to an NPC.

Credits

Built for gen1recomp. By Mister Miracle (@mistermiracle3036). See THIRD_PARTY_NOTICES.md.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages