Prescribe the plugin command in the Movement Route

Good day!
In the " movement route " function, it is possible to prescribe a script. Is there any way to prescribe a plugin command?
No, there are no plugin commands in movement routes.

If the plugin is written in a way that it can be called via script calls, you can use that, but it depends on the plugin.
If the plugin is written in a way that it can be called via script calls, you can use that, but it depends on the plugin.
I've never looked at how to create a plugin command - are they not simply a shorthand for calling a function? Are there plugin commands that can't be called via script?

@Yilou if you want to do this without getting too much into the guts of a plugin, you can use Yanfly's Script Call Plugin Commands plugin.
I've never looked at how to create a plugin command

There is a Game_Interpreter function to run a plugin command, so you potentially could call that function within a script call, but it would be ugly and not for the faint of heart to attempt.

I am also thinking of MV. I haven't really looked at MZ, but I do know it does things a bit differently.
The general form for RMMV would be:
  • interpreter.pluginCommand(commandName, [arg1, arg2, ...]);
Where:
  • interpreter is a Game_Interpreter reference;
  • commandName is the command (string/text);
  • arg1, arg2, etc are the command arguments (also strings).
Unlike a Script command in an event, a move route has no natural interpreter reference: you'd need to remotely access the relevant interpreter. The main map interpreter is $gameMap._interpreter, so you could try something like:
  • $gameMap._interpreter.pluginCommand("ItemBook", ["add", "weapon", "3"]);
This example uses a plugin command from ItemBook.js; edit the values as needed.

If the plugin command does not actively make changes to the interpreter then this kind of thing should be safe. In that case, though, I feel like the plugin should offer the relevant script call...like Shaz says, that depends on the plugin. 😴

Otherwise, I think this is the default map update order for events & move routes:
  • Main interpreter (i.e. the current non-Parallel event, if any);
  • Map event move routes;
  • Parallel map events;
  • Parallel common events;
  • Player move route.
Thanks for the answers!

caethyril​

I need to insert a command from the Qaudio plugin in the " movement routes " that fixes the sound in one place. Is it possible to do it according to your scheme? Here is my command:
qAudio start 00NightSound se id00NightSound max20 loop radius35 bindToe35
Should I write Qaudio instead of ItemBook? And I'm not quite sure where I should write "start".
$gameMap._interpreter.pluginCommand("ItemBook", ["add", "weapon", "3"]);
This example uses a plugin command from ItemBook.js; edit the values as needed.

qAudio start 00NightSound se id00NightSound max20 loop radius35 bindToe35
Should I write Qaudio instead of ItemBook?
You would follow the exact format caethyril gave, so instead of ItemBook you write whatever the name of the plugin file is.
And I'm not quite sure where I should write "start".
You write every single word you just typed there enclosed in quotes and separated by commas.
Code:
$gameMap._interpreter.pluginCommand("whateverTheNameOfTheFileIs", ["qAudio", "start", "00NightSound"...etc.

If you have any problems figuring that out, you might look at the plugin I recommended to you instead.
The first word is the command, and all the following words etc are arguments. So I think it would be something like this:
  • $gameMap._interpreter.pluginCommand("qAudio", ["start", "00NightSound", "se", "id00NightSound", "max20", "loop", "radius35", "bindToe35"]);
MV plugin commands don't care about the name of the plugin file, only the name of the command.
Ah, I misunderstood when your example used a command then you specified that was the filename of the plugin.

Original thread: https://forums.rpgmakerweb.com/threads/prescribe-the-plugin-command-in-the-movement-route.141072/