help with checker room puzzle script

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: help with checker room puzzle script

Post by Montis »

Billick wrote:Don't forget the checkered room has 2 solutions :D
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. :)
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
User avatar
Billick
Posts: 201
Joined: Thu Apr 19, 2012 9:28 pm

Re: help with checker room puzzle script

Post by Billick »

Montis wrote:
Billick wrote:Don't forget the checkered room has 2 solutions :D
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 :)
Halls of Barrian - current version 1.0.3 - Steam Nexus
Me Grimrock no bozo!
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: help with checker room puzzle script

Post 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.
Finished Dungeons - complete mods to play
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: help with checker room puzzle script

Post 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
Finished Dungeons - complete mods to play
roachburn
Posts: 17
Joined: Wed Sep 19, 2012 11:22 am

Re: help with checker room puzzle script

Post 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.
SpoilerShow
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
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: help with checker room puzzle script

Post 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
Finished Dungeons - complete mods to play
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: help with checker room puzzle script

Post 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!
User avatar
Darklord
Posts: 2001
Joined: Sat Mar 03, 2012 12:44 pm
Location: England

Re: help with checker room puzzle script

Post 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.
A gently fried snail slice is absolutely delicious with a pat of butter...
User avatar
elegrem
Posts: 8
Joined: Sun Sep 09, 2012 2:09 am

Re: help with checker room puzzle script

Post 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... :D
Post Reply