QPlugins - Latest: QABS

horror_n_oates

Villager
Member
Joined
Apr 25, 2018
Messages
9
Reaction score
2
First Language
English
Primarily Uses
RMMV
Hey, been looking through the posts here and had a question concerning QMovement and diagonal directions.

I've been using QMovement and CollisionMap for a project, but was wondering if I could adjust the diagonal directions from 45 degrees to 22.5 degrees to accommodate certain isometric maps.

Below is an example of the kind of isometric map I was trying to accommodate:
MMBN_iso.png

Main difference from conventional isometric maps is the lower "slope" of the diagonal lines; the movement in the above game also handles diagonal movement on a lower "slope". (Slope like diagonal movement at, instead of a 45 degree angle, a 22.5 degree angle)

Things I tried to replicate this include changing how diagonal directions are defined in QPlus.
Looking through this thread, I found this snippet that I think somewhat does that:

Code:
  Game_CharacterBase.prototype.directionToRadian = function(dir) {
    dir = dir || this._direction;
    if (dir === 2) return Math.PI / 2;
    if (dir === 4) return Math.PI;
    if (dir === 6) return 0;
    if (dir === 8) return Math.PI * 3 / 2;
    if (dir === 1) return Math.PI * 5 / 6;
    if (dir === 3) return Math.PI / 6;
    if (dir === 7) return Math.PI * 7 / 6;
    if (dir === 9) return Math.PI * 5 / 3;
    return 0;
  };

Game_CharacterBase.prototype.radianToDirection = function(radian, useDiag) {
radian = QPlus.adjustRadian(radian);
if (useDiag) {
// use degrees for diagonals
// since I don't know clean PI numbers for these degrees
var deg = radian * 180 / Math.PI;
if (deg >= 22.5 && deg <= 67.5) {
return 3;
} else if (deg >= 112.5 && deg <= 157.5) {
return 1;
} else if (deg >= 202.5 && deg <= 247.5) {
return 7;
} else if (deg >= 292.5 && deg <= 337.5) {
return 9;
}
}
if (radian >= 0 && radian < Math.PI / 4) {
return 6;
} else if (radian >= Math.PI / 4 && radian < 3 * Math.PI / 4) {
return 2;
} else if (radian >= Math.PI * 3 / 4 && radian < Math.PI * 5 / 4) {
return 4;
} else if (radian >= Math.PI * 5 / 4 && radian < Math.PI * 7 / 4) {
return 8;
} else if (radian >= Math.PI * 7 / 4) {
return 6;
}
};
I changed the diagonal radian values in the directionToRadian function accordingly, and also tried changing degree values in the radianToDirection function; both don't seem to help with the intended effect.
Unless I'm misunderstanding that the radian values don't determine to what degree a diagonal direction faces, then I may have to look into how movement is updated next.

I appreciate any thoughts on this and hope this was clear enough.
 

horror_n_oates

Villager
Member
Joined
Apr 25, 2018
Messages
9
Reaction score
2
First Language
English
Primarily Uses
RMMV
No clue exactly on that, but you can cheat by using Ultra Mode 7, setting it to whatever tilt you want the map to be, then selecting the option to adjust movement for that. https://forums.rpgmakerweb.com/index.php?threads/ultra-mode-7.94100/
Thanks for the suggestion, played around with the plugin and achieved a similar look with Yaw and Pitch set to 60 and FOV to 0, but the controls seemed problematic, especially combined with QMovement; I've tried toggling the Player_Adjust_Move_Direction parameter to no effect either, but it's understandable as its the camera being changed rather than the movement orientation. If there was a way to shift controls at this perspective (Yaw, Pitch, and FOV) in way where it makes sense from the player's perspective. Will be keeping my eye on this plugin tho.
cap.PNG

After some digging in QMovement, I'm still unsure if the diagonally move functions are determined by a fixed definition of orthogonal directions (defined in QPlus) or calculated by a squared GridSize, hence the inability to go below or beyond 45 degrees diagonal movement. Previous posts here have also showed evidence of sprite "slipping" with the gamepad, so I'm assuming the 8 directional movement isn't entirely tile-to-tile accurate, at least with the gamepad.
 

horror_n_oates

Villager
Member
Joined
Apr 25, 2018
Messages
9
Reaction score
2
First Language
English
Primarily Uses
RMMV
So after parsing through QMovement's code for a bit, I found a use-able solution for implementing different degrees (in this case, 22.5 degrees) of orthogonal movement.

Below is what I was able to achieve, sprites and images are all placeholders for testing.
gif.gif

The following block can be found in the moveDiagonally function. The line to be changed is 2633.
Code:
if (this.isMovementSucceeded()) {
      this._forwardRadian = this.directionToRadian(this.direction8(horz, vert));
      this._adjustFrameSpeed = false;
      this._px = $gameMap.roundPXWithDirection(this._px, horz, dist+3);        // line 2633, add a "+3" or a "*2" to the "dist" parameter
      this._py = $gameMap.roundPYWithDirection(this._py, vert, dist);
      this._realPX = $gameMap.pxWithDirection(this._px, this.reverseDir(horz), dist);
      this._realPY = $gameMap.pyWithDirection(this._py, this.reverseDir(vert), dist);
      this.increaseSteps();
    } else {
      this.checkEventTriggerTouchFront(this.direction8(horz, vert));
    }
So by looking into how the diagonal movement is being updated rather than how direction is defined, I found a few common parameters and deduced that X and Y were constantly being updated at the same rate. Considering how diagonals are drawn in the original example, with 2 pixels moving across and 1 pixel moving up/down, I thought perhaps if the player's X was incremented with a higher value than the Y, a more lateral movement could be achieved. Visually, it seems to work, so long as small values are used (other values would make the player extremely slow or fly off the map).

The 2 values that prove effective on applying to the "dist" parameter for it's X operation are "+3" and "*2"
There does not seem to be anything problematic by applying this small change, but going forward I'll keep an eye out.
 
Last edited:

Scheikowski

Villager
Member
Joined
Apr 11, 2018
Messages
13
Reaction score
1
First Language
Turkish
Primarily Uses
RMMV
It looks like this one is useful.

Code:
if (this.isMovementSucceeded()) {
      this._forwardRadian = this.directionToRadian(this.direction8(horz, vert));
      this._adjustFrameSpeed = false;
      this._px = $gameMap.roundPXWithDirection(this._px, horz, dist+1.4);
      this._py = $gameMap.roundPYWithDirection(this._py, vert, dist);
      this._realPX = $gameMap.pxWithDirection(this._px, this.reverseDir(horz), dist+0.1);
      this._realPY = $gameMap.pyWithDirection(this._py, this.reverseDir(vert), dist+0.1);
      this.increaseSteps();
    } else {
      this.checkEventTriggerTouchFront(this.direction8(horz, vert));
    }
 
Joined
May 5, 2020
Messages
1
Reaction score
0
First Language
Russian
Primarily Uses
RMMV
Hello
I want to change player/event collider during the game, but when I use the qmovement plugin command - nothing is change (I tried different variations) , so i hope you can help me, please!
What could have gone wrong?
It works if i use notetags, but i need these plugin commands!
 

Attachments

nintendowii111

Villager
Member
Joined
Oct 12, 2019
Messages
29
Reaction score
2
First Language
English
Primarily Uses
RMMV
I can't get YEP_regionevents to work with QMovement. I'm trying to make foot sound effects by calling a common event when player enters a region id but it simply doesnt recognize that its in a region. Any help is greatly appreciated!
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,599
Reaction score
391
First Language
Portuguese
Primarily Uses
RMMV
@nintendowii111 that is weird, I remember I did use them together once in an old project. Not for footsteps though.
Did you try changing the plugin order?
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,599
Reaction score
391
First Language
Portuguese
Primarily Uses
RMMV
Did you try something else, like changing a switch? Also, is your linked event player or event touch? does it work only on first step in the region or not at all?
In my project combining them, I had two regions, one to turn a switch on and the other by its side to turn it off, each event having the condition of the switch being... well, the opposite it turns it into (well, the one for the switch on has ). Not sure if it would repeat at each tile, even if without QMovement...

Oh wait, checking on my old project.. they were on autorun? I... am not sure if that is needed, but it worked I guess.
And QMovement is bellow the Yanfly Region Trigger.
 

nintendowii111

Villager
Member
Joined
Oct 12, 2019
Messages
29
Reaction score
2
First Language
English
Primarily Uses
RMMV
Did you try something else, like changing a switch? Also, is your linked event player or event touch? does it work only on first step in the region or not at all?
In my project combining them, I had two regions, one to turn a switch on and the other by its side to turn it off, each event having the condition of the switch being... well, the opposite it turns it into (well, the one for the switch on has ). Not sure if it would repeat at each tile, even if without QMovement...

Oh wait, checking on my old project.. they were on autorun? I... am not sure if that is needed, but it worked I guess.
And QMovement is bellow the Yanfly Region Trigger.
I gave up on YEP Region Trigger and tried using Ryusa_FootstepSE. Same issue, nothing happens at all. That plugin also uses Region ID's and also getting no sound. Tried moving it above/below Q plugins and still no luck. Any suggestions? Could you try Using Q plugins with Ryusa_FootstepSE plugin and see could be the problem. Thanks for any help!
 
Joined
Feb 18, 2015
Messages
506
Reaction score
243
First Language
English
Primarily Uses
RMMV
If memory serves, somewhere else here in this thread someone shared a possible way to do footstep sounds with QMovement.
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,599
Reaction score
391
First Language
Portuguese
Primarily Uses
RMMV
was it me?
I remember I once editted... I think it was yanfly's footsteps plugin, to play the next step only after the previous ends instead of every move.
 
Joined
Feb 18, 2015
Messages
506
Reaction score
243
First Language
English
Primarily Uses
RMMV
I went searching through the thread, and here is the post I was talking about:
It seems like it'd take a lot of work and tweaking. I haven't really tried it myself, I haven't toyed with footstep sounds in a long while.
 

nintendowii111

Villager
Member
Joined
Oct 12, 2019
Messages
29
Reaction score
2
First Language
English
Primarily Uses
RMMV
I went searching through the thread, and here is the post I was talking about:
It seems like it'd take a lot of work and tweaking. I haven't really tried it myself, I haven't toyed with footstep sounds in a long while.
Appreciate the reply, I actually figured it out ;)
 

PresaDePrata

Veteran
Veteran
Joined
Dec 4, 2014
Messages
90
Reaction score
18
First Language
Portuguese
Primarily Uses
RMMV
I'd GREATLY appreciate help with making a simple enemy that shoots only in 1 direction. I'm making a dungeon and want fireballs shot in a single direction. I tried turning the AI off but that causes the event to do NOTHING at all. Please help ;)
I don't know if it works with QPlugins, but try Galv's Map Projectiles. I did the exact same thing you want. I also did with events and a move route, but galv's felt way more fluid.


I can't get YEP_regionevents to work with QMovement. I'm trying to make foot sound effects by calling a common event when player enters a region id but it simply doesnt recognize that its in a region. Any help is greatly appreciated!
It still work, just tested five minutes ago. You have to put region events below all Quxios plugins. The only problem i've found is the region collision box gets halved, so you should use QM Region Colliders to set it to it's normal collision size.
 
Last edited:
Joined
May 7, 2020
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
It looks like this one is useful.

Code:
if (this.isMovementSucceeded()) {
      this._forwardRadian = this.directionToRadian(this.direction8(horz, vert));
      this._adjustFrameSpeed = false;
      this._px = $gameMap.roundPXWithDirection(this._px, horz, dist+1.4);
      this._py = $gameMap.roundPYWithDirection(this._py, vert, dist);
      this._realPX = $gameMap.pxWithDirection(this._px, this.reverseDir(horz), dist+0.1);
      this._realPY = $gameMap.pyWithDirection(this._py, this.reverseDir(vert), dist+0.1);
      this.increaseSteps();
    } else {
      this.checkEventTriggerTouchFront(this.direction8(horz, vert));
    }
I am also trying to build an isometric game. But when I try to change this line and test my game I get this error --->"QMovement requires QPlus 1.6.0 or newer to work." Bear in mind I know very little about coding but I did use Sublime Text 3 to open, edit and save. I restored the original js file and all is working again but I would love to be able to implement this change. What am I doing wrong?
 

Scheikowski

Villager
Member
Joined
Apr 11, 2018
Messages
13
Reaction score
1
First Language
Turkish
Primarily Uses
RMMV
I am also trying to build an isometric game. But when I try to change this line and test my game I get this error --->"QMovement requires QPlus 1.6.0 or newer to work." Bear in mind I know very little about coding but I did use Sublime Text 3 to open, edit and save. I restored the original js file and all is working again but I would love to be able to implement this change. What am I doing wrong?
What is the version of your "QPlus" plugin. You can downlad 1.7.1 from Quasi's website. Put it above QMovement plugin.
 
Joined
May 7, 2020
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
What is the version of your "QPlus" plugin. You can downlad 1.7.1 from Quasi's website. Put it above QMovement plugin.
I've been using QPlus ver 1.7.1 and it is above all other Q plugins as recommended. QMovement was working fine until I changed that one line of code in it. Once I replaced the js file with the original it is functioning again.
 

Yilou

Villager
Member
Joined
Apr 3, 2020
Messages
13
Reaction score
1
First Language
Russian
Primarily Uses
RMMV
Maybe someone knows what the problem is?
I use the gavl charactersframe and the QMovement plugin and I can't achieve smooth animation (event).

Event moves higher
The player moves below and has no problems with smoothness.
I also have to make movements with the "Stepping" daw, otherwise the animation is displayed even worse.

When I turn off QMovement there’s no problem. Are these plugins not compatible? :(
 

Attachments

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

Latest Threads

Latest Posts

Latest Profile Posts

Everytime I need to write dialogues I find myself writing new music pieces... what kind of trick is this?!
Me Being Dumb spending hrs trying to figure out Irenas Visual Novel busts plugin..lol. I'm probably missing something stupid and obvious xDD

let the journey begin >w>
X.X ok... I guess I'll just have to think about 48x48 a little differently. Its not "room for more work"..."its room for more detail!...yay"
Alexa, play Buck-Tick - Dress
Worst part about doing a plugin based on an existing system: figuring out the best way for developers to set up the data.

Forum statistics

Threads
99,218
Messages
963,150
Members
130,805
Latest member
kraufen
Top