Eye socket function list?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
MM037
Posts: 14
Joined: Thu Sep 20, 2012 3:12 am

Eye socket function list?

Post by MM037 »

I couldn't find a function list for eye sockets. I can connect them to a script entity, but have no idea how to script for them. Anyone have a list?
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Eye socket function list?

Post by petri »

Eye socket is an Alcove.
MM037
Posts: 14
Joined: Thu Sep 20, 2012 3:12 am

Re: Eye socket function list?

Post by MM037 »

Ah, thank you.
MM037
Posts: 14
Joined: Thu Sep 20, 2012 3:12 am

Re: Eye socket function list?

Post by MM037 »

I have one more problem. I know nothing about lua, except what I have learned from here. My following script doesn't seem to work correctly. If I put a gem in either eye, the door opens. My intention is that it takes a gem in both eyes. I am obviously doing something wrong.

-- Eye Socket Lock
function eyes()
if eye_socket_left_1:containedItems(blue_gem) and
eye_socket_right_1:containedItems(blue_gem)
then
dungeon_secret_door_3:open()
else
dungeon_secret_door_3:close()
end
end
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: Eye socket function list?

Post by Montis »

the script seems good, maybe you messed up the connectors a bit?
you only need to connect both eyes to the script, with no connectors to the door.
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
MM037
Posts: 14
Joined: Thu Sep 20, 2012 3:12 am

Re: Eye socket function list?

Post by MM037 »

That's how I have it connected. Both sockets to the script. None to door.
SpacialKatana
Posts: 163
Joined: Fri Sep 14, 2012 6:20 pm

Re: Eye socket function list?

Post by SpacialKatana »

For each socket:-
activate decrements a counter
deactivate increments the counter

Add counter set to 2, connected by each socket

Connect counter to door

When 2 gems are socketed the door will open.

NO scripts needed for this, as long as your sockets are coded right ;)
eg:-

Code: Select all

cloneObject{
      name = "red_eye_left",
      baseObject = "eye_socket_left",

      onInsertItem = function(self, item)
      return item.name == "red_gem" and self:getItemCount() == 0
   end
}
MM037
Posts: 14
Joined: Thu Sep 20, 2012 3:12 am

Re: Eye socket function list?

Post by MM037 »

Only problem with the counter, is I want to have it where I can take a gem out and it close, and then put it back in to open again. It will open once, and I can add connectors to close them, but then it won't reopen.
SpacialKatana
Posts: 163
Joined: Fri Sep 14, 2012 6:20 pm

Re: Eye socket function list?

Post by SpacialKatana »

On each socket add a 'deactivate' hook to the door, set to close
MM037
Posts: 14
Joined: Thu Sep 20, 2012 3:12 am

Re: Eye socket function list?

Post by MM037 »

I forgot to set the deactivate to increment the counter as well as close the door. That fixed it. Thanks so much for you help.
Post Reply