It seems that events without an "!" in front of their filename seem to have an y offset on the map. It's just a couple of pixels, but it's enough to give some weird results when the tip of the head of a character is slightly cut off because the tile just above the character has an overlay tile. So I'm just trying to find in the code where the y offset is coded. I've looked quickly in Spriteset_Map, Sprite_Character, Game_Player, Scene_Map, Game_Event but haven't found anything useful. Does anyone know where it is? Thanks!
MZ Where in the game code is the player's Y offset?
Javascript/Plugin SupportHi there!
I believe it's here.
If the character is an object character, it's shiftY.
I believe it's here.
JavaScript:
// Check if the filename contains "!"
ImageManager.isObjectCharacter = function(filename) {
const sign = filename.match(/^[!$]+/);
return sign && sign[0].includes("!");
};
// If yes, it shifts.
Game_CharacterBase.prototype.shiftY = function() {
return this.isObjectCharacter() ? 0 : 6;
};
If the character is an object character, it's shiftY.
Thanks! It's working perfectly! I should have thought to look in Game_CharacterBase lol.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/where-in-the-game-code-is-the-players-y-offset.128712/