RMMZ Where in the game code is the player's Y offset?

Status
Not open for further replies.

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
3,729
Reaction score
4,682
First Language
English
Primarily Uses
RMMZ
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!
 

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,695
Reaction score
1,113
First Language
Portuguese - Br
Primarily Uses
RMMZ
Hi there!
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.
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
3,729
Reaction score
4,682
First Language
English
Primarily Uses
RMMZ
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.

 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,585
Latest member
Reversinator
Top