[RPGMV] Undefined switch error

OusatsuZansatsu

Villager
Member
Joined
May 3, 2018
Messages
8
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hey, I'm still kind of new when it comes to using RPG maker and I'm completely clueless when it comes to coding so I'm hoping someone can help me fix this issue I have.

I'm working on a puzzle where the player has to make the right room match with the left room next to it. I have switches set up so that when the player goes to change the right room, it'll change to match with the left room. That works just fine but the problem is I wanted the game to know that once all these switches are turned on, it'll activate a switch that allows the player to go into a room they couldn't get in before.

So I tried using an else if statement to check when all the puzzle match switches are on, it'll automatically turn on the switch to unlock the way to the inaccessible room.
Undefined script event RPG maker.PNG

But when I go to play test my game I get this error
Undefined RPG maker.PNG

Does anyone know a way to fix this or a better way to help execute this puzzle?
 

Archeia

Level 99 Demi-fiend
Developer
Joined
Mar 1, 2012
Messages
15,141
Reaction score
15,473
First Language
Filipino
Primarily Uses
RMMZ
EDIT: I just realized you're using RPG Maker MV which has different syntax. The correct one would be here.

It should look something like this if you use the Condition command (not script):
Code:
($gameSwitches.value(1) == true) && ($gameSwitches.value(2) == true) && ($gameSwitches.value(3) == true)
upload_2018-7-28_0-56-11.png

You can also use === sign if you want to be safer. If you only use a single = it means "set to"


Moved from RGSSX Support to Javascript/Plugin Support.

 
Last edited:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I'm going to move this again, as Plugin Support is for when you need help to use a particular plugin. Here, however, it appears to be pure eventing.

[mod]Moving to RPGMaker MV[/mod]
As an aside, if you are now primarily using MV, you might like to amend the info under your avatar so that people are clear about which engine it is.
.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,087
Reaction score
1,508
First Language
EN
Primarily Uses
RMMZ
Also, autorun events repeat indefinitely while active and prevent the player from being able to move in the meantime, so I'd recommend you do one of the following:
  • If it should run repeatedly in the background: change the trigger to Parallel.
  • If it should run once per visit to this map: add an Erase Event command to the end of the event.
  • If it should run once, the first time you visit this map: add a Control Self-Switches: ON or Control Switches: ON command to the end of the event, then click the New Event Page button and select the corresponding (self-)switch in the Conditions box (top-left). This way, the second page (leave it blank with Action Button trigger) will replace the first page when it's run once.
 
Last edited:

OusatsuZansatsu

Villager
Member
Joined
May 3, 2018
Messages
8
Reaction score
0
First Language
English
Primarily Uses
RMMV
EDIT: I just realized you're using RPG Maker MV which has different syntax. The correct one would be here.

It should look something like this if you use the Condition command (not script):
Code:
($gameSwitches.value(1) == true) && ($gameSwitches.value(2) == true) && ($gameSwitches.value(3) == true)
View attachment 95347

You can also use === sign if you want to be safer. If you only use a single = it means "set to"


[mod]Moved from RGSSX Support to Javascript/Plugin Support.[/mod]
That fixed it, thank you!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:

Forum statistics

Threads
105,854
Messages
1,016,998
Members
137,562
Latest member
tamedeathman
Top