Galv's Diagonal Movement

Crashic

Villager
Member
Joined
Nov 10, 2014
Messages
19
Reaction score
6
Primarily Uses
Hey. I wanted to try the plugin. On your site does not work :(
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,306
Reaction score
1,575
First Language
English
Primarily Uses
RMMZ
What doesn't work? Please try again it could have been temporarily down.
 

Valancourt

Villager
Member
Joined
Aug 11, 2013
Messages
25
Reaction score
2
First Language
English
Primarily Uses
Hey Galv, 


Does this plugin allow the game to draw actual diagonal sprites? I have some diagonal sprites but have yet to find a means of getting the game to draw them. I am using RPG Maker MV.


These are my 4-directional sprites:


pic2.png


And my diagonals:


pic3.png


I tried making a sprite sheet showing both:


pic4.png


But when i tried to use them in-game, I got this:


pic6.png


What do i need to do to get the game to draw the diagonal sprites?


Thanks.
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,306
Reaction score
1,575
First Language
English
Primarily Uses
RMMZ
Have a read of the plugin help documentation and also download the demo to see the layout of the charactersheet that is required to use diagonal sprites
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,100
Reaction score
13,705
First Language
English
Primarily Uses
RMMV
@Galv found a small bug with this plugin.


If you have a move route that ends with a diagonal movement followed by a 'turn up/down/left/right', the character's _direction is set correctly to face up/down/left/right, but the sprite remains facing in the diagonal direction because _diagDir is still set to true.


You alias Game_CharacterBase.moveStraight to set _diagDir to false, but you also need to alias Game_CharacterBase.setDirection to update _diagDir according to the new direction.  I just did this._diagDir = (d % 2 === 1); and it seems to fix the problem.  If this isn't right, please let me know (tag me) what the correct solution should be and I'll update my file.
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,306
Reaction score
1,575
First Language
English
Primarily Uses
RMMZ
@Shaz Thanks for letting me know about the bug.


Definitely something I missed in testing. Aliasing Game_CharacterBase.prototype.setDirection like that has been unsuccessful in my quick tests but I have added this to my to-do list to try and solve when I get some time.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,100
Reaction score
13,705
First Language
English
Primarily Uses
RMMV
This is what I did:


var Galv_Game_CharacterBase_setDirection = Game_CharacterBase.prototype.setDirection;
Game_CharacterBase.prototype.setDirection = function(d) {
this._diagDir = (d % 2 === 1);
Galv_Game_CharacterBase_setDirection.call(this,d);
};




but I notice your current version of moveStraight has an extra command in it that's not in the version I'm looking at (2015-12-12 version 1.0) so maybe what I've got above isn't as complete as it should be.
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,306
Reaction score
1,575
First Language
English
Primarily Uses
RMMZ
@Shaz Sounds like it might be with my latest version.


Adding to the latest version appears to cause issues in the demo project. Moving player 'down left' for example using move route does not use diagonal charset. Also for some reason using custom autonomous movement for events walking in diagonals do not use diagonal charset for down-left or up-right. I believe it is another issue with my plugin as your code is fine.


I have a busy schedule in the next few days but after it I will jump in to discover what I am doing wrong and fix it as soon as I can :)


EDIT: Updated to v.1.3 - @Shaz please let me know if there is any issues. Thanks
 
Last edited by a moderator:

Shayde

Warper
Member
Joined
Dec 29, 2016
Messages
1
Reaction score
0
First Language
English
Primarily Uses
@Galv 


Hi there! I'm confused about two things with the functionality of your plug in.


*I'm using the template in your demo.


First, while moving in game all eight directional animations are showing fine (all the green arrows on your demo template) but the idle and run images aren't appearing in the animations while I'm running or idle. The arrows remain green.


My second issue is that the animations seem to carry out before the character stops, so a lag is created  so that my character keeps moving for a moment after i take my finger off the arrow keys. this problem doesn't occur with the mouse however.


I hope you can help me out! Really appreciate your work  :D
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,306
Reaction score
1,575
First Language
English
Primarily Uses
RMMZ
Does this happen in for you in the plugin demo?
 

spolen

Villager
Member
Joined
Jan 21, 2016
Messages
12
Reaction score
2
First Language
English
Primarily Uses
Thanks, this is working well for me so far, now I just need to get good diagonal characters.



 I've added you to my credits as "Galv - Scripting" let me know if you prefer a different way.
 

Oni Giri

Villager
Member
Joined
Feb 5, 2017
Messages
18
Reaction score
5
First Language
German
Primarily Uses
RMMV
Hi @Galv,
thanks for your plugin! It works great for the normal character size :]

Currently I'm not sure:
Is it possible to use your plugin with tall chracters, too?

Thanks for your time!
OniGiri
 
Last edited:

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,306
Reaction score
1,575
First Language
English
Primarily Uses
RMMZ
Yes, you can have any size characters in a charactersheet. They are not limited to what size they can be, you will just have to increase the size of the characters file accordingly.
 

Oni Giri

Villager
Member
Joined
Feb 5, 2017
Messages
18
Reaction score
5
First Language
German
Primarily Uses
RMMV
Hi @Galv.
thank you sooo much for your reply! I got it, now - I really had a mistake in the size of the character. I haven't seen this before - but now it is totally clear :]

Work's perfect!

OniGiri
 

Skurge

" (GASP) What's going on!? "
Veteran
Joined
Jul 12, 2015
Messages
1,197
Reaction score
274
First Language
English
Primarily Uses
N/A
Hello, I'm wishing to give my NPC's diagonal movement.

Basically the NPC's walk in there designated regions and follow a random movement command on them, However I want to include them the ability to move diagonally to help lessen pathway clutter. How can I accomplish this?
 

Xemnoraq

Warper
Member
Joined
Dec 9, 2018
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
@Oni Giri so the taller characters worked for you? With diagonal movement and diagonal sprites? I've been having SO many issues trying to get it to work how did you do it?
 

AlterEvo

CuBott Project
Member
Joined
Jul 23, 2018
Messages
7
Reaction score
8
First Language
Spanish
Primarily Uses
RM2k3
I used a combination of your 3 plugins (diagonal movement, character frames, and charset animations) and is amazing. However I think is easiest if you just share in your web and/or forum the image you have in the demo:



So here you explained so well, and also the name of the file is also self-explanatory (Template%(6).png).
The only thing missing is the for column, the one you are using with the text and the color code, that will be used in jump animations.

Anyway, I was able to set up a 15 frame animation for every idle, walking, diagonal idle and diagonal walking set and it runs smoothly.

Thanks for the hard job, man.
 

Journey_Sticks

Builder of Stuff
Veteran
Joined
Jan 26, 2020
Messages
65
Reaction score
67
First Language
English
Primarily Uses
RMMV

Diagonal Movement - Version 1.3
RPG Maker MV Plugin
Galv



Introduction
I know there are other diagonal movement plugins, but here's another one.


Screenshot


Spoiler






Features
Quite simple - enables player to move diagonally.
- Optional diagonal mouse movement
- Optionally use diagonal charset


How to Use
- Copy the "GALV_DiagonalMovement.js" file into your project's /js/plugins/ folder.
- Activate plugin using the 'Plugin Manager'
- Read the help file to see how it works. Examine the demo if you don't understand.


Plugin
Get it here


Credit and Thanks
- Galv


Terms
Free to use in any RPG Maker MV project including commercial. Please credit "Galv". :)


Updates


2016-08-27 - Version 1.3 - fixed issue with charset facing in a move route when turning after moving a diagonal


2016-05-17 - Version 1.2 - added ability to disable diagonal movement and option to disallow walking diagonally past any impassable tiles.


2016-02-04 - Version 1.1 - added ability to slow movement speed


2015-12-12 - Version 1.0 - Release
!Robot_10%(3).png!Robot_10%(3).png
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,354
Reaction score
8,536
First Language
English
Primarily Uses
RMMV
@Journey_Sticks Can you please tell us more about this character sheet? Is it one you made or did you find it somewhere? Are you posting it for help or to share with others?
 

Featherbrain

Prehistoric Gamer
Veteran
Joined
Jan 12, 2020
Messages
81
Reaction score
92
First Language
English
Primarily Uses
RMMV
Galv, or anyone else, any suggestions for incorporating the diagonal poses into movement routes, particularly to "Turn" rather than "Move"?

By default, there are "Move" commands for diagonals in MV (e.g. "Move Upper Right"), but no "Turn" commands for them. Using "Change Image" to select the diagonal/lower portion of the sprite sheet, followed by the appropriate "Turn ..." command for the intended diagonal direction, sort of works, but it's clunky and sometimes flashes an extra, unintended direction before getting to the right one. Otherwise, the only way I can see to incorporate the diagonals in movement routes is the "Move" commands, which are not always ideal for choreography.

Is there a script call or other method to set a diagonal direction for the sprite? Something equivalent to the default movement route commands like "Turn Left," "Turn Right," etc, but for diagonals?

Many thanks for the plugin, btw. Creating the diagonal animations is a lot of work but adds so much more depth to the game.


ETA: Actually, I just found the answer to this in the comments on Galv's page. Tested and works perfectly. Probably should've double checked there before posting, sorry!

In move route, use ‘script’ and put:


this.setDirection(1); this._diagDir = 1;


Replace the 1 with the diagonal direction number (1,7,9,3 are diagonals)
 
Last edited:

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

Latest Threads

Latest Posts

Latest Profile Posts

Are we allowed to post about non-RPG Maker games? And, if so, would any of you be interested in a short, proof of concept type non-euclidian puzzle game?
I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:

Forum statistics

Threads
105,883
Messages
1,017,232
Members
137,607
Latest member
Maddo
Top