Another pillar puzzle

So I understand the variable numbers when it comes to puzzles. This time I'm trying to see if I can use variables without numbers. Such an example are four pillars with four different colors: red, blue, yellow, and green. All must be yellow, thus the player has to change each pillar to yellow. The catch is that each pillar can vary from 1 to 4 color scenes. Such an example is the first pillar, red, can only change to a color if the player touches that pillar. However, lets say pillar blue is touched, the pillar would activate three other pillars to change colors just by touching that pillar; as such, red be blue, yellow be green, and blue itself be yellow. I was trying to see if redPil = yelPil under variables would work as a test, but the door doesn't show in the test. This means I'm doing something wrong.


I know I'll be using control switches and variables.
@Aurawhisperer...


It's as easy to do conditional branching with strings (words...) as with numbers, especially if one has control over upper and lower case. It's cumbersome, however. An alternative which can sometimes apply is to have a mathematical equivalent of the words. As an example, I use a binary affectation to see if I have a certain combination (well, a series of combinations, actually...). I have 8 elements, and give them a value of 1, 2, 4, 8, 16... You get the idea. Every combination is unique, so I only have to compare a series of numbers, which are obtained by arithmetically adding the individual elements. Another advantage is that I use exactly the same procedure for four different sets of elements in my Project, only changing the affectation. The maths remains the same for each of them, as the elements are manipulated only in this symbolic form.


Not sure if this exact procedure applies to your case, but I'd put it all out on paper, then think hard as to how to 'model' what's needed, before going down the 'hard text' route. Sometimes it's the only way, though.


Hope this helps.
Alright. Another thing too I've noticed about changing colors (Doing this as a test and for fun to understand JavaScript) is that I looked at your previous project on switches in July. Only difference is that it was on selfswitches; however, I was able to figure out control switches. Same syntax, different definitions.


That said, I type out a script $gameControlSwitches.setValue(changeBlue, true) to change the pillar color and it works! However, if I were to say touch the pillar again, and the next page states $gameControlSwitches.setValue(changeBlue, false), then $gameControlSwitches.setValue(changeYellow, true) should've enable the pillar to change yellow, but instead stay blue. Am I doing something wrong?
Give each pillar 4 pages (Red, Green, Yellow, Blue)



Each page has the condition that a one of 4 variable is set to the numbers 0-3 corresponding to a different color (ex red = 0, blue = 1, etc.)

Give each pillar a default state (ex Red) and make sure the variables are initially set

Then have each pillar on touch increase or decrease the variables accordingly (and then use a conditional branch to see if they are above or below 1 or 4 and if they are set them back)

Edit: The logic would look something like this (I used buttons because they were color coded already)
capture16zzd.png




Just expand that to 4 pillars
@Aurawhisperer...


Yes, and it's a common mistake. You're confusing our human interpretation with that of a formal, rigid System. In context, the term 'changeBlue' does not refer to a colour at all. It's just a name, a symbol, a pseudo. It could just as well be 'numbSkull', or 'aaBa', or switchOne. It bears no relation to its colour, so changing its Colour attribute does not change its Name attribute. If you're going to change colours, I'd be wary of naming the Events thus; it'll be constant source of confusion. If you've four of these pillars, call 'em Pillar1, Pillar2 etc and be done with it.


Hope this helps.
Give each pillar 4 pages (Red, Green, Yellow, Blue)



Each page has the condition that a one of 4 variable is set to the numbers 0-3 corresponding to a different color (ex red = 0, blue = 1, etc.)

Give each pillar a default state (ex Red) and make sure the variables are initially set

Then have each pillar on touch increase or decrease the variables accordingly (and then use a conditional branch to see if they are above or below 1 or 4 and if they are set them back)

Edit: The logic would look something like this (I used buttons because they were color coded already)



My one question to this is, with the pages, those goes under the pillar orbs themselves and not the switches? Because I try doing the four pages under the switches and it did absolutely nothing until I decrease it to one page.
My one question to this is, with the pages, those goes under the pillar orbs themselves and not the switches? Because I try doing the four pages under the switches and it did absolutely nothing until I decrease it to one page.


I'm not quite understanding what you are saying could you perhaps screenshot it?

The logic would go on whatever you interact with (the increase blank by 1). The pillars would then be changed according to the variable.
Saple1.png
Unsure how I'm going to call whether all pillars are yellow or not. The if conditional is very limited on what to choose
Unsure how I'm going to call whether all pillars are yellow or not. The if conditional is very limited on what to choose


You need to choose which number (ex 0 = red, 1 = blue, 2 = yellow, 3 = green) corresponds to which color and build your logic around that

Then when all 4 variables are equal to the correct color (ex. 3) something else happens.

Now for changing the pillars.
You create 4 events, 4 pages per event, and 4 variables.



First Create the 4 events


Event 1: Pillar 1
Event 2: Pillar 2
Event 3: Pillar 3
Event 4: Pillar 4

Then Name Your Variables so you don't lose them
Variable Name: Pillar 1


Variable Name: Pillar 2


Variable Name: Pillar 3


Variable Name: Pillar 4

Next Create 4 Pages on each event
Page 1: has event graphic for the pillar being red


Page 2: has the event graphic for the pillar being blue
Page 3: has the event graphic for the pillar being yellow
Page 4: has the event graphic for the pillar being green

Then Under Conditions on each event check the box next to "Variable" and set the following conditions (do this per event as well)


For: Event 1


Page 1: Use the Condition Variable: Pillar 1 ≥ 0


Page 2: Variable: Pillar 1 ≥ 1
Page 3: Variable: Pillar 1 ≥ 2
Page 4: Variable: Pillar 1 ≥ 3

Repeat for Events 2-4 using the other variables



Finally, drop your logic into each event page to increase or decrease each variable as you desire (which will change the colors)
 
Alright, mayhap I got us both confused. I have the pillars separate from the orb. The orb is the one changing colors if variable is greater or = to whatever num. The pillar itself is only the switch. It's doing all the mechanics within that one event, whereas orb is calling out to pillar. Here's what I have in other words:

Saple1.png

Saple2.png
Aside form taking out the two variable numbers that were at first in line before the conditions hit. It was changing all the orbs to blue
You get one variable per pilar. So the conditional branches for that pilar use the same variable as the change variable commands.
Alright, mayhap I got us both confused. I have the pillars separate from the orb. The orb is the one changing colors if variable is greater or = to whatever num. The pillar itself is only the switch. It's doing all the mechanics within that one event, whereas orb is calling out to pillar. Here's what I have in other words:


View attachment 50271


View attachment 50272


The general setup looks good. I'm not sure what you are doing with the redPil >= 0 though. Check the box on the ORB page on the left side under "Conditions" that says "Variable" and then on each page set the conditions to 0, 1, 2, 3. A different condition for each page.
@bomblord check again. He is somehow checking different variables but changing the same one...
@bomblord check again. He is somehow checking different variables but changing the same one...

Yea, like I said I'm not entirely sure what he's doing there. I'm guessing it was confusion on when I said to


Page 1: Use the Condition Variable: Pillar 1 ≥ 0
Alright, so I fixed the whole orb thing and was able to get the pillar switch active. But that still leaves the door. It continues to open automatically when I first start testing. It's suppose to open when all four orbs are read yellow. JavaScript I can tell, is rather hair pulling. When using the block conditional phases, I am defining variable under variable, as an example that I have setup. If Orb1_active (which is only active if orb1 is yellow. Will provide pics) if Orb1_active = yellow, if understanding the language, this means if orb1_active is yellow, it's true, thus open the door. Else, don't open.

Saple1.png

Saple2.png
@Aurawhisperer...


I'm sorry, but I'm completely baffled by the above post. I can make no sense whatever of what the problem is, nor how you've tried to solve it. It's not helped by the (apparently identical...)  screen shots which bear no relation to the text.


Could I suggest that, instead of using MV, you use just simple, step by step notions of what you want to achieve, that I, or others, could translate for you into MV steps to be taken..? It would appear that there is great confusion as to what constitutes a Condition, a Variable and a Switch. I'm sure there's a simple way of getting the result you're after, but it won't be by mixing all of this up in this way.


Although, maybe it's me; it's getting late, and I'm old...
@Aurawhisperer...


I'm sorry, but I'm completely baffled by the above post. I can make no sense whatever of what the problem is, nor how you've tried to solve it. It's not helped by the (apparently identical...)  screen shots which bear no relation to the text.


Could I suggest that, instead of using MV, you use just simple, step by step notions of what you want to achieve, that I, or others, could translate for you into MV steps to be taken..? It would appear that there is great confusion as to what constitutes a Condition, a Variable and a Switch. I'm sure there's a simple way of getting the result you're after, but it won't be by mixing all of this up in this way.


Although, maybe it's me; it's getting late, and I'm old...

I dont know how else to explain it. All I'm trying to do is trying to make a pillar puzzle, one of which revolves around orb changing colors and calling a specific color to open the door. Variable math to define each pillar that'll react differently and represent the orb color depending on the math defined under that orb, and if all four pillars have yellow orbs, the door opens. The only way I can translate is under pseudocode. 


Start pillarProgramExample


Set Int Pillar1, Pillar 2


Set Int pillarMath


//pillar ints set


Set String Orb1, Orb2, Red, Yellow


//define all strings


//each pillar provide an option to access pillar use. Player will activate each pillar to try and get the right orb color


//example displayed


if(Pillar1 is active)


{


pillarMath == 2


}


Do


{


if(pillar1 == pillarMath)


{


Orb1 == Yellow


}


if(pillar2 == pillarMath)


{


Orb2 == Red


}


If(Orb1 == Yellow && Orb2 == Yellow)


openDoor active


else


puzzle keep going


}while(puzzle isnt solved)


Get openDoor


End


Best I can explain in short verse
Ok, I know the problem.


...You haven't been doing what we say. Maybe we didn't explain properly?


You'll need variables, yes, but you are used them wrong. They are not linked to the colors, but to the orbs they change the color of. This has been said many times.


0 is red, 1 is yellow, 2 is blue and 3 is green. Or another order. Or you can change the shape instead of color. The point is, the variable is for the orb, not the color.


The pillars, if all they do is change the color of the orbs, they just change the value of the respective orbs' variable. The orb's variable, not the color's.


Now, for the door opening by itself, it gets a bit trickier. You'll need another variable and a switch.


Make a new, Parallel Process event. First, add a wait of 5 frames (you can also put this in the end, as long as it is in one of the two it is fine).


Now, set Count variable to 0.


Make a Conditional Branch, and if the Orb1 variable is in the number of the color you want add 1 to Count.


Repeat for every orb, using their variable.


In the end, add a last conditional branch to check if Count is the number of orbs you wanted. Put inside it to turn the switch "Door Open" on.


You can use the Count variable for other puzzles if you want. All it does is count the result.


If you make a new page for the orbs for when the switch is on you can even set the Orb# variables to 0 and use them somewhere else too.

Original thread: https://forums.rpgmakerweb.com/threads/another-pillar-puzzle.69858/