Author Topic: NPC Palettes  (Read 1561 times)

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
NPC Palettes
« on: September 01, 2008, 11:41:55 AM »
Does anyone know how the NPC palette byte (the 6th byte in the location properties data) works? I can't quite figure it out. I know that that byte determines the palettes available for a location map, and from there each NPC can load one of four palettes. The problem is, I don't know how that byte determines which four palettes. So far, I've discovered the bottom four bits increment the palette count by 2. It's the top four bits I can't figure out. I'll keep working on it, but if someone already knows, please share.

Phoenix

  • FF4 Hacker
  • *
  • Posts: 456
    • View Profile
    • Phoenix Hacks
Re: NPC Palettes
« Reply #1 on: September 01, 2008, 12:06:34 PM »
Nevermind, I figured it out. Just needed to think about it a little more. The bottom 4 bits determine the first and second palettes available, and the top 4 bits determine the third and fourth palettes available. All of the palettes start at 1, and each step up in bits adds 2 to that.

So for example, at the town of Baron the NPC palette byte is 10. This means the bottom four bytes are 0000, so the first and second palettes available are palettes 1 and 2. The top four bytes are 0001, so the third and fourth palettes available are palettes (1+2) and (2+2) = 3 and 4. In the Village Mist, the top four bits are 1001, so the third and fourth palettes are (1+9*2) and (2+9*2) = 19 and 20.