I am using Galv's Jump Ability plugin and I faced an issue. It is cool and all adjusting your jump reach if there is a non-walkable tile in front of you or an event that blocks your path. However, if the tile is the same priority as you and there is an event with below priority that will usually let you walk on top it will still not let you jump on it which tells me that the plugin does not consider such events at all. For example I am able to jump from this bridge to the near shore but not the other way around since the bridge is a placeholder event that appears when you push a rock in the water.
I read the plugin and found out that you should add the additional condition somewhere around here but my understanding for JS is really abysmal at this point and I do not know what I need to do:
I read the plugin and found out that you should add the additional condition somewhere around here but my understanding for JS is really abysmal at this point and I do not know what I need to do:
Code:
Galv.JA.jumpMax = function(dir,dis) {
var m = {x: 0, y:0};
var x = $gamePlayer.x
var y = $gamePlayer.y
switch (dir) {
case 2:
m.y = dis;
for (var i = 0;i < dis;i++) {if (Galv.JA.checkBlock(x, y + i + 1)) m.y = i;};
break;
case 4:
m.x = dis;
for (var i = 0;i < dis;i++) {if (Galv.JA.checkBlock(x - i - 1, y)) m.x = i;};
break;
case 6:
m.x = dis;
for (var i = 0;i < dis;i++) {if (Galv.JA.checkBlock(x + i + 1, y)) m.x = i;};
break;
case 8:
m.y = dis;
for (var i = 0;i < dis;i++) {if (Galv.JA.checkBlock(x, y - i - 1)) m.y = i;};
break;
};
return m;
};
Galv.JA.checkBlock = function(x,y) {
return Galv.JA.regions.contains($gameMap.regionId(x,y)) || Galv.JA.stopperEvent(x,y);
};
Galv.JA.stopperEvent = function(x,y) {
var block = false;
var events = $gameMap.eventsXy(x,y);
for (var i = 0;i <= events.length;i++) {
if (events) {
if (events.page().list[0].code === 108 && events.page().list[0].parameters[0] === "<blockJump>") {
block = true;
break;
};
};
};
return block;
};
Galv.JA.canJump = function(x,y,d) {
return $gameMap.isPassable(x,y,d) && !Galv.JA.eventThere(x,y);
};
Galv.JA.eventThere = function(x,y) {
var events = $gameMap.eventsXyNt(x,y);
if (events.length > 0) return true;
return false;
};