Completing Demon Eye Gem Sockets for Door Unlock
Posted: Sun Jan 06, 2013 11:38 pm
We're new to Grimrock modding and lua script. With the help of the modding references we have completed some of this puzzle, but can't quite finish it.
We have placed a "daemon_head_eye_slots" object in our room with a "dungeon_door_iron" that we wish to open when a red gem is placed in both sockets of the demon head. We added the following script to the objects.lua file to create the sockets and added the sockets to the demon head in the editor.
_________________________________________________________
-- This file has been generated by Dungeon Editor 1.3.6
-- TODO: place your custom dungeon object definitions here
defineObject{
name = "eye_socket_left_red",
class = "Alcove",
anchorPos = vec(0.21, 1.58, -0.45),
targetPos = vec(0.2, 1.65, -0.45),
targetSize = vec(0.1, 0.1, 0.1),
placement = "wall",
onInsertItem = function(self, item)
return item.name == "red_gem" and
self:getItemCount() == 0
end,
editorIcon = 92,
}
defineObject{
name = "eye_socket_right_red",
class = "Alcove",
anchorPos = vec(-0.21, 1.58, -0.45),
targetPos = vec(-0.2, 1.65, -0.45),
targetSize = vec(0.1, 0.1, 0.1),
placement = "wall",
onInsertItem = function(self, item)
return item.name == "red_gem" and
self:getItemCount() == 0
end,
editorIcon = 92,
}
_________________________________________________________
Now we just need to check that 2 red gems are present to unlock the door, but we're not sure if this code gets added in the objects.lua file or in the editor, and the exact code to use. Anyone able to help with this? Thanks in advance.
We have placed a "daemon_head_eye_slots" object in our room with a "dungeon_door_iron" that we wish to open when a red gem is placed in both sockets of the demon head. We added the following script to the objects.lua file to create the sockets and added the sockets to the demon head in the editor.
_________________________________________________________
-- This file has been generated by Dungeon Editor 1.3.6
-- TODO: place your custom dungeon object definitions here
defineObject{
name = "eye_socket_left_red",
class = "Alcove",
anchorPos = vec(0.21, 1.58, -0.45),
targetPos = vec(0.2, 1.65, -0.45),
targetSize = vec(0.1, 0.1, 0.1),
placement = "wall",
onInsertItem = function(self, item)
return item.name == "red_gem" and
self:getItemCount() == 0
end,
editorIcon = 92,
}
defineObject{
name = "eye_socket_right_red",
class = "Alcove",
anchorPos = vec(-0.21, 1.58, -0.45),
targetPos = vec(-0.2, 1.65, -0.45),
targetSize = vec(0.1, 0.1, 0.1),
placement = "wall",
onInsertItem = function(self, item)
return item.name == "red_gem" and
self:getItemCount() == 0
end,
editorIcon = 92,
}
_________________________________________________________
Now we just need to check that 2 red gems are present to unlock the door, but we're not sure if this code gets added in the objects.lua file or in the editor, and the exact code to use. Anyone able to help with this? Thanks in advance.