Page 2 of 2
Re: help with checker room puzzle script
Posted: Wed Sep 19, 2012 4:13 pm
by Montis
Billick wrote:Don't forget the checkered room has 2 solutions
I'm very sure it hasn't, or at least not two practical ones since you need to step on the plate directly in front of the door to go through it thus closing the door.
Re: help with checker room puzzle script
Posted: Wed Sep 19, 2012 4:48 pm
by Billick
Montis wrote:Billick wrote:Don't forget the checkered room has 2 solutions
I'm very sure it hasn't, or at least not two practical ones since you need to step on the plate directly in front of the door to go through it thus closing the door.
That's true... I'm just saying if you want it to emulate the puzzle in the original game
Re: help with checker room puzzle script
Posted: Wed Sep 19, 2012 5:59 pm
by Komag
Ah yes, I in fact forgot about that!
Just adding the opposite checker pattern works:
Code: Select all
function openport()
if
checkerplate1:isUp() and
checkerplate2:isDown() and
checkerplate3:isUp() and
checkerplate4:isDown() and
checkerplate5:isUp() and
checkerplate6:isDown() and
checkerplate7:isUp() and
checkerplate8:isDown() and
checkerplate9:isUp()
then
checkeredport:open()
elseif
checkerplate1:isDown() and
checkerplate2:isUp() and
checkerplate3:isDown() and
checkerplate4:isUp() and
checkerplate5:isDown() and
checkerplate6:isUp() and
checkerplate7:isDown() and
checkerplate8:isUp() and
checkerplate9:isDown()
then
checkeredport:open()
else
checkeredport:close()
end
end
When I first played the game I solved it the wrong way and soon saw my error, it was cool how it worked both ways.
Re: help with checker room puzzle script
Posted: Wed Sep 19, 2012 8:11 pm
by Komag
slight change, I renamed the plates to oddplate# and evenplate# for more clarity (I think). Plus this should open up a way to script it without having to list each plate, using some sort of local ..i 1,4 or 1,5 thing that I don't know how to do:
Code: Select all
function openport()
if
oddplate1:isUp() and
oddplate2:isUp() and
oddplate3:isUp() and
oddplate4:isUp() and
oddplate5:isUp() and
evenplate1:isDown() and
evenplate2:isDown() and
evenplate3:isDown() and
evenplate4:isDown()
then
checkeredport:open()
elseif
oddplate1:isDown() and
oddplate2:isDown() and
oddplate3:isDown() and
oddplate4:isDown() and
oddplate5:isDown() and
evenplate1:isUp() and
evenplate2:isUp() and
evenplate3:isUp() and
evenplate4:isUp()
then
checkeredport:open()
else
checkeredport:close()
end
end
Re: help with checker room puzzle script
Posted: Thu Sep 20, 2012 4:16 pm
by roachburn
I actually set that up in my puzzle with 2 solutions. One way opens the door to progress through the dungeon, and the other way opens a secret door.
function checkerdoor()
if checkerplate1:isDown() and
checkerplate2:isUp() and
checkerplate3:isDown() and
checkerplate4:isUp() and
checkerplate5:isDown() and
checkerplate6:isUp() and
checkerplate7:isDown() and
checkerplate8:isUp() and
checkerplate9:isDown()
then
checkerdoor1:activate()
else checkerdoor1:deactivate()
end
end
function checkersecretdoor()
if checkerplate1:isUp() and
checkerplate2:isDown() and
checkerplate3:isUp() and
checkerplate4:isDown() and
checkerplate5:isUp() and
checkerplate6:isDown() and
checkerplate7:isUp() and
checkerplate8:isDown() and
checkerplate9:isUp()
then
checkersecretdoor1:activate()
else checkersecretdoor1:deactivate()
end
end
Re: help with checker room puzzle script
Posted: Thu Sep 20, 2012 5:05 pm
by Komag
ah, tricky, few of us would think to try the "wrong" way on purpose! I love stuff like that! It might be good to have some little clue too, something to slightly indicate there is a secret to find in the area maybe, not sure
Re: help with checker room puzzle script
Posted: Thu Sep 20, 2012 5:15 pm
by Grimwold
Komag wrote:ah, tricky, few of us would think to try the "wrong" way on purpose! I love stuff like that! It might be good to have some little clue too, something to slightly indicate there is a secret to find in the area maybe, not sure
The first time I played the checker room in the main game I completed it wrongly.. the door still opened, but I was dismayed to find that when I stood in front of the door it closed again!
Re: help with checker room puzzle script
Posted: Thu Sep 20, 2012 6:01 pm
by Darklord
Grimwold wrote:
The first time I played the checker room in the main game I completed it wrongly.. the door still opened, but I was dismayed to find that when I stood in front of the door it closed again!
Yes I did that to, was most dismaying! I soon reversed it though.
Daniel.
Re: help with checker room puzzle script
Posted: Fri Sep 21, 2012 8:28 am
by elegrem
I was actually quite interested to realize you could solve this without lua, and just use a counter.
1) Add a counter that starts at 6, and the 12 floor panels
2) Add odd floor panel connections to counter, activating panel decrements the counter, deactivating increments the counter
3) Add even floor panel connections to counter, activating panel increments the counter, deactivating decrements the counter
4) When the counter reaches zero, the door opens (only occurs when all odd panels are activated and all even panels are deactivated)
The reverse solution would yield a value of 18 on the counter, so it doesn't open the door with the reversed solution. But that could be fixed by adding another 24 connections to another counter.
This would not be practical by any means, but it's interesting that it can be done without lua.
I hope this was done with lua in the main game...