# Gw Temp

## Tutorial - 'SMRPG Switch game' by dragonheartman

An item about RPGMaker 2000 posted on

### Blurb

Super Mario RPG switch game tutorial!

### Body

This is a minigame from SMRPG (super mario rpg) where you have a room with 16 switches you can stand on (4x4) and you have to activate all 16, but there is a catch, if you activate a switch(by hitting enter in this case), all switches (or spaces) ajacent to the one you pressed will also invert their properties. Look at the diagram. Just to keep it organized, I labeled the 16 switches like a graph:

[#,#] = Space with coordinates

[1,4][2,4][3,4][4,4]
[1,3][2,3][3,3][4,3]
[1,2][2,2][3,2][4,2]
[1,1][2,1][3,1][4,1]

if you hit enter over space [2,3] these spaces would change from ON to OFF or OFF to ON:
[2,4],[3,3],[2,2],and[1,3]. the space you were standing on ([2,3]) would also change from on to off also. so if there are two different colors, red for off and green for on, here is how the 16 spaces would look now (assuming all were previosly off):

R=RED
G=GREEN

[R][G][R][R]
[G][G][G][R]
[R][G][R][R]
[R][R][R][R]

Now, with the previous example still in effect, if you pressed enter over space [3,2] the ajacent spaces would invert their on/off switch properties. green to red, and red to green:

R=RED
G=GREEN

[R][G][R][R]
[G][G][R][R]
[R][R][G][G]
[R][R][G][R]

Now, that is the example, on with the coding!

create 17 switches one called "minigame won" and all other 16 need to be named the correct coordinates I told you about earlier.

First you need two switch graphics, ON and OFF in the chipset of the minigame. I will be using the same graphics as my example, green for ON and red for OFF.

Create an event for each of the spaces (16 total, 4x4),name the spaces their designated coordinates and the first page of every event should have a red switch. start conditions "push key", and the second page should have start conditions #,# ON set (#,# is the current coordinate of the event). The second page should be "push key" also, and the graphics should be the green switch.

Now that you have almost all of the coding , now double click space 1,4. on the first page, set the coding to look something like this:

<>Play SE: switch 1
<>Change switch 1,4 ON/OFF (not on or off, the third option I forget what it is called)
<>Change switch 2,4 ON/OFF
<>Change switch 1,3 ON/OFF

copy those four things to page 2 of your 1,4 event. You should test your game to see if it works. After, go to your 2,4 event and put this coding:

<>Play SE: switch 1
<>Change switch 3,4 ON/OFF (not on or off, the third option I forget what it is called)
<>Change switch 1,4 ON/OFF
<>Change switch 2,4 ON/OFF
<>Change switch 2,3 ON/OFF

Do you get it now. You just need to do that for all 16 spaces.

Now, after that you need to be able to win your minigame. So in the top left of the screen, make an event. Start conditions "parallel process". Have 16 fork conditions to check if all 16 coordinate switches are ON set (without an else case). Under the last fork statement, have it change switch minigame won ON set. Make a second page for that event. Start conditions should be switch "minigame won" ON set. put whatever you want to happen when you win under that page. Make a door open or something.

Send me a GW mail if you have any questions, comments, or answers to the minigame, or if you just need some clarification.