Boulders on switches puzzle problems

Ok... So I just watched a tutorial for how to make the "Boulders on switches to open a door" style puzzles. The problem was, the listed solution is SUPER tedious! It requires two variables for EVERY piece of the puzzle, then a conditional branch for each piece of the puzzle combined with each possible solution. There are 7 pieces in my puzzle and 4 switches. Only three of the switches could really result in a solution without trapping the player (the final has to be stepped on by the player upon exiting). Needless to say I don't feel like putting in 28 conditional branches for each single puzzle in a dungeon. I simply don't have the time! Do I need to abandon this style of puzzle until I'm not racing a clock, or is there an easier way of pulling this off?
I'm using MZ for this project. Also, bonus if this can be done WITHOUT scripts or plugins.
Moved to: MV Support

Game Mechanics Design is for discussing mechanics, not for getting help to actually implement something.

Try using regions on the locations where the boulders need to be moved to, then each time a boulder is moved, check if all your boulder events are on the required region, and if they are, the puzzle is solved.
Ok... So I just watched a tutorial for how to make the "Boulders on switches to open a door" style puzzles. The problem was, the listed solution is SUPER tedious! It requires two variables for EVERY piece of the puzzle, then a conditional branch for each piece of the puzzle combined with each possible solution. There are 7 pieces in my puzzle and 4 switches. Only three of the switches could really result in a solution without trapping the player (the final has to be stepped on by the player upon exiting). Needless to say I don't feel like putting in 28 conditional branches for each single puzzle in a dungeon. I simply don't have the time! Do I need to abandon this style of puzzle until I'm not racing a clock, or is there an easier way of pulling this off?
I'm using MZ for this project. Also, bonus if this can be done WITHOUT scripts or plugins.
Hi there!

I have an old tutorial, on my old youtube channel, that you can use. The problem is that I'm speaking Portuguese-brazil.
But the events and switch names are all in English.

Basic - Just explaining the logic.


Advanced - Make everything automatically with common events and self switches. Can copy-paste on any map.
Moved to: MV Support

Game Mechanics Design is for discussing mechanics, not for getting help to actually implement something.

Try using regions on the locations where the boulders need to be moved to, then each time a boulder is moved, check if all your boulder events are on the required region, and if they are, the puzzle is solved.
Doesn't this mean you put it in the wrong area? This is for MZ, not MV. Also, isn't this a question about game mechanics? If a question about how to make a game work in a certain way isn't game mechanics, I'm not sure what you'd classify in that category. Kinda making it impossible for me to know what belongs where. This isn't the first time I've had confusion regarding this, and I know that I'm not the only one, and I'm not TRYING to break the rules, so perhaps update the rules to be more clear?
try this:
-on boulder positioned, add +1 to a variable.
-on boulder removed, subtract -1 to the variable.
-on variable > X, validate.

1 variable, 1 conditional.
since variable starts always at 0, and there cannot be a -1 before a +1, it'll never go below 0.

additionally, you can use set theory and check everything at once.
grab the coordinates of the buttons and the coordinates of the boulders, and perform an intersection.
if the number of results > X, validate.
doesn't matter which boulder goes where, as long as each boulder is on a switch.
try this:
-on boulder positioned, add +1 to a variable.
-on boulder removed, subtract -1 to the variable.
-on variable > X, validate.

1 variable, 1 conditional.
since variable starts always at 0, and there cannot be a -1 before a +1, it'll never go below 0.
Yes, but from the tutorial I saw, the only way to tell that the boulder was where it was supposed to be was through that complicated series of conditional branches. I'm starting to think that I'm expecting to much, here. I keep thinking there's gotta be a simple way to work these puzzles, but most of the responses I get are either extremely complicated (and often assuming that I know more than a beginner who's only barely finished the tutorial basics), or require a plugin/script. Maybe I should start seeing what sort of puzzle maker plugins are available? Is there such a plugin that makes putting various puzzles together simple? If not, could someone much smarter than me who makes plugins make that. Gonna be honest, at this point I'd pay for such a plugin, especially if it was compatible with VX Ace (which is my MAIN engine). This is saying a lot, because I'm REALLY cheap. 😛
"How do I implement this mechanic in my game" is a support question and should be posted in the relevant Support forum for whatever engine you're using. Game Mechanics Design is for discussion about a mechanic in general - what would make it good, what could go wrong, how could you improve it.

I gave you a way to do it. Did you even read it? It seems not, because you haven't mention that you tried or asked any further questions.
Let me be summarize what the tutorial basically said:

Basically, you set up variables controlled by the position of EACH piece, boulders and switches. You then set up conditional branches for each boulder on each switch (and for the player since he can stand on the switch as well). Like I said, it seems needlessly tedious. I understand, however, that any sort of coding can be tedious and this is still easier than coding in a raw language. I'm just griping because I am watching my time dwindling and realizing that if I have to spend this sort of time on each puzzle, I'm not going to make the deadline for this game.
the only way to tell that the boulder was where it was supposed to be was through that complicated series of conditional branches
set theory.
grab the coordinates of one and the other, and mash them together.
if it results a TRUE, they're at the same location.
don't check for equals, and don't check for individual axis... check the whole set.
that's what set theory is there for.
"How do I implement this mechanic in my game" is a support question and should be posted in the relevant Support forum for whatever engine you're using. Game Mechanics Design is for discussion about a mechanic in general - what would make it good, what could go wrong, how could you improve it.

I gave you a way to do it. Did you even read it? It seems not, because you haven't mention that you tried or asked any further questions.
I'm sorry about that. I was admittedly frustrated by the decision as the reasoning (even now) seems wonky. That's neither here nor there, however, as this isn't the place for that discussion.

As for your suggestion, it does seem like it might work. The only issue is that I'm not sure how to set things up to detect that the boulders are in the right zones. That does certainly seem like it would take FAR less work to implement, however, as I'd just have to say "once so many boulders are in this zone, unlock this." Please feel free to explain this in the simplest possible terms. I promise not to be offended. I am very aware of my shortcomings in terms of my current skill level at using the software.
Edit: Yeah, I'm seriously lost. I thought to myself that maybe I could search for zone data, but the only thing I've been able to figure out about zones is that you can set specific encounters for specific zones, but that system is very simple and intuitive.
I am not sure I completely follow your scenario - are you saying there are 7 boulders and 4 switches, and that to complete the puzzle, you need 4 of those boulders on the switches?

If so ...

Use a region to draw over each of the switches - the same region for each one (I'll use 15 as an example).
Create 1 boulder, and in the event commands, make it move, and after it's moved, call a common event. Copy/paste your event 6 more times and move them wherever you want - they will all be exactly the same. I'll use events 20-26 as an example.

Create a common event that looks like this:

Code:
Control Variables: Counter = 0
Get Location Info: Variable: Region; Info Type: Region Id; Designation by character: Event 20
Conditional Branch: Variable: Region === 15
  Control Variables: Counter += 1
End
Get Location Info: Variable: Region; Info Type: Region Id; Designation by character: Event 21
Conditional Branch: Variable: Region === 15
  Control Variables: Counter += 1
End
Get Location Info: Variable: Region; Info Type: Region Id; Designation by character: Event 22
Conditional Branch: Variable: Region === 15
  Control Variables: Counter += 1
End
Get Location Info: Variable: Region; Info Type: Region Id; Designation by character: Event 23
Conditional Branch: Variable: Region === 15
  Control Variables: Counter += 1
End
Get Location Info: Variable: Region; Info Type: Region Id; Designation by character: Event 24
Conditional Branch: Variable: Region === 15
  Control Variables: Counter += 1
End
Get Location Info: Variable: Region; Info Type: Region Id; Designation by character: Event 25
Conditional Branch: Variable: Region === 15
  Control Variables: Counter += 1
End
Get Location Info: Variable: Region; Info Type: Region Id; Designation by character: Event 26
Conditional Branch: Variable: Region === 15
  Control Variables: Counter += 1
End
Conditional Branch: Variable: Counter >= 4
  ... puzzle is complete - do whatever step you want next
End

Two variables.
I am not sure I completely follow your scenario - are you saying there are 7 boulders and 4 switches, and that to complete the puzzle, you need 4 of those boulders on the switches?
Technically 3, as it's not possible to get the boulders in the places and still exit the puzzle, but yes, in essence. I was thinking that the player would be one of the things that could activate one switch.
So, the only thing I wonder about, is If the player steps off of their switch, does the counter stay increased by 1? I suppose I could do things this way and just remove the last switch. Thinking about it, it's not really necessary, I just thought it looked more... right?

As for the rest, thanks for spelling it out! I think I have the gist of what I need to do. Actually, it's lucky I watched that tutorial after all if for no other reason than getting location info like that was one of the things covered. I didn't understand what you meant, though, until I saw the code. I'm going to implement that now and post how it all works out!

Edit: Okay. I feel like an idiot. The puzzle manager event was set to "action button" instead of "Autorun"

Updated the puzzle manager to run "parallel." This worked. That was so much faster than the other way!
While we're on the topic, though: Supposing that a player messed up and made the puzzle unsolvable by moving a tile to the wrong place. Is there a quick way to reset the pieces? I understand that sometimes leaving and coming back to a room can do that, but A: That would be terribly inconvenient for the player, and B: I want to make sure that not everything resets when I leave. I feel like there was a tutorial that covered this, but can't remember where.
I wouldn't use an autorun OR an action button event. The counter will recalculate each time a boulder moves.

If you want the player to be able to activate a switch as well, then make each one a Player Touch event, set it to THROUGH (so the boulders will move there as well), and make each switch also call the common event. Then in addition to checking the region of each boulder event, also check the region of the player.
I wouldn't use an autorun OR an action button event. The counter will recalculate each time a boulder moves.

If you want the player to be able to activate a switch as well, then make each one a Player Touch event, set it to THROUGH (so the boulders will move there as well), and make each switch also call the common event. Then in addition to checking the region of each boulder event, also check the region of the player.
Yeah. Autorun was a mistake. I had to set it to "parallel" Otherwise the player just freezes up because it's forever waiting for an event to be over that never ends because it's designed to constantly work.

Original thread: https://forums.rpgmakerweb.com/threads/boulders-on-switches-puzzle-problems.138381/