Alcove Puzzle (multiple items)

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Tyrion
Posts: 5
Joined: Tue Oct 09, 2012 11:27 pm

Alcove Puzzle (multiple items)

Post by Tyrion »

Hey there.
I hope this question has not been asked before, but I couldn't find something similar in the forum.

I want to write a skript, that executes the following puzzle:
There is a dungeon room with a door and three alcoves. Three gems have to be placed in the right alcove according to a puzzle in order to open the door.
The editor tutorial shows nicely, how you can do something like this with just one item, but I'm having trouble doing it with more than one.

My skript looks like this, but it can't be right like this:

Code: Select all

function newPuzzle()
   -- iterate through all contained items on alcoves, checking for a matching name
   for i in alcove1:containedItems() do
	for j in alcove2:containedItems() do
	    for k in alcove3:containedItems() do
	
        if  i.name == "blue_gem" &
	    j.name == "red_gem" &
            k.name == "green_gem" then

         puzzleDoor:open()
         break
      end
   end
end
end
end
Can someone tell me, what the right code has to look like?
User avatar
Filipsan
Posts: 84
Joined: Fri Mar 16, 2012 10:18 am

Re: Alcove Puzzle (multiple items)

Post by Filipsan »

Post Reply