Trying to finish up wit my pillar puzzle. Need help

oh wow, this thread has gone on for MUCH longer than it should have.  You left out some very important information from your first post, and the screenshots you provide don't fill in that information.


Can I assume that all of the pillars can be any color, and each time the player presses, it changes color?  Nowhere in any of your screenshots did you say that (they show just a single colored orb per pillar), but I'm struggling to figure out how the player can NOT get the puzzle correct if each orb can only be one color - all they'd need to do is push the pillars once each.  In that case you're taking a WAY too complicated approach - there is no need for any self switches, and only one switch to signify the puzzle is solved, plus the variable for each pillar that you've already got.


If the way I described it is NOT how the puzzle is meant to operate, then ignore everything below.


I would create a character sheet for each of the orbs, so you don't have to haggle with two events for each pillar.  You could still do it the way you are, just put the same conditions on the pillar and orb events.


Create your first pillar event ...


Page 1 will have a yellow orb and no conditions.  If the player pushes on the pillar, set the Pillar1 variable to 1, and call the common event.


Page 2 will have a green orb and will be conditioned by the Pillar1 variable being >= 1.  In the event commands, if the player pushes on the pillar, set the Pillar1 variable to 2, and call the common event.


Page 3 will have a blue orb and will be conditioned by the Pillar1 variable being >= 2.  In the event commands, if the player pushes on the pillar, set the Pillar1 variable to 3, and call the common event.


Page 4 will have a red orb and will be conditioned by the Pillar1 variable being >= 3.  In the event commands, if the player pushes on the pillar, set the Pillar1 variable back to 0 (to start over), and call the common event.


Now, if you want the pillars to become non-responsive once the puzzle is solved (pushing the pillar won't do anything anymore), create a 5th page and set its sprite to whatever colored pillar this one should be to solve the puzzle, and its condition to the PuzzleSolved switch being on.  Don't add any event commands.


Now set up your other 3 events just like this one, but use a different variable in the conditions and in the Control Variables command.


Finally, ensure the common event compares each variable with the correct number needed to solve the puzzle.


If you want a switch for the player to reset everything, just make it set all of the variables back to 0.
Every Pillar that has to be reset when the answer is wrong will need its own Switch. If, dispersed around the Labyrinth, you've a dozen Pillars, it'll need a dozen Switches to turn them all back to their Page One Event. It doesn't matter about the colours, nor the Pillars in the Central Room where the enigma is posed, it's the Pillars that'll be pressed to compose the number that need to be reset; each will have its own Switch.


The other method I mentioned will work without extra Switches, if you carefully note the Map ID and the Event ID of each Pillar Event (it's easily visible in the Status Bar, right at the bottom of the screen, on the right when editing your Map...). With that method, a series of $gameSelfSwitches.setValue([1, 3, 'A'], false) (using your Map and Event ID's instead of the '1' and '3' in my example...)...) will make each of those Events turn back to Page One. Whatever you're most comfortable with.


Ask away when in doubt; it's better than ploughing ahead in error, or if it's not clear. Would example code or screenshots help..?


Edit: Here's a screen shot of a reset script call added to the version of 'Tales' that I'd downloaded ...

Spoiler
z7CIbtI.png





... and this is the text of the script call ...


/* Forest Temple Blue Pillar */
$gameSelfSwitches.setValue([15, 13, 'A'], false)
/* Chambre 1 Blue Pillar */
$gameSelfSwitches.setValue([17, 6, 'A'], false)
/* Chambre 1 Green Pillar */
$gameSelfSwitches.setValue([17, 5, 'A'], false)
/* B1RoomWetWing Green Pillar */
$gameSelfSwitches.setValue([19, 15, 'A'], false)
/* B1RoomWetWing Yellow Pillar */
$gameSelfSwitches.setValue([19, 16, 'A'], false)
/* Forest Maze Red Pillar */
$gameSelfSwitches.setValue([20, 19, 'A'], false)
/* Hidden Room Blue Pillar */
$gameSelfSwitches.setValue([22, 3, 'A'], false)
/* Hidden Room Red Pillar */
$gameSelfSwitches.setValue([22, 4, 'A'], false)



This works in the version I downloaded, and will work in yours as long as the Map and Event ID's are the same; if not, adjust to suit.


Any use to you..?

Well, I would rather educate myself better on the scripting behalf
for the game. The only issue is I don't know where to begin to locate
all the defaults to enable the code to function rather than error out.


 


To understand your logic under the code, as an example of
/* Forest Temple Blue Pillar */
 $gameSelfSwitches.setValue([15, 13, 'A'], false)
 
The first line is a comment base on what's going to function to
prevent confusion and clutter.


 


gameSelfSwitches is base on the self switches used in the game.


 


The setValue for ([]) indicates the cords of each pillar location, and to
determine the chosen value; thus example would be red and blue,
with their cords of [x, y]. Red is 2 and blue is 4. Times both making 8.
Lastly, false indicates the value to be false if the value does not
match up with the set value of 7.


 


I'm guessing then, $ means to reset the switches.


 


Am I accurate so far?
oh wow, this thread has gone on for MUCH longer than it should have.  You left out some very important information from your first post, and the screenshots you provide don't fill in that information.


Can I assume that all of the pillars can be any color, and each time the player presses, it changes color?  Nowhere in any of your screenshots did you say that (they show just a single colored orb per pillar), but I'm struggling to figure out how the player can NOT get the puzzle correct if each orb can only be one color - all they'd need to do is push the pillars once each.  In that case you're taking a WAY too complicated approach - there is no need for any self switches, and only one switch to signify the puzzle is solved, plus the variable for each pillar that you've already got.


If the way I described it is NOT how the puzzle is meant to operate, then ignore everything below.


I would create a character sheet for each of the orbs, so you don't have to haggle with two events for each pillar.  You could still do it the way you are, just put the same conditions on the pillar and orb events.


Create your first pillar event ...


Page 1 will have a yellow orb and no conditions.  If the player pushes on the pillar, set the Pillar1 variable to 1, and call the common event.


Page 2 will have a green orb and will be conditioned by the Pillar1 variable being >= 1.  In the event commands, if the player pushes on the pillar, set the Pillar1 variable to 2, and call the common event.


Page 3 will have a blue orb and will be conditioned by the Pillar1 variable being >= 2.  In the event commands, if the player pushes on the pillar, set the Pillar1 variable to 3, and call the common event.


Page 4 will have a red orb and will be conditioned by the Pillar1 variable being >= 3.  In the event commands, if the player pushes on the pillar, set the Pillar1 variable back to 0 (to start over), and call the common event.


Now, if you want the pillars to become non-responsive once the puzzle is solved (pushing the pillar won't do anything anymore), create a 5th page and set its sprite to whatever colored pillar this one should be to solve the puzzle, and its condition to the PuzzleSolved switch being on.  Don't add any event commands.


Now set up your other 3 events just like this one, but use a different variable in the conditions and in the Control Variables command.


Finally, ensure the common event compares each variable with the correct number needed to solve the puzzle.


If you want a switch for the player to reset everything, just make it set all of the variables back to 0.

Well, I went from changing colors to solving math problem solving. Using the pillar colors in the main room, will define the proper value of each pillar of its own. Example is red will be -1, green is +2, yellow is /3, and so on. Then throughout the dungeon, scatter other pillars with define values that match the defined values in the main chamber. Lastly, a switch is shown in the main room, which allows the player to activate; however, if the puzzle is wrong, it resets. If the puzzle is right, allows the player to gain entry further onward. And all of this work revolves around basic Please Excuse My Dear Aunt Sally. My only question behind basic math is that do the rules apply on the program from left to right or does it read the problem from right to left?


Other than that, giving credit to Dad for the script and pillar fix idea and sticking with the formula I have now. (Unless beta testers hate this idea...)
...


If the way I described it is NOT how the puzzle is meant to operate, then ignore everything below.


...



@Shaz


If I may, I'd like to elaborate just a little, as, I agree, this is taking a very long time to settle. I downloaded a 'work in progress' version of this Game, and, based on that, made it work in the way our friend AW wants it. His premise is that each coloured Pillar has a value attributed. The puzzle is to find, in several Maps, Pillars of the right colour, and press those, and only those, whose values will, mathematically, give a desired result (in the early version I had, the addition to come to 7...). So a press on one Pillar value 1, another Pillar value 2 and yet another value 4 would enable the exit when tested. Once pressed, each Pillar sets a Self-Switch so as to no longer react to being pressed. If, however, the result is not 7 (wrong Pillars pressed, or too few, or too many...), then all of the Pillars need to be reset, so that a new attempt can be made.


His question, after I'd sent an example of how to get the result to be 7, was how to reset the puzzle. That's where I suggested the two methods: either retain the use of Self-Switches and remotely reset them with a script, or, instead, abandon the use of Self-Switches completely and have a dedicated Switch on each Page 2 of each Pillar, so that a press could turn Page 2 On, but any Event (the reset one...) could turn Off each and every dedicated Switch, thus returning each Pillar to Page 1. Both methods work; one is slightly more 'sophisticated' than the other, as it involves using a line of Script. The simple method implies creating a dedicated Switch for each Pillar; no big deal if we're talking about les than a dozen, I'd have thought.


There are, of course, many ways to achieve a similar result; the emphasis from the outset was to have some pedagogic value re-usable for any future puzzles, not just a 'one-off' solution in a neat package. It seems to have backfired slightly, though..!


I hope this clarifies things, as there's a lot of mix-up creeping in... 

...


Am I accurate so far?



@aurawhisperer...


We're getting very, very mixed-up here. You're interpretation of the Script is, I'm afraid, way off the mark, and is, if you'll pardon my use of the expression, very much 'over-thought'. I'm all for pedagogy, but we'll have to get right back to a few basics before this can go any further. If you agree, I could create a simplified version of this Script, and send it to you to see what you make of it..? You won't be able to use these techniques unless you have a fuller understanding of exactly what the Script represents. Please don't feel offended; we all have to go through a learning process at some point, but we'll really have to back-pedal here if this is going to work. It is, I feel, a bit beyond just a few screen shots, or I'd do it here; a simple demo Project would, I think better suit.


Does this appeal..? How could we go forward, in your view..?
Yeah, I think my premise of one pillar could be any color and pressing would switch between them was wrong, so my solution not appropriate.


I'll leave you to it, and hope you can get it sorted out soon.  A simple puzzle like this should not be so complicated to implement.
...A simple puzzle like this should not be so complicated to implement.



Famous last words..! 
XHlPYfU.png
Odd I can't quote you, but yea, learning from your point of view won't hurt Dad. What do you have in mind, so that I don't always need to rely on building block switches?
@Aurawhisperer ...


Here's a simple, lightweight Project just to illustrate the two different fashions of turning Event Pages On and Off...


Switch.zip ...

Spoiler
MQ3Kpfw.png



The upper set of Flames use the Script method. The upper Colour Events each contain four lines of Script, each addressing a different Flame. The Yellow one turn Page 2 Off (therefore activating Page 1...), the Blue one turns the Self-Switch to On, so activating the Blue Pages. Here's a breakdown of the meaning of a line of Script ...


 $gameSelfSwitches tells the programme (MV...) that we're wanting to address Self-Switches...


setValue tells MV that we wish to set a Self-Switch Value (to be either true (or On...), or false (and so Off...)...


Brackets are opened to indicate that there are parameters to be passed...


The square brackets will contain the information required for MV to know which Self-Switch is concerned...


The first n° in there is the Map ID (can be found at the bottom of the Editor window, or at the top of the Map window when editing...)...


The second n° is the Event ID, which can be found at the bottom of the Editor window when the Event is selected, or at the top of the Event window when editing.


Then, between inverted commas, which of the four Self-Switches is concerned for this Event; 'A', 'B', 'C' or 'D'...


The square brackets are now closed; MV has all the information required to know which Self-Switch is to be addressed...


Then follows the Value required, either true or false...


... and finally the brackets are closed, end of line of Script.


The lower set do exactly the same thing, but with a different method. No Self-Switch is used; instead, each Flame Page 2 is dependant on a dedicated Switch, one for each Flame. The Colour Events simply turn ON or Off all of these Switches, thus activating or not the Page 2 of those Flames. It's very simply, and no Script or code is required. A normal Switch command will turn any one of those Flames On or Off.


Hope this helps.

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-finish-up-wit-my-pillar-puzzle-need-help.64756/