OK, I'd suggest having the Door opening dependant upon a Variable. The Door is Open only if the Door_Open Variable takes on a certain value. I'd initialise the Door_Open Variable to 0, and all the Pillars to a colour other than Yellow. Each Pillar Adds a specific value to Door_Open if it turns Yellow. If it is already Yellow, but turns to any other colour, it subtracts this value. For a 2-Pillar Game, I'd have Pillar 1 add or subtract 1 to Door_Open. The second Pillar adds or subtracts 2 to Door_Open. The Door opens only if Door_Open has a value of 3.
For a 3-Pillar Game, the third Pillar adds or subtracts 4, and Door_Open needs to be 7 to Open the Door. For a 4-Pillar Game, Pillar 4 adds or subtracts 8 to Door_Open, and the Door Opens at a value of 15. Each Pillar adds or subtracts the next binary number, the Door Opens at the total of these numbers.
So, in Pseudo Code...
Can you turn that into MV commands, and see if it fits your needs..?
For a 3-Pillar Game, the third Pillar adds or subtracts 4, and Door_Open needs to be 7 to Open the Door. For a 4-Pillar Game, Pillar 4 adds or subtracts 8 to Door_Open, and the Door Opens at a value of 15. Each Pillar adds or subtracts the next binary number, the Door Opens at the total of these numbers.
So, in Pseudo Code...
Pill_1 is Red
Pill_1_Colo=0
Pill_2 is Blue
Pill_2_Colo=0
Door_Open = 0
Pill_1 changes colour
Test...
If Pill_1_Colo=0 // Pillar 1 is not Yellow
If Pill_1 is Yellow // Pillar_1 has turned Yellow
Pill_1_Colo=1 // Indicates that it's now Yellow
Door_Open=Door_Open+1 // Add binary value to Door
Endif
else // Pillar is no longer Yellow
Pill_1_Colo=0 // indicate that it's another colour
Door_Open=Door_Open-1 //remove binary number from Door
Endif
Repeat above for Pillar 2, but adding or subtracting 2, instead of 1...
Pill_2 changes colour
etc...
Test Door_Open
If Door_Open = 3
Open Door
Repeat all above
Pill_1_Colo=0
Pill_2 is Blue
Pill_2_Colo=0
Door_Open = 0
Pill_1 changes colour
Test...
If Pill_1_Colo=0 // Pillar 1 is not Yellow
If Pill_1 is Yellow // Pillar_1 has turned Yellow
Pill_1_Colo=1 // Indicates that it's now Yellow
Door_Open=Door_Open+1 // Add binary value to Door
Endif
else // Pillar is no longer Yellow
Pill_1_Colo=0 // indicate that it's another colour
Door_Open=Door_Open-1 //remove binary number from Door
Endif
Repeat above for Pillar 2, but adding or subtracting 2, instead of 1...
Pill_2 changes colour
etc...
Test Door_Open
If Door_Open = 3
Open Door
Repeat all above
Can you turn that into MV commands, and see if it fits your needs..?