Turn In Place

AnniexoHoshi

Villager
Member
Joined
Jun 30, 2017
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
Is there a way for people to still move around with mouse click with this? I've just downloaded it, but still want to use mouse click to move around.
 

mjshi

Jack of Most Trades
Veteran
Joined
Feb 16, 2013
Messages
957
Reaction score
780
First Language
English
Primarily Uses
N/A
@AnniexoHoshi Yes. Just like with keyboard input, if you hold down your left mouse key for a wait count number of frames, the player will be able to move via mouse input.
 

AnniexoHoshi

Villager
Member
Joined
Jun 30, 2017
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
@AnniexoHoshi Yes. Just like with keyboard input, if you hold down your left mouse key for a wait count number of frames, the player will be able to move via mouse input.
Thank you, but is there a way for the player to be able to let go of the mouse button and the character still move to where the click was?
 

mjshi

Jack of Most Trades
Veteran
Joined
Feb 16, 2013
Messages
957
Reaction score
780
First Language
English
Primarily Uses
N/A
@AnniexoHoshi MV should do that automatically. None of that is explicitly coded into this very short plugin.
 

AnniexoHoshi

Villager
Member
Joined
Jun 30, 2017
Messages
5
Reaction score
0
First Language
English
Primarily Uses
RMMV
@mjshi I think you might have done something by mistake and not realised it. For me, I have to hold down the mouse button to where I want the character to go. If I let go they stop in their place. If you could, is there a way you can make it so double clicking makes the character more?
 

mjshi

Jack of Most Trades
Veteran
Joined
Feb 16, 2013
Messages
957
Reaction score
780
First Language
English
Primarily Uses
N/A
@AnniexoHoshi This isn't an official release but I spent the last hour on this and there's still a couple bugs I haven't ironed out, but it should function for large movements. Yes, I'm aware that occasionally you'll get stuck behind a wall and will have to hold down for finer movements. Also, if you click somewhere else while in the middle of a move route yes the player will stop moving. I'm aware of those two behaviors. The first is unintentional and a bug, the second is intentional but might be mistaken for a bug.

How I've gotten it to work with double clicks is this-- MV remembers the tile you last clicked on and if you click on that tile again it will autopath to there. Obviously this method is imperfect and for some reason is messing with the way MV handles autopathing by default. I'm not really sure why.

I still recommend the officially supported way of movement over this. MV doesn't support double clicking, unfortunately u.u
This is the best I can do to emulate that behavior. I probably won't be posting any updates or fixes to this double clicking version past the one posted here.
 

Attachments

ldd

Villager
Member
Joined
Feb 19, 2016
Messages
16
Reaction score
13
Primarily Uses
shorter (and cleaner) way to accomplish this is fewer lines (without the plugin)

Code:
// player can turn in place
Game_Player.prototype.executeMove  = function(direction){
   if(Input.isLongPressed(Input._latestButton)  || $gameTemp.isDestinationValid()){
       this.moveStraight(direction);
   }
   else{
    this._direction = (direction);
    }
}
 

mjshi

Jack of Most Trades
Veteran
Joined
Feb 16, 2013
Messages
957
Reaction score
780
First Language
English
Primarily Uses
N/A
@KitteyWolf Have you tried switching the order of the plugins? His camera control plugin overwrites something completely, so Turn In Place needs to be below it.
 

KitteyWolf

FriendlyFur
Veteran
Joined
Sep 2, 2016
Messages
31
Reaction score
1
First Language
English
Primarily Uses
RMMV
@mjshi i did! it was just not working-
though i ended up using a different plugin for both the camera and turning in place
[i still like yours, but another one is made by a person i'm already using plugins by and it cleans up my credit page nicely]
 

mjshi

Jack of Most Trades
Veteran
Joined
Feb 16, 2013
Messages
957
Reaction score
780
First Language
English
Primarily Uses
N/A
@KitteyWolf
Strange, works for me when I put Turn In Place under camera control. Might be another plugin in there causing the issue, or something else entirely.


But either way, I'm glad you were able to find another option ^^
 

8ik9ol

Villager
Member
Joined
Aug 16, 2019
Messages
5
Reaction score
1
First Language
German
Primarily Uses
RMMV
I'm using




I find it a shame that I can't use these two scripts simultaneously, as my game needs diagonal movement, but I'd love to have turning in place.
I think I found a solution to your problem, (which had also become mine):
In rpg_sprites.js replace line 322 with:

Sprite_Character.prototype.characterPatternY = function() {
return (((this._character.direction() == 1) ? 2 : ((this._character.direction() == 7) ? 4 : ((this._character.direction() == 9) ? 8 : ((this._character.direction() == 3) ? 6 : (this._character.direction())))))- 2) / 2;
};

This works fine for me. I hope it can help you, too.
 

Ascare

Villager
Member
Joined
Dec 14, 2017
Messages
9
Reaction score
5
First Language
German
Primarily Uses
RMMV
I think I found a solution to your problem, (which had also become mine):
In rpg_sprites.js replace line 322 with:

Sprite_Character.prototype.characterPatternY = function() {
return (((this._character.direction() == 1) ? 2 : ((this._character.direction() == 7) ? 4 : ((this._character.direction() == 9) ? 8 : ((this._character.direction() == 3) ? 6 : (this._character.direction())))))- 2) / 2;
};

This works fine for me. I hope it can help you, too.
Thanks! I use 8 frames per character and diagonal movement (GALVs scripts) and your fix did it for me.

And thanks to mjshi for this plugin. I use this in combination with Talk to Follower and it works fine. :cool:
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Got inspired and started writing a simple tower defence battle system last night :o
Good news! I have located an amazing 3D website called SketchFab that has rotatable renderings of famous statues!
Picked up a physical copy of Megadimension Neptunia VII for the PS4 today. It's pretty good. I'm having a lot of fun with it.
The only upside of this remote semester was the plenty of funny photoshop material those facecams provided. Not that I would do that. Ever.

Forum statistics

Threads
100,516
Messages
976,711
Members
132,080
Latest member
nwr
Top