Disable Plugins with script or events

Sephiro

Warper
Member
Joined
Aug 6, 2016
Messages
3
Reaction score
0
First Language
English
Primarily Uses
Is it possible to disable/enable plugins from a common event or script?  If so how would I do that? 
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
no, 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.
 
Last edited by a moderator:

Sephiro

Warper
Member
Joined
Aug 6, 2016
Messages
3
Reaction score
0
First Language
English
Primarily Uses
no, 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.
Andar - Thanks for that info!  I guess in my mind I was looking more for how to turn off the radio. :D   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...
 

DreamX

Veteran
Veteran
Joined
May 30, 2015
Messages
816
Reaction score
826
First Language
English
Primarily Uses
Andar - Thanks for that info!  I guess in my mind I was looking more for how to turn off the radio. :D   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.
 

Sephiro

Warper
Member
Joined
Aug 6, 2016
Messages
3
Reaction score
0
First Language
English
Primarily Uses
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.
 

ABSTRVCT

- Enlightened -
Veteran
Joined
Nov 19, 2016
Messages
38
Reaction score
1
First Language
Spanish
Primarily Uses
Yes, if you altered the plugin correctly you would be able to switch off functionality. The difficulty of which depends on the plugin.
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.
 

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,269
Reaction score
1,423
First Language
English
Primarily Uses
RMXP
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.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,434
Reaction score
7,713
First Language
German
Primarily Uses
RMMV
@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)
 
Last edited by a moderator:

ABSTRVCT

- Enlightened -
Veteran
Joined
Nov 19, 2016
Messages
38
Reaction score
1
First Language
Spanish
Primarily Uses
@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.
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,528
Reaction score
14,261
First Language
English
Primarily Uses
RMVXA
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?
 

ABSTRVCT

- Enlightened -
Veteran
Joined
Nov 19, 2016
Messages
38
Reaction score
1
First Language
Spanish
Primarily Uses
Well, I still don't know much about scripting, but my request seems more difficult to fulfill than it seems. Thank you all anyway :)
 

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,269
Reaction score
1,423
First Language
English
Primarily Uses
RMXP
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.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,051
Messages
1,018,549
Members
137,836
Latest member
T62352536256t362
Top