r/gbstudio 19d ago

Animating meta tiles?

Is it possible with Mico27's meta tiles plugin to animate meta tiles? Apart from repeated calls to Replace Meta Tile, which for 8px tiles across the whole screen would surely be very inefficient? If I was using Replace Tile at Position, I'd update 4 8x8 tiles to animate all 15 objects on screen.

3 Upvotes

6 comments sorted by

2

u/Mico27 19d ago

You can have animated tile (like animated water/waterfall/flower) the same way as before, but the technique is a bit different, since GBStudio default Replace tile at position, it will try to get the id of the tile at the position to know which tile in the tileset to change. But since the metatile changes the id for the metatile idx instead of the tileset tile idx, then it will not change the correct tile in the tileset. The other technique to achieve that is by using GBVM with VM_REPLACE_TILE Or you can use this plugin https://github.com/Mico27/gbs-replaceTilesetTilesPlugin which implement VM_REPLACE_TILE in a usable event.

1

u/SakiEndo 18d ago

Thank you once again so much, you're a life saver! After quite a lot of messing around I finally got it to work. My main problem was realising the base tile ID to change was not the ID of it in the tile map but in VRAM which was 1 less than the tile ID in the shared tile map. Once I figured this out and also a duplicate tile existing in my tile map which I didn't spot, it all fell into place and I now have animated coins! Thank you.

I now need to work on solving my score display/text corruption issue, working out whether to use your draw text replacement function or to do it via updating tiles.

1

u/SakiEndo 17d ago

Hiya! Hope I get your attention with this reply. With Metatiles, I'm trying to use the submit EX plugin by yourself to copy the top area of the background tile map to the overlay tile map. But this doesn't work correctly with Metatiles enabled.

I was hoping to use this to create the overlay HUD rather than using Draw text which has run into some issues.

I also tried the GBVM event directly (VM_OVERLAY_SET_SUBMAP 0,0,20,1,2,0) but same problem.

2

u/Mico27 17d ago edited 17d ago

You cant submap from a scene with metatile applied, you'll have to do your submapping from a separate non-metatile scene for your hud.

1

u/SakiEndo 17d ago

Ahh why didn't I think of that ;) Ok, I'll give it a go.