SelfSwitch Plugin

This small plugin allows you to change the self switch of another event, even on another map. Though you can do it with a single script line, it was a good opportunity to create a basic plugin to help newcomers to see how they work.

The plugin contains two commands;
- GetSelfSwitch, to get the value of a self switch and store it in a regular switch (for conditions for example)
- SetSelfSwitch, to change the value of a self switch.

Free script, no need for credits, it is up to you.

Enjoy 😀
Hey awesome.

I have a game that actually uses a lot of self switches. Would come in handy.

Hey just curious. Am I able to customize the plugin call for the set switch?
You have to be more explicit about "customizing" the plugin call. What is it exactly that you want to do ?
I have a super specific question so any help is appreciated.

So I have a game in VX ace. I want to transfer it to MZ.

I have a lot of self switch script calls. I use for example:
$game_self_switches[[@map_id, 7, 'C']] = true

I was wondering if I could customize your code so that it is the same. So I don't have to re-write alot of my game.
In fact, my script was made to avoid people writing arrays by themselves. In your case, it is better just to pass a script command directly :

Code:
$gameSelfSwitches.setValue([$gameMap.mapId(), 7, 'C'], true);
Oh I see what you mean. Your plugin would use plugin commands. Still helpful to use. Thanks.
@Schlangan you should call .refresh() on any events where the self switch is changed in the currently loaded map. Otherwise, the event page preconditions won't be re-evaluated properly and it may e.g. remain stuck on the wrong page.

Original thread: https://forums.rpgmakerweb.com/threads/selfswitch-plugin.125590/