A Red-blue eyeball puzzle

I have no idea what else to call it. It's the puzzle from Link's Awakening shown here:










I tried using variables as switches and then turning them off and on by multiplying them by -1, but that didn't seem to work because the events on the same tile would work simultenously.


Any suggestions?
I've done this before.


Basically, you want to set up at least two pages for each "eyeball" - one with a Red graphic and one with a Blue graphic.  Let's call the Red "ON" and the Blue "OFF".  Give each one its own separate switch.  For the first (upper-left) eyeball, if you toggle this eyeball it will also toggle the second (upper-middle) and fourth (center-left) eyeballs, so you should use the following eventing for the Red page when the first eyeball is checked/attacked:


If Switch 1 (Upper Left Eyeball) is OFF


    Turn Switch 1 ON


Else


    Turn Switch 1 OFF


End


If Switch 2 (Upper Middle) is OFF


    Turn Switch 2 ON


Else


    Turn Switch 2 OFF


End


If Switch 4 (Center Left) is OFF


    Turn Switch 4 ON


Else


    Turn Switch 4 OFF


End


Then, add this exact same eventing to the Blue page.


Now, you must do similar eventing for the other switches.  When the player checks/attacks the upper-middle (2) eyeball, it will also affect the upper-left (1), upper-right (3), and center-middle (5) eyeballs.  So instead of 1, 2, and 4, do the eventing for 1, 2, 3, and 5 on this event.


Keep going until you've done it for all 9 eyeballs.  As a quick reference:


When you hit 1: toggles 1, 2, 4


2: 1, 2, 3, 5


3: 2, 3, 6


4: 1, 4, 5, 7


5: 2, 4, 5, 6, 8


6: 3, 5, 6, 9


7: 4, 7, 8


8: 5, 7, 8, 9


9: 6, 8, 9


Grid:


1    2    3


4    5    6


7    8    9


Finally, have a Parallel Process event that checks every few frames whether all 9 switches are ON (be sure to add a Wait of a few frames at the beginning or end).  If all 9 switches are ON, the puzzle has been solved.
I'm having the same problem as with the variables: the 'off' orb is overwriting the 'on' orb sprite. The execution is working, but it just won't visually confirm it.


edit: actually, I removed the off sprite and while I can turn the switch off and on (confirmed by a separate tile sprite) the orb sprite itself does not change. So something weird is going on.
Could you show some screenshots of your event pages for one of the orbs that isn't working, including the event page numbers and conditions? It sounds like the problem lies in the page activation somewhere. 
Could you show some screenshots of your event pages for one of the orbs that isn't working, including the event page numbers and conditions? It sounds like the problem lies in the page activation somewhere. 

Sure!

On orb.PNG

Off orb.PNG
Switch the two pages around, so that the red orb with the switch condition is on page two and the blue orb on page one.


The page with the higher number overrides the other when the conditions are fulfilled. Since your page two has no conditions, it will always be active, and the program doesn't even "look" at page one.


If the switch condition is on page two, the program still looks at page two first, but when the condition is not fulfilled (switch is off), it looks at the page with the next lower number, page one in this case. Page one has no conditions, so it can run.


Hope that made sense 🙂
Thank you, I did not know that!


It works with just one orb. If the interaction seems to break the execution again, I'll reply for some more help.
It works perfectly!


Thank you for your help.

Original thread: https://forums.rpgmakerweb.com/threads/a-red-blue-eyeball-puzzle.72937/