- Joined
- Jan 22, 2019
- Messages
- 240
- Reaction score
- 195
- First Language
- English
- Primarily Uses
- RMMV
I wrote a small script to change the player's movement speed based on whether or not the current map type is Overworld:
and after testing it as a common event called in a transfer event, I am wondering how I could add this in some way as a plugin so I don't have to add it to every single Overworld to Town transfer event.
I tried modifying:
but I only managed to mess up the followers' movement, as I an not sure exactly what I am doing there.
JavaScript:
xDRAGOONx.setMoveSpeed = function(){
if ($gameMap.isOverworld(this)) {
$gamePlayer.setMoveSpeed(3);
$gamePlayer.hideFollowers();
$gamePlayer.refresh();
} else {
$gamePlayer.setMoveSpeed(4);
$gamePlayer.showFollowers();
$gamePlayer.refresh();
}
}
xDRAGOONx.setMoveSpeed.call(this);
I tried modifying:
JavaScript:
Game_CharacterBase.prototype.setMoveSpeed = function(moveSpeed) {
this._moveSpeed = moveSpeed;
};