a little help ;)

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Billick
Posts: 201
Joined: Thu Apr 19, 2012 9:28 pm

Re: a little help ;)

Post by Billick »

papazombie wrote:I wonder if you could write for 2 or more concretes items in 2 or more alcoves to open a door. For example; to open a door you have to put a dagger on the first alcove and a compass on the second alcove. I have tried to modify what you write but it doesnt work. Thanks again ;)
Hmm, that's a bit trickier, and there are a few way to do it, but I'll give it a go...

Code: Select all

function daggerCheck()
   for i in alcove_1:containedItems() do
      if i.name == "dagger" then
         compassCheck()
         return
      end
   end
end

function compassCheck()
   for i in alcove_2:containedItems() do
      if i.name == "compass" then
         my_door:open()
         return
      end
   end
end
Make sure that both alcoves are connected to the daggerCheck function in the script. The daggerCheck function will call the compassCheck function if it finds a dagger on the first alcove, and that will check for a compass on the second alcove. Also be sure to change the object IDs to the ones on your map. This should work, but I can't test it on this computer, so I make no guarantees :D

Edit: ninja'd by Magus! His uses a little bit different logic, but should work as well.
Halls of Barrian - current version 1.0.3 - Steam Nexus
Me Grimrock no bozo!
Post Reply