[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
14,707
Reaction score
14,534
First Language
Filipino
Primarily Uses
VNM
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

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,466
Reaction score
10,866
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.

Moving to RPGMaker MV


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
1,399
Reaction score
879
First Language
EN
Primarily Uses
RMMV
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

Brother made thumbnails for my Lets Plays. He's a swood dude.
Since I'm getting so busy (the fact that I'm often here is due to the fact that this is my procrastination #1 destination), I'm trying a new system where everyday I dedicate 30 minutes to my personal game project. That way it won't fall into the abyss.
In today's seminar:
Presenter: In the past, there was a saying, "One who has tuberculosis is doomed for life." But now-
Everyone: *starts coughing in unision*
Gosh... Today seems too much like a good day to do nothing....

I need to keep myself focused...! :kaoback:

Forum statistics

Threads
93,699
Messages
914,743
Members
123,300
Latest member
jamssi
Top