Page 1 of 2

Eye socket function list?

Posted: Fri Sep 21, 2012 10:45 am
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?

Re: Eye socket function list?

Posted: Fri Sep 21, 2012 11:10 am
by petri
Eye socket is an Alcove.

Re: Eye socket function list?

Posted: Fri Sep 21, 2012 11:11 am
by MM037
Ah, thank you.

Re: Eye socket function list?

Posted: Fri Sep 21, 2012 11:22 am
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

Re: Eye socket function list?

Posted: Fri Sep 21, 2012 2:04 pm
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.

Re: Eye socket function list?

Posted: Sat Sep 22, 2012 9:50 am
by MM037
That's how I have it connected. Both sockets to the script. None to door.

Re: Eye socket function list?

Posted: Sat Sep 22, 2012 9:56 am
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
}

Re: Eye socket function list?

Posted: Sat Sep 22, 2012 10:16 am
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.

Re: Eye socket function list?

Posted: Sat Sep 22, 2012 10:23 am
by SpacialKatana
On each socket add a 'deactivate' hook to the door, set to close

Re: Eye socket function list?

Posted: Sat Sep 22, 2012 10:29 am
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.