Is it possible to disable/enable plugins from a common event or script? If so how would I do that?
Disable Plugins with script or events
Javascript/Plugin Supportno, that is not possible. As a comparison - you won't try to change parts of your car engine while driving at 50 mph on the highway, do you? Same applies to changing the plugins in the MV engine while that engine/game is running.
If the plugin creator prepared a switch or a command for it, then you can switch off that specific function part of the plugin - but that depends on the plugin writer to have prepared such a switch, it can't be done otherwise.
If the plugin creator prepared a switch or a command for it, then you can switch off that specific function part of the plugin - but that depends on the plugin writer to have prepared such a switch, it can't be done otherwise.
Andar - Thanks for that info! I guess in my mind I was looking more for how to turn off the radio. 😀 I assume that it would be possible to shut off the functionality of a plugin if I were to modify the plugin to add a switch for its core functionality and then send a plugin command with an event? Sorry if these are dumb questions. I am just starting out here...
Yes, if you altered the plugin correctly you would be able to switch off functionality. The difficulty of which depends on the plugin.
Thanks. Ill look into it and see if i can make that work.
Is it possible to make a plugin that allows control over plugin manager during game (accessing to the plugins.js file)? It would be enormously great.
Sure, plugins.js stores the plugin information in $plugins, so you can check that. You can also read the .js file directly.
Can't really see why you would want to modify that during game, but you can create a plugin that goes through the file, does stuff, and creates a new plugins.js file.
Can't really see why you would want to modify that during game, but you can create a plugin that goes through the file, does stuff, and creates a new plugins.js file.
@ABSTRVCT If you think you can disable or enable plugins dynamically by modifying the plugin.js like Zeriab described - that won't work as easily as you might assume, which is why Zeriab couldn't see a reason for you to do that.
In 90% of all cases, changing the active plugins in the plugin manager still requires the player to start a new game for the newly activated plugins to work correctly, as they make older savefiles incompatible.
I won't go into details as to why that is the case, but it still applies even when you change the plugin.js by another plugin instead of manually in the plugin manager.
So if you have a plugin change the plugin.js while the game is running, you will get errors if the changed plugins can't handle those dynamic changes.
And to prevent that, the player will still be forced to start a new game, abandoning the current one.
There are only two ways how this method can work - either if the plugin is written in a way that allows it to work without a new game (as most are not), or if you want to enable a plugin for a future new game only after the player has solved the game once (similiar to "new game plus" plugins)
In 90% of all cases, changing the active plugins in the plugin manager still requires the player to start a new game for the newly activated plugins to work correctly, as they make older savefiles incompatible.
I won't go into details as to why that is the case, but it still applies even when you change the plugin.js by another plugin instead of manually in the plugin manager.
So if you have a plugin change the plugin.js while the game is running, you will get errors if the changed plugins can't handle those dynamic changes.
And to prevent that, the player will still be forced to start a new game, abandoning the current one.
There are only two ways how this method can work - either if the plugin is written in a way that allows it to work without a new game (as most are not), or if you want to enable a plugin for a future new game only after the player has solved the game once (similiar to "new game plus" plugins)
@Andar It would be useful when two plugins don't work very well together and you don't need to use them at the same time. Of course it would not make sense in the case of core or system plugins which are intended to work everytime. Anyway, I think there's a way to create this plugin and not to get many errors. For example, Terrax Lighting can be enabled and disabled during game.
It really requires the plug-in to be written to handle turning it on and off. Trying to dynamically turn off plug-ins other ways will mess up the variables that are being stored, which will wreck the save games. How is your game to handle a plug-in being turned on that adds three variables to each actor? Are they just undefined? We all know what undefined variables do when they are needed (they crash the game). And what becomes of those variables once the plugin is off? The only place that stores and creates those variables is in that plug-in, so the rest of the engine is not going to know about them. Does the save game just ignore them? Or what?
Well, I still don't know much about scripting, but my request seems more difficult to fulfill than it seems. Thank you all anyway 🙂
Unfortunately it is impossible to create a script which in general allows you to disable and enable plugins at will during the flow of a game.
For specific cases, i.e. specific plugins, it's a different matter, I expect that for all plugins created so far it is possible to rewrite in such a fashion the features or functionality they provide can be enabled/disabled during the course of a game. I recommend creating support/request topics for your particular plugins.
For specific cases, i.e. specific plugins, it's a different matter, I expect that for all plugins created so far it is possible to rewrite in such a fashion the features or functionality they provide can be enabled/disabled during the course of a game. I recommend creating support/request topics for your particular plugins.
Original thread: https://forums.rpgmakerweb.com/threads/disable-plugins-with-script-or-events.66410/