How do you change the default walking (and preferably running) speed?

Hi,

Is there a method or plugins for changing the walking (and if possible, also the running) speed in a way that isn't reset when you're getting on/off a vehicle?

Every method I've found and tried so far has reset the speed to the defaults once the player gets off a vehicle.

Thanks in advance!
You can do it with events, choose the move route command and change the speed.
Spoiler
1596240114141.png
You can do it with events, choose the move route command and change the speed.
That doesn't work, because it resets as soon as you get off a vehicle.
That doesn't work, because it resets as soon as you get off a vehicle.
Ahh I didn't know since I never use vehicules. Without vehicules it stays for the rest of the game. You'll need a plugin then.

I've moved this thread to JS Plugin Requests. Thank you.

Ahh I didn't know since I never use vehicules. Without vehicules it stays for the rest of the game. You'll need a plugin then.
Moved to: JS Plugin Requests
This isn't a plugin request. I'm asking for a suggestion on how to achieve a solution, not for someone to code me a plugin.
This isn't a plugin request. I'm asking for a suggestion on how to achieve a solution, not for someone to code me a plugin.
Which will require modifying the game's code, which is why I moved it to plugin request. If you're asking where in the code do you change it, then I suppose it would go into Javascript/Plugin Support.
This isn't a plugin request. I'm asking for a suggestion on how to achieve a solution, not for someone to code me a plugin.

Yeap. Unfortunately, due to the way the code is written for getting off a vehicle, you will need a plugin.

This quick tinker should work :

Code:
/*:
* @plugindesc Sets the movement speed of the player when getting off a vehicle.
* @author Ossra
*
* @help This plugin should be placed above other Plugins for best chances at
* preventing incompatibility.
*/
(function() {
    'use strict';

    var OssraQuickEdit_GamePlayer_setMoveSpeed = Game_Player.prototype.setMoveSpeed;

    Game_Player.prototype.setMoveSpeed = function(moveSpeed) {
      
        if (this._vehicleGettingOn) {
          this.__moveSpeed = this._moveSpeed;
        } else if (this._vehicleGettingOff) {
          moveSpeed = this.__moveSpeed;
        }

        OssraQuickEdit_GamePlayer_setMoveSpeed.call(this, moveSpeed);

    };
})();
Which will require modifying the game's code, which is why I moved it to plugin request. If you're asking where in the code do you change it, then I suppose it would go into Javascript/Plugin Support.
I don't think it's entirely certain that it can't be done with events scripting, so I don't think that JS Plugin Requests is necessarily the most appropriate forum.

EDIT:

Hard to say for sure though, since it depends on what solutions there are.
Yeap. Unfortunately, due to the way the code is written for getting off a vehicle, you will need a plugin.

This quick tinker should work :

Code:
/*:
* @plugindesc Sets the movement speed of the player when getting off a vehicle.
* @author Ossra
*
* @help This plugin should be placed above other Plugins for best chances at
* preventing incompatibility.
*/
(function() {
    'use strict';

    var OssraQuickEdit_GamePlayer_setMoveSpeed = Game_Player.prototype.setMoveSpeed;

    Game_Player.prototype.setMoveSpeed = function(moveSpeed) {
     
        if (this._vehicleGettingOn) {
          this.__moveSpeed = this._moveSpeed;
        } else if (this._vehicleGettingOff) {
          moveSpeed = this.__moveSpeed;
        }

        OssraQuickEdit_GamePlayer_setMoveSpeed.call(this, moveSpeed);

    };
})();
Thanks for the script. Could you provide a bit of context about what it does? Is it reducing the movement speed by 1 increment every time you get off a vehicle?
I don't think it's entirely certain that it can't be done with events scripting, so I don't think that JS Plugin Requests is necessarily the most appropriate forum.

EDIT:

Hard to say for sure though, since it depends on what solutions there are.
If there is a solution that doesn't require a plugin I will move this thread back to MV support, but for now I think this is the appropriate section. Plus, if you want to run speed to not simply be walk speed +2, this is for sure require a plugin.

@quackgyver , please avoid double posting, as it is against the forum rules. You can use the "Edit" function on your posts to add additional information you've forgotten or respond to multiple people. You can review our forum rules here. Thank you.

I don't think it's entirely certain that it can't be done with events scripting, so I don't think that JS Plugin Requests is an appropriate forum.

I suppose you could have a Common Event running parallel in the background, constantly searching for when the player is not in a vehicle and re-setting the Move Speed back to whatever you desire. That could be a non-plugin solution.

Thanks for the script. Could you provide a bit of context about what it does? Is it reducing the movement speed by 1 increment every time you get off a vehicle?

Basically, I am checking for when the player is getting on and off of a vehicle. When the player is getting onto a vehicle, I am saving the current move speed of the player to a new property named '__moveSpeed'. Then when the player is getting off of a vehicle, I set the 'moveSpeed' argument of the 'setMoveSpeed' function to the value of the '__moveSpeed' property so that the previous value -- the one you want to preserve -- is set.

This should be how the code works by default, in my opinion ... but ah well.



EDIT: Here is a quick, parallel Common Event that should basically do the same thing as the plugin, if you would prefer to do it that way.

Code:
◆If:Script:$gamePlayer._vehicleGettingOff && $gamePlayer._moveSpeed !== 3
  ◆Set Movement Route:Player (Wait)
  :                  :◇Speed:3
  ◆
:End
◆Wait:1 frame

Change the '3' in the '$gamePlayer._moveSpeed !== 3' and Set Move Route command to the desired speed of the player.
I suppose you could have a Common Event running parallel in the background, constantly searching for when the player is not in a vehicle and re-setting the Move Speed back to whatever you desire. That could be a non-plugin solution.



Basically, I am checking for when the player is getting on and off of a vehicle. When the player is getting onto a vehicle, I am saving the current move speed of the player to a new property named '__moveSpeed'. Then when the player is getting off of a vehicle, I set the 'moveSpeed' argument of the 'setMoveSpeed' function to the value of the '__moveSpeed' property so that the previous value -- the one you want to preserve -- is set.

This should be how the code works by default, in my opinion ... but ah well.



EDIT: Here is a quick, parallel Common Event that should basically do the same thing as the plugin, if you would prefer to do it that way.

Code:
◆If:Script:$gamePlayer._vehicleGettingOff && $gamePlayer._moveSpeed !== 3
  ◆Set Movement Route:Player (Wait)
  :                  :◇Speed:3
  ◆
:End
◆Wait:1 frame

Change the '3' in the '$gamePlayer._moveSpeed !== 3' and Set Move Route command to the desired speed of the player.
Thanks for the clarification and the suggested event-based approach.

It seems that both approaches are working, so I'll just make a decision on whether to go with either.

Thanks so much for taking the time to help!

Original thread: https://forums.rpgmakerweb.com/threads/how-do-you-change-the-default-walking-and-preferably-running-speed.124786/