Please Help...

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
monkmeh
Posts: 2
Joined: Sat Sep 15, 2012 4:55 am

Please Help...

Post by monkmeh »

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
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Please Help...

Post by petri »

There is no getPlateState(). See isDown() and isUp() in scripting reference.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Please Help...

Post by Komag »

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
monkmeh
Posts: 2
Joined: Sat Sep 15, 2012 4:55 am

Re: Please Help...

Post by monkmeh »

Alright, thanks for the help! I'll definitely check those out.
User avatar
Shroom
Posts: 98
Joined: Tue Mar 27, 2012 6:37 pm
Location: UK

Re: Please Help...

Post by Shroom »

function platedown()
if plate1:getPlateState() == "activated" and
plate2:getPlateState() == "activated" then
door1:open()
else
door1:close()
end
end
To use your code, just replace the methods

Code: Select all

function platedown()
    if plate1:isDown() and plate2:isDown() then
        door1:open()
    else
        door1:close()
    end
end
Add a connector to each plate to call the lua entity with the code in to check
Post Reply