Page 1 of 1

[Help] How can I make a "torch holder" puzzle?

Posted: Mon Jan 14, 2013 11:03 pm
by ChizFreak
It's not really complicated but I can't really seem to figure out by myself, I tried some things but didn't worked. Basically, I want to make a puzzle that consists of 4 torch holders, without torches, you have to place a torch in every one so a door opens. I tried to use a counter that starts at 4, then I connected all torch holders to the counter, so they "decrement", then I made a script and put this:

Code: Select all

-- all torches on puzzle
function torchPuzzleLevel1()
	if counter_1:getValue() == "0" then
		dungeon_door_wooden_1:open()
	else 
	  	dungeon_door_wooden_1:closed()
	end
end
What I'm doing wrong? I already tested and the door never opens...

EDIT: Nevermind the problem was that I forgot to connect the counter to the script entity. Also I figured out I must put an additional increment connector from torch holder to counter when it's deactivated otherwise people can take and put the same torch 4 times on one torch holder and the door opens.

Re: [Help] How can I make a "torch holder" puzzle?

Posted: Tue Jan 15, 2013 3:26 am
by Komag
Yup, you got it figured out! But in your case you can actually do it much simpler, just link the counter directly to the door, since counters send an activate signal when they reach 0 and a deactivate signal when leaving 0 to something else (positive or negative, either way).