Disabling Pikmin

From Pikmin Technical Knowledge Base
Revision as of 23:25, 29 July 2024 by Noodl (talk | contribs) (Disable behaviour)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


In the bytes of a CavePortal's PortalTrigger there is a 4-byte integer called disablePikminFlags. This number looks random but can be broken down.

It is a little endian binary bit string. Taking the number as an example:

0000 0010 1111 1110

We will be looking at the number as if it was reversed, so "index 0" is actually the last number. Each number in the string represents which pikmin type is disabled. The pikmin order can be obtained from DT_PikminProperty in the Core/ folder. It is basically this with bean at 8, and ninjin, undef and DrkMinion between photon and notset.

{
    0: "PikminRed",
    1: "PikminBlue",
    2: "PikminYellow",
    3: "PikminRock",
    4: "PikminWing",
    5: "PikminPurple",
    6: "PikminWhite",
    7: "PikminIce",
    9: "PikminPhoton",
    16: "Not set (PongashiColor only)"
}

By matching the above enum to the number, we can see that only index 0 is a 0, with the rest being 1. This means that red pikmin are the only ones enabled (and bean I guess). If you also wanted to enable yellow, you'd flip index 3 to a 0 too. After index 9 for photon, it doesn't really matter. By converting this uint16 back to decimal you would get 766 which is what gets encoded to 254, 2, 0, 0 in the AGL (which you can see for Area010's stovetop cave where this is used).

Some notes on disable behaviour:

  • Disable flags can be applied to in-cave entrances (DownPortals) where they will just magic-away the disabled types. Haven't tested if they get saved to the onion, I presume they do like a regular overworld pikmin selection would.
  • By changing the in-cave portal's to the overworld MadoriRuins you can get the sublevel selection screen and pikmin selector with the disable flags applied, so you can redistribute and reset your squad between floors.