Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/pmret/papermario/llms.txt

Use this file to discover all available pages before exploring further.

Enums provide named integer constants for virtually every game state tracked by Paper Mario. Rather than scattering magic numbers throughout the codebase, the decomp uses a small number of large enums — most notably StoryProgress, GameFlags, and GameBytes — so that every value has a human-readable name you can search for. The primary enum file is include/enums.h, which is included by include/common_structs.h and therefore transitively available everywhere.

Where enums are defined

FileContents
include/enums.hStoryProgress and the majority of gameplay enums
include/saved_flag_names.hGameFlags enum (one bit per game event)
include/saved_byte_names.hGameBytes enum (one byte per tracked value)
include/evt.hEVT opcode enum, EventGroupFlags, EventCommandResults
assets/effects.yamlEffect IDs (generated into C at build time)

StoryProgress

StoryProgress is a signed integer enum stored in GB_StoryProgress (global byte 0x000). It encodes the linear chapter checkpoint that the game uses to determine which scripted events have already occurred. Values run from STORY_INTRO (-128) up through the final chapter.
enum StoryProgress {
    STORY_INTRO                          = -128,
    STORY_CH0_WAKE_UP                    = -127,
    STORY_CH0_MET_INNKEEPER              = -126,
    // ...
    STORY_CH4_SOLVED_COLOR_PUZZLE        = 0,
    STORY_CH4_DEFEATED_LANTERN_GHOST     = 1,
    STORY_CH4_WATT_JOINED_PARTY          = 2,
    // ...
};
The naming convention is STORY_CH<chapter>_<event>. Prologue events use CH0, and the eight main chapters use CH1 through CH8. A few values are labelled STORY_UNUSED_<hex> where the original code reserved a slot but never used it.
ValueConstantMeaning
-128STORY_INTROTitle-screen / intro state
-127STORY_CH0_WAKE_UPMario wakes up at start of game
-115STORY_CH0_GOOMBARIO_JOINED_PARTYGoombario joins
-112STORY_CH0_DEFEATED_GOOMBA_KINGGoomba King defeated
-109STORY_CH0_OPENED_BRIDGE_TO_TOAD_TOWNBridge to Toad Town unlocked
-78STORY_CH1_DEFEATED_KOOPA_BROSKoopa Bros. defeated
-77STORY_CH1_STAR_SPIRIT_RESCUEDEldstar rescued
-56STORY_CH2_DEFEATED_TUTANKOOPATutankoopa defeated
-55STORY_CH2_STAR_SPIRIT_RESCUEDMamar rescued
-16STORY_CH3_DEFEATED_TUBBA_BLUBBATubba Blubba defeated
-15STORY_CH3_STAR_SPIRIT_RESCUEDSkolar rescued
4STORY_CH4_DEFEATED_GENERAL_GUYGeneral Guy defeated
5STORY_CH4_STAR_SPIRIT_RESCUEDMuskular rescued
35STORY_CH5_DEFEATED_LAVA_PIRANHALava Piranha defeated
56STORY_CH6_DEFEATED_HUFF_N_PUFFHuff N. Puff defeated
57STORY_CH6_STAR_SPIRIT_RESCUEDKlevar rescued

GameFlags enum

GameFlags is defined in include/saved_flag_names.h and contains one entry per boolean event flag saved to the save file. Each entry wraps an index with the GameFlag() macro so that the resulting integer value encodes the EVT variable encoding directly.
enum GameFlags {
    GF_StartedChapter1              = GameFlag(0x001),
    GF_StartedChapter2              = GameFlag(0x002),
    // ...
    GF_KMR02_Met_Goombario          = GameFlag(0x024),
    GF_KMR02_Item_ShootingStar      = GameFlag(0x02E),
    GF_TRD10_Defeated_KoopaBros     = GameFlag(0x297),
    GF_KKJ25_Defeated_Bowser        = GameFlag(0x1FD),
    // ...
};

Naming convention

Flag names follow the pattern GF_<area>_<description>:
  • GF_ — prefix identifying a global game flag.
  • <area> — the four-letter map area code where the flag is relevant (e.g. KMR for Koopa Meadows, TRD for Koopa Fortress, KKJ for Bowser’s Castle). Global events without an area use prefixes like EVT or NPC.
  • <description> — a PascalCase description of the event, e.g. Met_Goombario, Defeated_KoopaBros, or Item_ShootingStar.
Entries named GF_Unused_<area>_<hex> were allocated in the original game but never written to.

GameBytes enum

GameBytes is defined in include/saved_byte_names.h. Unlike flags, each entry stores a full byte (0–255) and is accessed with GameByte(). Bytes are used for counters, multi-state values, and anything that needs more than two states.
enum GameBytes {
    GB_StoryProgress                = GameByte(0x000),
    GB_MAC00_DojoRank               = GameByte(0x01C),
    GB_TIK15_RipCheato_PurchaseCount = GameByte(0x038),
    GB_IWA00_Whacka_HitCount        = GameByte(0x07B),
    GB_FinalBowserHP                = GameByte(0x18A),
    // ...
};

Notable bytes

ConstantIndexDescription
GB_StoryProgress0x000Current story checkpoint (maps to StoryProgress values)
GB_MAC00_DojoRank0x01CPlayer’s rank at the Toad Town Dojo
GB_KKJ_LastPartner0x04EMario’s last active partner, stored across Peach missions
GB_IWA00_Whacka_HitCount0x07BNumber of times Whacka has been struck
GB_CompletedQuizzes0x160Count of completed Chuck Quizmo quizzes
GB_FinalBowserHP0x18ABowser’s HP carried between Phase 1 and Phase 2

Finding enum values

Use ripgrep or your editor’s symbol search to look up any constant:
rg "STORY_CH5_REACHED_LAVA_LAVA_ISLAND" include/
rg "GF_TRD10_Defeated_KoopaBros" include/
Because include/enums.h is over 6,000 lines long, searching by name is more practical than scrolling. The saved_flag_names.h and saved_byte_names.h files are smaller and can be browsed directly for save-file state.
When writing EVT scripts, you pass a GameFlag or GameByte value directly as an integer argument. The EVT interpreter decodes the encoded offset at runtime — you do not dereference it yourself.

Build docs developers (and LLMs) love