SelfSwitch Plugin

Schlangan

A madman with a computer
Veteran
Joined
May 20, 2015
Messages
1,420
Reaction score
1,695
First Language
French
Primarily Uses
RMMV
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 :D
 

Attachments

BrentBAM

Veteran
Veteran
Joined
Jul 22, 2020
Messages
56
Reaction score
26
First Language
English
Primarily Uses
RMVXA
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?
 

Schlangan

A madman with a computer
Veteran
Joined
May 20, 2015
Messages
1,420
Reaction score
1,695
First Language
French
Primarily Uses
RMMV
You have to be more explicit about "customizing" the plugin call. What is it exactly that you want to do ?
 

BrentBAM

Veteran
Veteran
Joined
Jul 22, 2020
Messages
56
Reaction score
26
First Language
English
Primarily Uses
RMVXA
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.
 

Schlangan

A madman with a computer
Veteran
Joined
May 20, 2015
Messages
1,420
Reaction score
1,695
First Language
French
Primarily Uses
RMMV
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);
 
Last edited:

BrentBAM

Veteran
Veteran
Joined
Jul 22, 2020
Messages
56
Reaction score
26
First Language
English
Primarily Uses
RMVXA
Oh I see what you mean. Your plugin would use plugin commands. Still helpful to use. Thanks.
 

rpg_el

Veteran
Veteran
Joined
Sep 3, 2020
Messages
83
Reaction score
35
First Language
English
Primarily Uses
RMMZ
@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.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Where do i have to play Heisei Pistol Show the same creator that made Re: Kinder Parun
I really get the feeling I should be doing regular YouTube videos whenever I make something cool in my game, instead of waiting for massive changes. But not going to lie... I always feel like it's never quite enough to merit an update, until it's a drastic change. :kaoswt:
Going to submit to this game jam...struggling with the time crunch...
Have to keep compromising...
Just released a new OST for my game and a new place to purchase it!

Ah, things to do when you finish a game.
Ami
Me: It's dark cloudy! I hope it's Rain…
(2-3 Hours Later,Changed To Sunny)
Me: :kaolivid:

Forum statistics

Threads
104,538
Messages
1,007,014
Members
136,033
Latest member
carrydeos50
Top