RPG Maker Forums

I am trying to create a puzzle in rpgmaker vx ace similar to the famous "Lights Out" puzzle.


If you are unfamiliar, Lights Out is a game where you are given a grid of lights that you can turn on and off. The object of the game is to completely turn off all lights in the grid. The catch, however, is that if you toggle a light, every adjacent (top,bottom,left,right) light to the one you toggled will toggle as well, so it makes it tricky to find a way to turn every light off without accidentally turning on another one. You can try it out for yourself and see how it works here:
http://www.logicgamesonline.com/lightsout/


My idea for how this should be approached is by creating an event, that when activated, will call a common event while at the same time switching to another event page with a different graphic. 







Each event would have its own private variable to determine its graphic.


The part that I need help with is the common event's first action, which would be to check every adjacent tile to the one clicked, and if its variable is >0, then subtract 1. If its variable is <1, then add 1. This can probably be done with event commands that would take up a huge amount of lines, but I feel like a script for this would be at most 7 lines. I'm not sure.


Can somebody help create a script that would do this? Is this method even convenient? If so, how would you go about creating a puzzle like this?


EDIT: Do not worry about the player not being able to reach tiles in the middle of the puzzle, for I am using a mouse system script in my game. Because of this, I would appreciate it if you didn't utilize the player's XY position on the map in the script.

Latest Threads

Latest Posts

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,047
Messages
1,018,539
Members
137,834
Latest member
EverNoir
Top