You do something like:
this._moveSpeed = 4;
this._moveFrequency = 6;
Here are the values you can change, found in rpg_objects.js on line 6223:
this._x = 0;
this._y = 0;
this._realX = 0;
this._realY = 0;
this._moveSpeed = 4;
this._moveFrequency = 6;
this._opacity = 255;
this._blendMode = 0;
this._direction = 2;
this._pattern = 1;
this._priorityType = 1;
this._tileId = 0;
this._characterName = '';
this._characterIndex = 0;
this._isObjectCharacter = false;
this._walkAnime = true;
this._stepAnime = false;
this._directionFix = false;
this._through = false;
this._transparent = false;
this._bushDepth = 0;
this._animationId = 0;
this._balloonId = 0;
this._animationPlaying = false;
this._balloonPlaying = false;
this._animationCount = 0;
this._stopCount = 0;
this._jumpCount = 0;
this._jumpPeak = 0;
this._movementSuccess = true;
You can use the event command "Script..."
It's very versatile, like for example you could fade out an event like so:
First page of event, you set variables, use parallel or autorun:
this._opacity = 255;
Next page, set to parallel or autorun: Script... Event Command:
if (this._opacity > 0) {
this._opacity -= 1;
}
It will fade out your character into oblivion. Javascript + rpg maker mv is the best.
Random in javscript is like the following:
Math.floor(Math.random()*((10-5+1)+5);
Does a random number between 5-10. Just replace the two 5's and the 10 with your number range of choice.
To change Event movement speed you do:
var eventspeed_fastest = 6;
var eventspeed_slowest = 1;
this._moveSpeed = Math.floor(Math.random()*((eventspeed_fastest-eventspeed_slowest+1)+eventspeed_slowest);
You can also do the same with the player object if you'd like:
Code:
var eventspeed_fastest = 6;
var eventspeed_slowest = 1;
$gamePlayer._moveSpeed = Math.floor(Math.random()*((eventspeed_fastest-eventspeed_slowest+1)+eventspeed_slowest);