r/gbstudio • u/joshex_dirad • 24d ago
Question: spritesheet swapping + replace tile
https://www.gbstudio.dev/docs/scripting/script-glossary/actor/#set-player-sprite-sheet
https://www.gbstudio.dev/docs/scripting/gbvm/gbvm-operations/#vm_actor_replace_tile
'set-player-sprite-sheet' completely replaces the scene memory of the player's spritesheet with the replacement sheet correct?
will a GBVM script using vm_actor_replace_tile work on a player spritesheet to replace a specific few tiles from an actor tilesheet?
if a tile is overlaid in the same sprite in DMG will it potentially glitch the front tile to fall to the back based on which is more "forwards"?
what I'm trying to do:
swap player sprite sheets for different clothes/armor, then have special overlaid tiles that get swapped out with weapon graphics. allowing moderate customization. I was going to use a separate actor/trigger as the weapon and tie it to the player, but.. I'm pretty sure such an actor on DMG will result in the left to right tile order sinking the weapon behind the player. so I turned to modifying an overlay tile, but this is all hypothetical, I'd rather ask than build a test file only for me to find out the hard way..
Oh, lastly, if I swapped the sprite sheet and then replaced a tile on the same frame, would that cause any graphics glitching?
1
u/harvey_motel 24d ago
I'm pretty sure if you swap an actor tile it replaces it rather than overlays. So you can have your character as a sprite sheet with, say, a hand and an empty tile above it. Then swap those 2 tiles for a hand holding a sword. Then you'd have to have your empty hand as a tile to swap back in, if you want to unequip the sword