Trying to finish up wit my pillar puzzle. Need help

Well I did a test and do similar to what you did with your pillar idea, and have the switch setup occur all in one room and it works. So somehow when uses this pillar method in multiple rooms, it is not being saved worldly, which is a big problem due to the fact the puzzle will not work how I want it.



Switches are World-wide ('Global'...) and can be accessed from any Map. I've uploaded my 3-Map version to the same Google Drive; you could download it and see how my one works..? It didn't need much tweaking to do multi-Map anyway, so you must have something else going on. Could you zip yours up and post it over so as to have a look at it, or maybe a few screen shots of the essentials would do..?
https://drive.google.com/open?id=0B9PHElg7mCi7a3VJWWktSHRKWHc


Here's my work so far. Hopefully nobody steals the concept of it
Here's my work so far. Hopefully nobody steals the concept of it



Excellent; it works a treat. I had to 'cheat' slightly, by looking at the code of some Events, but the Traps worked, the Doors opened, the Pillars gave the right answer and I could walk up to the Guards at the end. Good stuff..!


I was very surprised by the sheer size of the download, and, after checking, realised why. I would strongly recommend keeping the 'game' files separate from the Tools and Archives that you have. All that RPG Maker creates is best kept clutter-free, with only the files made by or needed by the Project. I removed the Tools, and used MV Stripper on the Project; the result was 260 Mo, instead of 1.7 Go..! Nothing is lost in arranging things in separate folders, but it makes things far easier as time goes on. On a similar note, I'd also recommend having, in the RPG Editor, only the number of Items, Switches and Variable etc... as are required. If one runs short, it's simple to add another set of 20 or so, to be repeated as these get filled up. There is a case for having Items grouped, for ease of maintenance, and I would agree, but this implies having a fairly clear idea from the outset of how many of each group to allocate. Having thousands on hand, just in case, is not easy to work with over time. It also helps to name events of any importance, too. As a game grows, it becomes all the more difficult to remember where it all fits together, and the Event Searcher (under the 'Tools' menu...) is all the more useful if stuff is named.


Just sayin'; Your game is fine. I didn't get to check the 'bombs', but I see no reason why they won't work as expected.


Hope this helps; keep it up, you're doing fine..!


Edit: I did the 'bombs' bit, too; nice touch to have the cracked walls as a clue. One tiny detail, if you would..? The Moving Statue in 'B1RoomEastWing' should not be 'Walking', I don't think; it's not constructed for that. Direction Fix, that's all. Other than that (and a bit of spelling, but that's seems to be a quite common flaw...), it's good.  😎


(If you're paranoiac about piratage, you could delete your shared zip once you're happy that it's given you all the answers you require...)
But how did it work for you??? I have tested the pillars over and over again, and it doesn't work for me. It only goes to the else statement!
But how did it work for you??? I have tested the pillars over and over again, and it doesn't work for me. It only goes to the else statement!



I can only guess that it's because your Pillar Count is not equal to seven, then. (Ignoring the rock pushing and the like...) I go East, and press the Green Pillar (increments Pillar Count by 2, so Pillar Count = 2...). On to the Blue Pillar, which I press, which increments by 4, so Pillar Count is now 6. I then go West, through the Forest Maze and press the Red Pillar, which increments by 1. Pillar count is now 7 (verified with Debug, but 'logic' enough for me...). I return to the Main Room, activate the Gemstone on the Slab and the North Door grinds open. What am I doing wrong..?  :headshake:   😛


If I touch more (or less...) pillars, if the addition is not 7, then I, too, get the 'Else' reset and have to start again. I've not tried pressing only a Yellow and Blue Pillar (which should also work...). I see nothing wrong with the 'logic' of it. What are you doing differently..? Try my combination, maybe..?


Edit: There's a problem if one uses the Pillars in B1RoomWestWing, as they have, as a first line, a reset to 0 of Pillar Count. I'll do it again, going West first for the Yellow Pillar (Pillar Count to 0, then incremented by 3...), then East for the Blue Pillar, which should simply increment by 4, taking Pillar Count to 7. Back in a jiffy..


...


Yes, that works. I would suggest, then, that you've been counting on those two Pillars giving a simple increment, when it's not the case. I've looked at all the other Pillars (I think...), and they seems to be correct. Unless that's a deliberate ploy to trick folks, maybe that's the error you're after..? Check them out, anyway.
It strangely worked for me all of a sudden. Huh.


Well, now to do some adjustments. I want to make it an only one way puzzle. I plan to use add, sub, mult, and div. Mainly it's going to be mult, add, and sub. How will the math work on this?
I doubt that it's 'all of a sudden'; either you've changed something, or the way you're testing it. Harry Potter is fictional.


How will the maths work..? Write it out on paper first, and/or use a spreadsheet to simulate your processes before trying to code or create events. Once the 'logic' is working well, then do the Events. Use a pencil, and have a rubber ready.   😉
Well this is awkward I got it to work; however, it isn't how I wanted it. I was thinking at first the math would operate the same as actual coding, but instead it goes by original math. Anywho, I did this format: 4 * 2 - 1, but the puzzle wont work. But when I do 2 * 4 - 1, it works. Does the system not acknowledge *4 as a multiple?
Could you show us the code of the version not working, please..?
Bringing this thread back (want to thank dad for the support) The only issue I am having is resetting the puzzle if the combo is wrong. When combo is wrong and "suppose" to reset, the pillars are no longer active. And this is an issue.


How am I able to approach this?
@Aurawhisperer


Can you show us what it is that dis-activates the Pillars..? Maybe we can then suggest how best get them re-activated..?
View attachment puzzle.docx
@Aurawhisperer...


I think I see your problem. When your Pillar is triggered, it uses a Self Switch to turn to Page 2. You are wanting to have a means of returning to Page 1 in case of a Puzzle Reset, I think. May I suggest two methods...


1 - If you want to turn a Self Switch On or Off remotely (that's to say: not from within the Event itself...), it can be done by using a simple (famous last words..!) Script command in an Event. Here's the Script Call : 


To 'read a Self Switch, returns 'true' or 'false'... $gameSelfSwitches.value([mapId, eventId, switchLetter]), Self Switch])


Eg: $gameSelfSwitches.value([1, 2, 'A']) to read the state of the 'A' Self Switch of the Event 002 in Map 001.


To set  a Self Switch...  $gameSelfSwitches.setValue([mapId, eventId, switchLetter],value)


Eg: $gameSelfSwitches.setValue([1, 3, 'A'], false) to turn Off the 'A' Self Switch of the Event 003 on Map 001


2 - Another method is more simplistic, in that one doesn't use a Self Switch, but an ordinary Switch called, for instance, Pill_1_Page_2 or the like (other Pillars will have similar Switches attributed, called Pill_2_Page_2 etc...). Page 1, when triggered, doesn't toggle the Self Switch, but the Pill_1_Page_2 Switch instead; Page 2 is conditioned by this Switch, and is therefore activated. From anywhere, then, this, and all the other Pillar Page 2 Switches may be turned off, thus allowing Page 1 to be active again. A Switch for each Pillar is required of course.


Is this of any help..?
For the second one, wont pillar_active be enough for all thee other pillars? Or do they have to be individual? 
For the second one, wont pillar_active be enough for all thee other pillars? Or do they have to be individual? 



No, one for each, otherwise the first Pillar to be triggered would set all the other Pillars to Page 2 (Not Good, I think..?). Switches are free (without cost...); there's no real downside to using several, and it can greatly help clarity when reading through stuff a week or a month later, when all has been forgotten. I'm a great fan of naming Events, Variables and Switches etc, excepting the most mundane ones, giving them all explicative names (I use a four-letter discipline for this, hence 'Pillar' becomes 'Pill', 'Monster' becomes 'Mons' etc...) It saves so much time and trouble later on, and has become, over the years, a habit I'm loth to break.


Enough chatter; a Switch for each Pillar will work fine for you, I'd say. The Script method becomes useful when wanting to 'calculate' which Self Switch to manipulate, as the numbers in there can be driven by Variables. You're not (yet...) in those murky waters, so I'd recommend the simpler, more readable route of an ordinary Switch for each Pillar instead of the Self Switch.
So seeing there's only four pillars with four diff colors, four diff switches is good? Or have to label each and every pillar a certain number, don't matter what color they are? That's my last question onto understanding this
So seeing there's only four pillars with four diff colors, four diff switches is good? Or have to label each and every pillar a certain number, don't matter what color they are? That's my last question onto understanding this



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..?
Apologies for later response. Been busy and exhausted of late. I'll try and test this sample out. I'd like to understand what you mean though with every switch. I mean, if going with that route and the x amount of pillars, I'm looking at a total of 12-14 switches made. Half are to active, half are to reset if puzzle is wrong. Accurate?
Also, wow. That script sounds so close to C# code, even though I know this program is not made as C#. But the (), ",", and false use sounds so familiar.
... if going with that route and the x amount of pillars, I'm looking at a total of 12-14 switches made. Half are to active, half are to reset if puzzle is wrong. Accurate?



Not quite. In the Project that you sent me, there are eight Switches. I created a Switch for each one. A Switch can have two states, On or Off. Thus, each Page 2 of each Pillar can be active or not. When the Switch is On (Pillar has been pressed...), Page 2 is active, and the Pillar will no longer react to being pressed. Once the reset is activated, however, every Switch is set to Off, so all Pillars, whether they have been pressed or not, will revert to Page 1, ready to react to any pressing. Each Page 2 of each Pillar is governed, no longer by a Self-Switch (which is how you've been doing it...), but by its own dedicated Switch, which a reset Event can turn Off. One reset Event can thus turn Off each and every Pillar's Page 2.


As for the code itself, many (most..?) IT languages have a very common root, with much similarity. Unfortunately, as goes the expression, 'the devil is in the detail'. It's not the key words themselves that make things different, but the syntax rules (which form of brackets to use, and when..?), their structures (declarations and types to be made at the outset or not..?) and their specific method of dealing with global or local variables, parameter passing and much, much more. It's useful and instructive to comb through simple codes such as the scripts I use, and little by little a certain familiarity is installed. It takes a great deal more, though, to pour out these splendid plug-ins that we have available to us. I'm far from ready to even contemplate such a move; I'll stay 'humble grasshopper' for quite a long time yet..!


Keep the questions coming if it helps; hoping to have clarified, even slightly.

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