Activate Plugins only on certain maps

Charles2020

Veteran
Veteran
Joined
Feb 24, 2020
Messages
36
Reaction score
1
First Language
English
Primarily Uses
RMMV
Guys

Is there a way to write a script to activate/deactivate plugins based on map ID ?

Can anyone shed some light on this issue ?

Thanks
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,660
Reaction score
1,111
First Language
EN
Primarily Uses
RMMV
Step 1: code the plugin features in a way that allows them to be switched off.

Step 2: on map load (e.g. Game_Map.prototype.setup), check the map ID and enable/disable the features as required.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,262
Reaction score
7,138
First Language
German
Primarily Uses
RMMV
@Charles2020
It is absolutely impossible to switch entire plugins off or on during the game - that would be like working on the motor of your car while racing 100km/h on the highway.

What can be done is to program features of a plugin to react to pre-installed switches. That is what the poster above meant with "step 1".
However for practical reasons that means that either the original programmer of the plugin has to have programmed such a switch already, or someone else has to analyse the specific plugin to reprogram it for having such switches - and that is not easy.

it is absolutely impossible to provide an automated way to add this reprogramming, it always has to be done for a specific plugin and repeated for every plugin where you want it.
 

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
5,173
Reaction score
4,487
First Language
English
Primarily Uses
RMVXA
Wrong board - JS Plugins in Development is for plugins that you are creating (and planning to share later). Moving to JS Plugin Requests.

AFAIK there is no way to dynamically change whether a plugin is ON or OFF during gameplay. I would go about it by adding an if-branch in all necessary parts of each script's functionality that checks whether a certain Switch is on (and turn that Switch on or off depending on the map). But aside from taking a long time to do, there would be a lot of technical risk in terms of crashes due to, for example, trying to reference data structures that don't exist because they weren't created because the functionality was Off when they would have been created. This kind of thing is a lot easier to add to scripts/plugins that you are building from scratch.
 

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

Latest Threads

Latest Profile Posts

This time around I don't have early access to the new maker, so I have to wait like everyone else to look under the hood. I really hope we get to soon though, I'm pretty excited :D
Chaos17 wrote on Poryg's profile.
Hi, I am following your videos tutorials serie about coding on MV and I am at the third video. Thank you for making it but's a bit hard to follow since you don't show the whole plugin at the end. I had to screenshot the lines between 110-159 because you scrolled so fast on them.
:rtear:
I'm not sure if I should be happy for MZ, or sad for MV.
Not going to lie.... The update's cool and all, but I immediately ran to Mog's site and was like, "Update! Update! Update!" while breathing on the page of his Star Ocean Battle System plugin. :kaoswt:
Ho boi. I can already see the storm of ugly actor faces RTP customizable facesets from MZ are gonna flood. XD

Forum statistics

Threads
99,463
Messages
965,684
Members
131,073
Latest member
James1998
Top