Hello, I'm a huge Grimrock fan and really enjoying the editor so far. However, I've run into some trouble with the lua scripts while trying to add things in the editor (I know I know there have been a hundred of these topics). Here is my problem...I want to get a door on level 2 to be opened when two plates are being pressed down with items on level 3. Eventually, I would like for these to be specific items that have to trigger the plates if that is possible. I appreciate any help that I can get, as I am totally new to modding/coding. Here is my lua code.
--plate level toggle
function platedown()
if plate1:getPlateState() == "activated" and
plate2:getPlateState() == "activated" then
door1:open()
else
door1:close()
end
end
T
Please Help...
Re: Please Help...
There is no getPlateState(). See isDown() and isUp() in scripting reference.
Re: Please Help...
I believe it is possible to do what you want. There is a way to detect which item is in the square, and to control things on different levels. There are other threads which explain it all in detail
Finished Dungeons - complete mods to play
Re: Please Help...
Alright, thanks for the help! I'll definitely check those out.
Re: Please Help...
To use your code, just replace the methodsfunction platedown()
if plate1:getPlateState() == "activated" and
plate2:getPlateState() == "activated" then
door1:open()
else
door1:close()
end
end
Code: Select all
function platedown()
if plate1:isDown() and plate2:isDown() then
door1:open()
else
door1:close()
end
end