Plugin Call within a Notetag

Hi there!


So, I'm trying to call a plugin command using the VPS Dynamic Weather System and YEP - States and Buffs Core.


Basically I'm trying to make weather effects end when certain buffs do.


I'm mostly just trying to call this command:


stopWeather


into this spot:


<Custom Leave Effect>

</Custom Leave Effect>


I do see that I need to use this:


var aliasPluginCommand = Game_Interpreter.prototype.pluginCommand;

Game_Interpreter.prototype.pluginCommand = function(command, args) {
aliasPluginCommand.call(this, command, args);
if (command === 'plugincommandtextname') {
dostuff(args);
}
};


But, I'm just having a little trouble putting it all together. Would anybody be able to help me out? Thanks in advance.
plugin commands run from the Plugin event command, not from noteboxes.  The only way you're going to get that to work is if the plugin that reads those notes has something set up to do it.


Links to the plugins you're using would be the first step in getting help.
Oh, I see now. I get it. I was looking at script calls and thought they could be used in noteboxes. Thanks for pointing that out. I feel dumb. My bad.
Actually, I believe in this instance you can use a script call within the notetag. The help text for the plugin does state that any code within the two tags should be executed ... so, the following may work :

Code:
// $gameMap._interpreter.pluginCommand('nameOfCommand', [arg1, arg2, ...]);

$gameMap._interpreter.pluginCommand('stopWeather', []);
that's why I asked for links to the plugins.  Nice 🙂


Although - is this something you want to happen on the map or in battle?  I think the map and battles use different interpreters, so your script call might be different depending on where/when it's being used.
Yeah, that is true. If $gameMap does not work, then perhaps give $gameTroop a try. I really do not tinker around with the battle system very much.

Code:
$gameTroop._interpreter.pluginCommand('stopWeather', []);
Wow, that worked. Sorry for late reply. 


It does stop the weather effect, now I just gotta make it re-tint the screen, but I should be able to get that one on my own. 


Thanks a lot!

Original thread: https://forums.rpgmakerweb.com/threads/plugin-call-within-a-notetag.66344/