Status
Not open for further replies.

zerobeat032

Oh, it's that Zerobeat kid...
Veteran
Joined
Mar 28, 2014
Messages
416
Reaction score
808
First Language
English
Primarily Uses
RMMV
So I have a problem of my character clipping thru events when they jump in front of them. I'm not sure how to make it so the player keeps priority when jumping in front of events.

Jump event.PNG

as you can see, the shadow of the character is visible but you can't see the player as they've clipped behind the event.
this only seems to happen though when the player jumps. is there anyway for the player to stay in front of event's priority wise when in a situation like this?
 

AeroFunk80

Veteran
Veteran
Joined
Aug 25, 2016
Messages
168
Reaction score
47
First Language
English
Primarily Uses
RMMV
What is your event's Priority set to? It isn't "Above characters," is it? If you set it to "Same As Character" or "Below," the player shouldn't go underneath the event. I'm guessing you need to set it to Same As Character so your player doesn't walk over it.

1632175018922.png
 

zerobeat032

Oh, it's that Zerobeat kid...
Veteran
Joined
Mar 28, 2014
Messages
416
Reaction score
808
First Language
English
Primarily Uses
RMMV
it's set to same as character. I've noticed it doesn't cilp through the base of the event, meaning the very bottom of it. the higher I go up though the more likely I'll clip through the top of the event though.
 

AeroFunk80

Veteran
Veteran
Joined
Aug 25, 2016
Messages
168
Reaction score
47
First Language
English
Primarily Uses
RMMV
The image for your event. Is it from your tileset with an invisible event on top of it? Or is the image set from within the event?

If the image is from your tileset and the event is same as character with no image... check your tileset icon to make sure it's passage isn't set to "above" (the star icon).
 

zerobeat032

Oh, it's that Zerobeat kid...
Veteran
Joined
Mar 28, 2014
Messages
416
Reaction score
808
First Language
English
Primarily Uses
RMMV
It's an image set from within the event. I've noticed no matter the size, the player clips through the top of the image when jumping. so even events the same size of the player, it happens. I'm not sure if the game is registering how big my event image is.
 

JorgeMaker

Veteran
Veteran
Joined
Jan 14, 2020
Messages
57
Reaction score
52
First Language
Português - BR
Primarily Uses
RMMZ
If I understand your problem correctly, this should fix:

JavaScript:
//=============================================================================
// ** RPG Maker MV - DragonMV_FixJumpDisplay.js
//=============================================================================

var Dragon                      = Dragon                  || {};
Dragon.Fixs                     = Dragon.Fixs             || {};
Dragon.Fixs.JumpDisplay         = Dragon.Fixs.JumpDisplay || {};
Dragon.Fixs.JumpDisplay.VERSION = [1, 0, 0];

/*:
 * @plugindesc [RPG Maker MV] - Correction of character sprites display when jumping. (v.1.0.0)
 * @help http://dragonrefuge.net
 * @author The Dragon (Jorge Feitosa)
 */

//-----------------------------------------------------------------------------
// Game_CharacterBase
//
// The superclass of Game_Character. It handles basic information, such as
// coordinates and images, shared by all characters.

Game_CharacterBase.prototype.jumpHeight = function() {
    if (this.isJumping()) {
        return (this._jumpPeak * this._jumpPeak - Math.pow(this._jumpCount - this._jumpPeak, 2)) / 2;
    } else {
        return 0;
    }
};

//-----------------------------------------------------------------------------
// Tilemap
//
// The tilemap which displays 2D tile-based game map.

Tilemap.prototype._compareChildOrder = function(a, b) {
    if (a.z !== b.z) return a.z - b.z;
    var
    aY = a.y + (a._character ? a._character.jumpHeight() : 0),
    bY = b.y + (b._character ? b._character.jumpHeight() : 0);
    if (aY !== bY) return aY - bY;
    return a.spriteId - b.spriteId;
};
 

zerobeat032

Oh, it's that Zerobeat kid...
Veteran
Joined
Mar 28, 2014
Messages
416
Reaction score
808
First Language
English
Primarily Uses
RMMV
If I understand your problem correctly, this should fix:

JavaScript:
//=============================================================================
// ** RPG Maker MV - DragonMV_FixJumpDisplay.js
//=============================================================================

var Dragon                      = Dragon                  || {};
Dragon.Fixs                     = Dragon.Fixs             || {};
Dragon.Fixs.JumpDisplay         = Dragon.Fixs.JumpDisplay || {};
Dragon.Fixs.JumpDisplay.VERSION = [1, 0, 0];

/*:
 * @plugindesc [RPG Maker MV] - Correction of character sprites display when jumping. (v.1.0.0)
 * @help http://dragonrefuge.net
 * @author The Dragon (Jorge Feitosa)
 */

//-----------------------------------------------------------------------------
// Game_CharacterBase
//
// The superclass of Game_Character. It handles basic information, such as
// coordinates and images, shared by all characters.

Game_CharacterBase.prototype.jumpHeight = function() {
    if (this.isJumping()) {
        return (this._jumpPeak * this._jumpPeak - Math.pow(this._jumpCount - this._jumpPeak, 2)) / 2;
    } else {
        return 0;
    }
};

//-----------------------------------------------------------------------------
// Tilemap
//
// The tilemap which displays 2D tile-based game map.

Tilemap.prototype._compareChildOrder = function(a, b) {
    if (a.z !== b.z) return a.z - b.z;
    var
    aY = a.y + (a._character ? a._character.jumpHeight() : 0),
    bY = b.y + (b._character ? b._character.jumpHeight() : 0);
    if (aY !== bY) return aY - bY;
    return a.spriteId - b.spriteId;
};
Ahh thanks! this works perfectly. my character can now jump in front of events without clipping through the top of them. much appreciated. I'm curious though if you don't mind me asking, what exactly does this do? like what is it changing? It's mostly me asking because I'm wondering why it clips in the first place.
 

JorgeMaker

Veteran
Veteran
Joined
Jan 14, 2020
Messages
57
Reaction score
52
First Language
Português - BR
Primarily Uses
RMMZ
By default, characters are sorted by their Y position on the screen, that is, the higher the Y position, the higher the character's priority.
When the player jumped behind the event, he would naturally appear from behind because of his Y position, which at that moment would be smaller than that of the other entity.
What I did was just also consider the jump height in the ordering: char.y + char.jumpHeight.
 

zerobeat032

Oh, it's that Zerobeat kid...
Veteran
Joined
Mar 28, 2014
Messages
416
Reaction score
808
First Language
English
Primarily Uses
RMMV
ahh ok, I see what you saying. I never thought about that. thanks again though.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
16,156
Reaction score
8,939
First Language
English
Primarily Uses
RMMV

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.

Latest Threads

Latest Posts

Latest Profile Posts

Haven't been on here actively in awhile, project is going strong my biggest issue is the STORY, i'm refining the plot and learning so much i decided to take a writers class to improve even more but the programming and functionality of the game is stepping up nicely!
Hi everyone! Here's what I'm working on today! It's one of the dorms on campus. I know I said I wouldn't use assets but I reused a few things from the cafeteria hehe.
FCuxBOMXMAICK5e
I added a little squish effect when characters change direction to try and make things a bit more lively. Though it's a bit hard to see on the fast moving guys.
2f4fiuy.gif
I just discovered this game exists; the premise itself is ****ing hilarious. https://www.humblebundle.com/store/kill-it-with-fire
Can't wait for next update! :)

Forum statistics

Threads
116,123
Messages
1,095,949
Members
151,531
Latest member
brax06
Top