zerobeat032

Oh, it's that Zerobeat kid...
Veteran
Joined
Mar 28, 2014
Messages
415
Reaction score
796
First Language
English
Primarily Uses
RMMV
So I have characters that never face up or down. Up turns them left and down turns them right. to somewhat simulate a beat 'em up or something like it. problem comes in when I make certain movements and the character will turn the opposite direction while moving thanks to diagonal movement. basically they'll look like they're running backwards.

BUT... this plugin https://forums.rpgmakerweb.com/inde...ection-horizontal-vertical.68417/#post-717344 fixes that issue. but now there's another problem. I have a jumping mechanic where the player can jump up and down from platform to platform... except up and down don't work as normal.

basically all I want is the character's graphic to work like it does with this plugin, but still be able to use up or down when jumping. like before using the plugin, I could jump down to the lower platform. though it's odd because I can still "move" in all directions. but I can't hold up/down and jump up/down anymore.

snipping tool.PNG

the plugin itself seems really simple looking at it, but I dunno what the fix I'm needing is. but now I can only jump left or right and not up or down. if anyone know's a fix, I'd be grateful. or should I just event something like this since everything else works?
 

JorgeMaker

Veteran
Veteran
Joined
Jan 14, 2020
Messages
57
Reaction score
51
First Language
Português - BR
Primarily Uses
RMMZ
JavaScript:
(() => {

  var alias_Game_CharacterBase_jump = Game_CharacterBase.prototype.jump;
  Game_CharacterBase.prototype.jump = function(xPlus, yPlus) {
    this._jumpCount = 1;
    alias_Game_CharacterBase_jump.call(this, ...arguments);
  };

  var alias_Game_CharacterBase_setDirection = Game_CharacterBase.prototype.setDirection;
  Game_CharacterBase.prototype.setDirection = function(d) {
    if (Math.abs(d - 5) === 1 || this._jumpCount > 0) {
      alias_Game_CharacterBase_setDirection.call(this, ...arguments);
    }
  };

})();
 

zerobeat032

Oh, it's that Zerobeat kid...
Veteran
Joined
Mar 28, 2014
Messages
415
Reaction score
796
First Language
English
Primarily Uses
RMMV
hmm I saved this as a js file and put it in my game, but I'm not noticing any change. I feel I probably did something wrong on my end with that one though.
 

JorgeMaker

Veteran
Veteran
Joined
Jan 14, 2020
Messages
57
Reaction score
51
First Language
Português - BR
Primarily Uses
RMMZ
GgfR0um.gif

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

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

/*:
 * @plugindesc Characters will only show their horizontal directions, except when jumping.
 * @author The Dragon (Jorge Feitosa) - http://dragonrefuge.net
 * @help This plugin does not provide plugin commands.
 */

(($) => {

  $.state = true;

  var alias_Game_CharacterBase_jump = Game_CharacterBase.prototype.jump;
  Game_CharacterBase.prototype.jump = function(xPlus, yPlus) {
    this._jumpCount = 1;
    this.__preJumpDirection = this._direction;
    alias_Game_CharacterBase_jump.call(this, ...arguments);
  };

  var alias_Game_CharacterBase_updateJump = Game_CharacterBase.prototype.updateJump;
  Game_CharacterBase.prototype.updateJump = function() {
    alias_Game_CharacterBase_updateJump.call(this, ...arguments);
    if ($.state && this.__preJumpDirection && this._jumpCount === 0 && Math.abs(this._direction - 5) === 3) {
      this._direction = this.__preJumpDirection;
    }
  };

  var alias_Game_CharacterBase_setDirection = Game_CharacterBase.prototype.setDirection;
  Game_CharacterBase.prototype.setDirection = function(d) {
    if ($.state && Math.abs(d - 5) === 3 && this._jumpCount === 0) {
      return;
    }
    alias_Game_CharacterBase_setDirection.call(this, ...arguments);
  };

})(Dragon.FixedHorzDirection);
 

Attachments

  • DragonMV_FixedHorzDirection.js
    1.6 KB · Views: 1

zerobeat032

Oh, it's that Zerobeat kid...
Veteran
Joined
Mar 28, 2014
Messages
415
Reaction score
796
First Language
English
Primarily Uses
RMMV
I feel like this should be working, especially seeing the picture above, but it isn't. I'm wondering if it's because of the plugin I'm using for jumping. because I've turned off anything else that could be altering things. the directional part works, but I still can't jump up or down. I don't know if Yanfly's Smart Jump plugin is calling jumps in a weird way or what. how are you using jump in your instance above?
 

JorgeMaker

Veteran
Veteran
Joined
Jan 14, 2020
Messages
57
Reaction score
51
First Language
Português - BR
Primarily Uses
RMMZ
Must be Yanfly's plugin causing incompatibilities. But I believe that due to the licensing of its plugins, I won't be able to help much.
Try changing the order of the plugins.
 

zerobeat032

Oh, it's that Zerobeat kid...
Veteran
Joined
Mar 28, 2014
Messages
415
Reaction score
796
First Language
English
Primarily Uses
RMMV
I did and I even tried a different jump plugin and I'm getting the same results. this other jump plugin cued me in on something though. it plays a cancel sound when you can't jump. and whenever I tried jumping up or down, it'd play the cancel sound regardless of whether I could actually make a jump within said space. but it didn't when I went left or right and it'd let me jump. so I'm not really sure what's going on. I turned off all my plugins except a jump one and yours. also moved them around too to no avail.

still though, I appreciate the assistance so far. I'm just not sure why it isn't working.
 

Latest Threads

Latest Profile Posts

One uncomfortable truth that has withstood the test of time, is how most people will stand by while they see a crime happening, unless it's illegal to stand by. We probably wouldn't have stories about "special heroes" or games about heroes if the "everyday common folk" were largely capable of being heroes. Heroes face dangers that most people are not willing to.
I'm having toooo much fun designing the new MP (Mental Psyche) system. I've only worked it out for enemies so far, but it's fun to stun them, then go after their MP and delete them instead to farm for better item drops.
anyone know of a place I can promote my game? sorta like game awards but for indie devs, like a place where I can drop a trailer and like stir up some hype
Doing RPG Maker News for 17th October 2021

That moment when you came up with a very good game title, but when you searched it, it has already been used... T.T

Forum statistics

Threads
115,882
Messages
1,093,689
Members
151,125
Latest member
krawm
Top