[RPGMV] Undefined switch error

● ARCHIVED · READ-ONLY
Started by OusatsuZansatsu 5 posts View original ↗
  1. 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?
  2. 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.

  3. 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.
    .
  4. 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.
  5. Archeia said:
    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!