Help with player movement

I am trying to get a specific look to the movement in my game. I want players and NPCs to move from tile to tile without sliding between them like normal.


[IMG]https://i.gyazo.com/16bda1791de486e2aea146867cb3fd2c.png[/IMG]


I couldn't find anything on how to change characters or NPCs sliding between tiles, so as a work around I decided to speed up movement so that it appears to have no time between tiles, then wait a moment before the next step. I made a little plug in with these values:

Spoiler
Game_CharacterBase.prototype.setMoveSpeed = function(moveSpeed) {this._moveSpeed = 9};


Game_CharacterBase.prototype.setMoveFrequency = function(moveFrequency) {this._moveFrequency = 2};

It got the desired effect for the NPCs and they look just like I intended, but it didn't effect the player at all. I can't seem to find what I need to change the player's movement. I can use an event on the map to change the player's speed, but nothing seems to pause the player between steps. So the player would just zip around the map.


Can anyone point me in the right direction as to what I need to be modifying for the player's movement in a plugin, or ideally what controls the slide between tiles?
Could modify the function that moves the player and have it just set the x,y of the player instead?
Could modify the function that moves the player and have it just set the x,y of the player instead?

Isn't it already kind of setting the x,y and just playing an animation and scrolling the map to get you there? I'm not sure where that is handled.
I found this  


$gamePlayer._x = xval;
$gamePlayer._realX = xval;
$gamePlayer._y = yval;
$gamePlayer._realY = yval;


You have to set both. The game probably whenever the screen updates checks to see if they are different and if they are move the player slowly to that position, but if you set both of them to the same value right after each other then it will just snap the player to that position.
I found this  



$gamePlayer._x = xval;
$gamePlayer._realX = xval;
$gamePlayer._y = yval;
$gamePlayer._realY = yval;


You have to set both. The game probably whenever the screen updates checks to see if they are different and if they are move the player slowly to that position, but if you set both of them to the same value right after each other then it will just snap the player to that position.

Thanks for your help so far. Where did you find that? I'm guessing that only works for the player, since it says Player, and there would be a separate version for autonomous movement events (NPCs). If possible I'd like them both to work the same way.
I found it by looking at $gamePlayer and experimenting in the dev console.  


You can do the same thing with events by doing


$gameMap.event(eventId)._y = yval;
$gameMap.event(eventId)._realY = yval;
$gameMap.event(eventId)._x = xval;
$gameMap.event(eventId)._realX = xval;


You can find the eventId by clicking on them in rpgmaker. If you want to find the id in the program (like lets say using a script command in the event) you can do:


$gameMap.event(eventId)._y = yval;
$gameMap.event(eventId)._realY = yval;
$gameMap.event(eventId)._x = xval;
$gameMap.event(eventId)._realX = xval;

Code:
this._eventId // the eventId
you could do -
$gameMap.event(this._eventId)._y = yval;
$gameMap.event(this._eventId)._realY = yval;
$gameMap.event(this._eventId)._x = xval;
$gameMap.event(this._eventId)._realX = xval;
I think I change the Game_CharacterBase to behave this way and have it work for the player and all the moving events.


I'm looking at this section:

Spoiler
Game_CharacterBase.prototype.moveStraight = function(d) {
    this.setMovementSuccess(this.canPass(this._x, this._y, d));
    if (this.isMovementSucceeded()) {
        this.setDirection(d);
        this._x = $gameMap.roundXWithDirection(this._x, d);
        this._y = $gameMap.roundYWithDirection(this._y, d);
        this._realX = $gameMap.xWithDirection(this._x, this.reverseDir(d));
        this._realY = $gameMap.yWithDirection(this._y, this.reverseDir(d));
        this.increaseSteps();
    } else {
        this.setDirection(d);
        this.checkEventTriggerTouchFront(d);
    }
};

I can't quite figure out the right way to change it though. A few of the ways I poked it caused the characters to jump 2 tiles, then slide backwards one. Which is close to what I want I guess. Maybe I am missing something obvious.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-player-movement.69078/