Ok, to use my version of the code you'll need these functions, that are already on my mv3d-QSprite compatibility plugin by the way, they are one to turn the directions depending on the camera angle, the main one you'll use, but also two that first one uses, one get the direction and turn it into angles, then one to get an angle and turn into direction:
JavaScript:
I know, the second and last ones may be overly-complicated... they work fine though.mv3d.transform8DirectionYaw=function(dir,yaw=this.blendCameraYaw.currentValue(),reverse=false){
if(dir==0){ return 0; }
dir = this.numpadToAngle(dir);
const c = yaw;
if(reverse){
dir=(dir-c).mod(360);
}else{
dir=(dir+c).mod(360);
}
return this.angleToNumpad(dir);
}
mv3d.numpadToAngle=function(numpad){
var angle = 0;
switch (numpad) {
case 7: angle++;
case 4: angle++;
case 1: angle++;
case 2: angle++;
case 3: angle++;
case 6: angle++;
case 9: angle++;
default: break;
}
return angle*45;
}
mv3d.angleToNumpad=function(angle){
var numpad = 8;
angle = Math.round(angle/45);
switch (angle) {
case 1:
numpad = 9;
break;
case 2:
numpad = 6;
break;
case 3:
numpad = 3;
break;
case 4:
numpad = 2;
break;
case 5:
numpad = 1;
break;
case 6:
numpad = 4;
break;
case 7:
numpad = 7;
break;
default: break;
}
return numpad;
}These ones are to actually change the controls on QMovement, they overwrite the old ones it uses for that:
JavaScript:
Game_Player.prototype.moveInputHorizontal = function(dir) {
if (mv3d.isDisabled()) this.moveStraight(dir);
else {
if (QMovement.diagonal) {
dir = mv3d.transform8DirectionYaw(dir,mv3d.blendCameraYaw.currentValue(),true);
if ([1, 3, 7, 9].contains(dir)) {
var diag = {
1: [4, 2], 3: [6, 2],
7: [4, 8], 9: [6, 8]
}
this.moveDiagonally(diag[dir][0], diag[dir][1]);
} else this.moveStraight(dir);
} else {
this.moveStraight(mv3d.transformDirectionYaw(dir,mv3d.blendCameraYaw.currentValue(),true));
}
}
};
Game_Player.prototype.moveInputVertical = function(dir) {
if (mv3d.isDisabled()) this.moveStraight(dir);
else {
if (QMovement.diagonal) {
dir = mv3d.transform8DirectionYaw(dir,mv3d.blendCameraYaw.currentValue(),true);
if ([1, 3, 7, 9].contains(dir)) {
var diag = {
1: [4, 2], 3: [6, 2],
7: [4, 8], 9: [6, 8]
}
this.moveDiagonally(diag[dir][0], diag[dir][1]);
} else this.moveStraight(dir);
} else {
this.moveStraight(mv3d.transformDirectionYaw(dir,mv3d.blendCameraYaw.currentValue(),true));
}
}
};
Game_Player.prototype.moveInputDiagonal = function(dir) {
var diag = {
1: [4, 2], 3: [6, 2],
7: [4, 8], 9: [6, 8]
}
if (mv3d.isDisabled()) this.moveDiagonally(diag[dir][0], diag[dir][1]);
else {
dir = mv3d.transform8DirectionYaw(dir,mv3d.blendCameraYaw.currentValue(),true);
if ([1, 3, 7, 9].contains(dir)) this.moveDiagonally(diag[dir][0], diag[dir][1]);
else this.moveStraight(dir);
}
};
Game_Player.prototype.moveWithAnalog = function() {
var horz = Input._dirAxesA.x;
var vert = Input._dirAxesA.y;
if (horz === 0 && vert === 0) return;
var radian = Math.atan2(vert, horz);
radian += radian < 0 ? Math.PI * 2 : 0;
if (!mv3d.isDisabled()) radian = (radian + (mv3d.blendCameraYaw.currentValue()*Math.PI/180)).mod(Math.PI*2);
this.moveRadian(radian);
};If that is really all you want, this is really all you need. save it as a name.js file and put it under both plugins on the plugin manager.

