MZ Disable/enable Plugin from Script Call

Hello;

I am looking for a way to enable or disable a plugin from the scripting level.

I am using a "smart evade" plugin to make characters move away from player in ways that keep them from getting stuck. (Script was posted here.)

I then created a push/pull mechanic following a tutorial.

The issue is that when the script is running it makes the push "away from player" avoid obstacles and turn comers which is *not* intended. I'd rather not scrap the smart evade script because of its uses in other parts of my game but I can't have push/pull mechanics making the player telekinetic.

So; is there a way for me to disable that plugin when the common event (for pushing and pulling) is called and then turn it back on when the common event ends?
You could just edit your push event to avoid using Move Away from Player. E.g.
  • If Player is facing Up:
    • Move Route: This Event: ..., Move Up, ...
  • If Player is facing Right:
    • Move Route: This Event: ..., Move Right, ...
  • If Player is facing Left:
    • Move Route: This Event: ..., Move Left, ...
  • If Player is facing Down:
    • Move Route: This Event: ..., Move Down, ...
Otherwise you would need an edit to the plugin code, to implement an on/off toggle.
Thank you; I forgot about that option. Script isn't as clean, but it works.
@Rosemar
your original question is like asking: can I work on the engine of my car - while driving 50 miles per hour on the highway?

IF the plugin programmer enabled the plugin for shutting off by a switch, THEN and ONLY THEN you can use a control switch command to switch it off - that is like installing a switch to be used by the driver from the cabin.
If the plugin programmer hasn't prepared anything (and that isn't as easy as adding a few lines in case of the more complex plugins as you for example need savefile compatibility even with the switch off), then you simply can't because simply opening the hood of the car would mean that the driver can no longer see where he is driving at 50 mph and is likely to crash very shortly afterwards.

Original thread: https://forums.rpgmakerweb.com/threads/disable-enable-plugin-from-script-call.169073/