grunt-lucas / porytiles

Overworld tileset compiler for Pokémon Generation 3 decompilation projects
MIT License
35 stars 3 forks source link

Secondary tileset attributes aren't generated #1

Closed purrfectdoodle closed 8 months ago

purrfectdoodle commented 9 months ago

I'm having trouble with attribute assignment (like, this metatile is tall grass, this one's a puddle, etc). I have a primary and a secondary tileset. On my primary tileset all the metatile attributes work fine, but on the secondary tileset there's a house with a door and I can't for the life of me tell it that the door is indeed a door.

These are the images for the tileset: image

This is Porymap lying to me: image Note that Porymap also sees the whole house as layer type "middle/top", while it should mainly be bottom (grass) / middle (house), shouldn't it? Again, layer type works fine on my primary tileset.

The attribute file contains:

id,behavior
0,MB_PUDDLE // <---- I added this just to see if it'd change the first tile's attribute: it does not, either
35,MB_NON_ANIMATED_DOOR

The command line I'm running is the following (from inside pokeemerald-expansion/tools/porytiles/, which contains the tileset images in the secondary and primary folders):

porytiles compile-secondary -dual-layer -Wall -o ../../data/tilesets/secondary/test-secondary ./secondary ./primary ../../include/constants/metatile_behaviors.h

Am I missing something or is this a bug?

grunt-lucas commented 9 months ago

It's possible it's a bug with Porytiles. Let me investigate further.

grunt-lucas commented 9 months ago

I'm looking at the code and it appears that Porytiles is not outputting metatile_attributes.bin correctly for secondary tilesets. That explains why both the metatile behavior and the layer type is broken for secondary tilesets. I think I know why the code is misbehaving. I will comment here again when I've pushed a fix. I'll get to it soon. Sorry about that.

purrfectdoodle commented 9 months ago

Great! Don't apologize, I discovered romhacking very recently and I'm so stoked this awesome tool exists so I don't have to worry about tilesets! lol

grunt-lucas commented 8 months ago

Fixed by #3.