(I couldn't find a post about using Set Movement Route in script... did see a few references for the parameters, but not how to actually call the function.)
I want to change an event's image and direction based off variables using Set Movement Route. I figured it would be easier to do via a plugin command rather than writing a lot of conditional statements in the event editor.
I found the Game Interpreter's command205 (Set Movement Route) in rmmz_objects.js and figured out how to properly set the function parameters, but I'm not sure how to actually call the Set Movement Route function. I'm not sure what
Is there a better way to call Set Movement Route in scripts? If not, how do you call this function? Any help would be appreciated! 😅
I want to change an event's image and direction based off variables using Set Movement Route. I figured it would be easier to do via a plugin command rather than writing a lot of conditional statements in the event editor.
I found the Game Interpreter's command205 (Set Movement Route) in rmmz_objects.js and figured out how to properly set the function parameters, but I'm not sure how to actually call the Set Movement Route function. I'm not sure what
this means in the code, but I get the feeling that simply copying the function's code to my script wouldn't work.Is there a better way to call Set Movement Route in scripts? If not, how do you call this function? Any help would be appreciated! 😅
JavaScript:
// Set Movement Route
Game_Interpreter.prototype.command205 = function(params) {
$gameMap.refreshIfNeeded();
this._characterId = params[0];
const character = this.character(this._characterId);
if (character) {
character.forceMoveRoute(params[1]);
if (params[1].wait) {
this.setWaitMode("route");
}
}
return true;
};