MV [RMMV] Increase movement speed when wearing certain armor

Is there a way to make it so when equipped, a certain piece of armor increases your overworld movement speed? And when its unequipped, the movement speed returns to normal.
You would have to use one of those plugins that run a script on equip and unequip. I think Waynee has one.

$gamePlayer.setMoveSpeed(5);
I wrote a reply to this one originally, then came across a bunch of test scenarios that broke my approach that made me feel like it would be too much to work to resolve, but then thought of a better solution that handled all the scenarios I could think of.

So give this a try:
JavaScript:
/*:
* @plugindesc Allows the equipping and unequipping of an item to change
* the player's overworld movement speed
*
* @help In the notes box of an equippable item, put <changeMovementSpeed: x>, where
* x is an Integer between 1 and 6. "Normal" move speed in the default engine
* is 4, with higher numbers being faster and lower numbers being slower.

* The highest speed of all changeMovementSpeed items will be applied to the party.
* If the party is not wearing any changeMovementSpeed items, a default speed of
* 4 will be set.
* If the highest speed of all changeMovementSpeed items is less than 4, that value
* will still be used.
*/

(function(module) {
    'use strict';

    var Zevia = module.Zevia || {};
    var DEFAULT_MOVE_SPEED = 4;

    Zevia.equipItemOk = Scene_Equip.prototype.onItemOk;
    Scene_Equip.prototype.onItemOk = function() {
        Zevia.equipItemOk.call(this);
        var highestItemMoveSpeed = Math.max.apply(null, $gameParty.members().reduce(function(moveSpeeds, member) {
            return moveSpeeds.concat(member.equips().map(function(item) {
                return (item && item.meta && item.meta.changeMovementSpeed && parseInt(item.meta.changeMovementSpeed)) || 0;
            }));
        }, []));
        $gamePlayer.setMoveSpeed(highestItemMoveSpeed || DEFAULT_MOVE_SPEED);
    };
})(window);

You may copy that code into a .js file in your js/plugins directory, or you may right click this link and save it to the js/plugins directory.

I've named this plugin SprintShoes.js after the Final Fantasy accessory, but since there are no plugin parameters, you may name it whatever you wish.

Within the notes box of any item, put <changeMovementSpeed: x>, where x is an integer between 1 and 6, with 4 being the default "normal" speed, higher values being faster, and lower values being slower.

The highest value of all changeMovementSpeed items the party has equipped will be applied to the party's move speed upon equipping or unequipping an item. If nobody in the party is wearing a changeMovementSpeed item upon equipping or unequipping an item, then the party's speed will be set to 4.

Note that, as a result, if you set <changeMovementSpeed: 3> on an item, then even if the normal speed would be higher, if 3 is the highest of all equipped items, the party will still have a speed of 3.

It should be compatible with other Plugins that alter the behavior of equipping or unequipping items, but may not work with Plugins that entirely overwrite the onItemOk method of equipping items. If there is a conflict, try placing this script below the conflicting Plugin, as this Plugin's movement speed effect is applied after the rest of the behavior of equipping or unequipping an item occurs.

I've tested this Plugin with a default project with two items that apply a speed of 5 and 3:
  • By default, Harold has a 5 item and Therese has a 3 item, but because the items have not been equipped or unequipped yet upon game load, the party's speed has not changed
  • Unequipping the 5 and leaving the 3 on Therese sets a party speed of 3
  • Unequipping both the 5 and the 3 sets a party speed of 4
  • After unequipping both items, equipping the 5 sets the party speed to 5
  • Unequipping the 5 again sets the party speed to 4
  • Equipping the 3 again sets the party speed to 3
  • Equipping or unequipping unrelated items runs the code, but does not ultimately change the value of the party's current movement speed
I wrote a reply to this one originally, then came across a bunch of test scenarios that broke my approach that made me feel like it would be too much to work to resolve, but then thought of a better solution that handled all the scenarios I could think of.

So give this a try:
JavaScript:
/*:
* @plugindesc Allows the equipping and unequipping of an item to change
* the player's overworld movement speed
*
* @help In the notes box of an equippable item, put <changeMovementSpeed: x>, where
* x is an Integer between 1 and 6. "Normal" move speed in the default engine
* is 4, with higher numbers being faster and lower numbers being slower.

* The highest speed of all changeMovementSpeed items will be applied to the party.
* If the party is not wearing any changeMovementSpeed items, a default speed of
* 4 will be set.
* If the highest speed of all changeMovementSpeed items is less than 4, that value
* will still be used.
*/

(function(module) {
    'use strict';

    var Zevia = module.Zevia || {};
    var DEFAULT_MOVE_SPEED = 4;

    Zevia.equipItemOk = Scene_Equip.prototype.onItemOk;
    Scene_Equip.prototype.onItemOk = function() {
        Zevia.equipItemOk.call(this);
        var highestItemMoveSpeed = Math.max.apply(null, $gameParty.members().reduce(function(moveSpeeds, member) {
            return moveSpeeds.concat(member.equips().map(function(item) {
                return (item && item.meta && item.meta.changeMovementSpeed && parseInt(item.meta.changeMovementSpeed)) || 0;
            }));
        }, []));
        $gamePlayer.setMoveSpeed(highestItemMoveSpeed || DEFAULT_MOVE_SPEED);
    };
})(window);

You may copy that code into a .js file in your js/plugins directory, or you may right click this link and save it to the js/plugins directory.

I've named this plugin SprintShoes.js after the Final Fantasy accessory, but since there are no plugin parameters, you may name it whatever you wish.

Within the notes box of any item, put <changeMovementSpeed: x>, where x is an integer between 1 and 6, with 4 being the default "normal" speed, higher values being faster, and lower values being slower.

The highest value of all changeMovementSpeed items the party has equipped will be applied to the party's move speed upon equipping or unequipping an item. If nobody in the party is wearing a changeMovementSpeed item upon equipping or unequipping an item, then the party's speed will be set to 4.

Note that, as a result, if you set <changeMovementSpeed: 3> on an item, then even if the normal speed would be higher, if 3 is the highest of all equipped items, the party will still have a speed of 3.

It should be compatible with other Plugins that alter the behavior of equipping or unequipping items, but may not work with Plugins that entirely overwrite the onItemOk method of equipping items. If there is a conflict, try placing this script below the conflicting Plugin, as this Plugin's movement speed effect is applied after the rest of the behavior of equipping or unequipping an item occurs.

I've tested this Plugin with a default project with two items that apply a speed of 5 and 3:
  • By default, Harold has a 5 item and Therese has a 3 item, but because the items have not been equipped or unequipped yet upon game load, the party's speed has not changed
  • Unequipping the 5 and leaving the 3 on Therese sets a party speed of 3
  • Unequipping both the 5 and the 3 sets a party speed of 4
  • After unequipping both items, equipping the 5 sets the party speed to 5
  • Unequipping the 5 again sets the party speed to 4
  • Equipping the 3 again sets the party speed to 3
  • Equipping or unequipping unrelated items runs the code, but does not ultimately change the value of the party's current movement speed
Thanks so much!

Original thread: https://forums.rpgmakerweb.com/threads/rmmv-increase-movement-speed-when-wearing-certain-armor.163736/