Pressure Plates question

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
DrTeflon
Posts: 6
Joined: Wed Sep 12, 2012 10:25 pm

Pressure Plates question

Post by DrTeflon »

Hello everyone, I have a question regarding pressure plates. I was wondering if its possible to create a puzzle using several pressure plates. Something like there are 10 pressure plates in the room, if I place three items on specific pressure plates then the door opens. I looked through the scripting documentation and didnt find anything regarding getstate or something like that.

Btw, it's my first time working with scripts so :oops: :oops: :oops:
Lmaoboat
Posts: 359
Joined: Wed Apr 11, 2012 8:55 pm

Re: Pressure Plates question

Post by Lmaoboat »

Well I'm also new, but I think you could set a counter with an initial value of 3 to open a door, then make it so the three specific pressure plates decease the counter by 1 when pressed, and increase when released.
DrTeflon
Posts: 6
Joined: Wed Sep 12, 2012 10:25 pm

Re: Pressure Plates question

Post by DrTeflon »

Lmaoboat wrote:Well I'm also new, but I think you could set a counter with an initial value of 3 to open a door, then make it so the three specific pressure plates decease the counter by 1 when pressed, and increase when released.
Hmm, thanks, I'm gonna try that!
DrTeflon
Posts: 6
Joined: Wed Sep 12, 2012 10:25 pm

Re: Pressure Plates question

Post by DrTeflon »

Hmm, I wonder what I'm doing wrong

---opendoor
function open()
if counter_1:getValue() == "1" then
door_2:open()
end
end

I targeted a pressure plate to increment the counter value to one but still doesnt work
User avatar
antti
Posts: 688
Joined: Thu Feb 23, 2012 1:43 pm
Location: Espoo, Finland
Contact:

Re: Pressure Plates question

Post by antti »

DrTeflon wrote:Hmm, I wonder what I'm doing wrong

---opendoor
function open()
if counter_1:getValue() == "1" then
door_2:open()
end
end

I targeted a pressure plate to increment the counter value to one but still doesnt work
Try removing the quotation marks around 1. Things inside quotes are strings (like pieces of text). So in this case you weren't trying to compare the counter's value with the number of one but with a text that reads "1". Hope this clears it up a bit.
Steven Seagal of gaming industry
DrTeflon
Posts: 6
Joined: Wed Sep 12, 2012 10:25 pm

Re: Pressure Plates question

Post by DrTeflon »

antti wrote:
DrTeflon wrote:Hmm, I wonder what I'm doing wrong

---opendoor
function open()
if counter_1:getValue() == "1" then
door_2:open()
end
end

I targeted a pressure plate to increment the counter value to one but still doesnt work
Try removing the quotation marks around 1. Things inside quotes are strings (like pieces of text). So in this case you weren't trying to compare the counter's value with the number of one but with a text that reads "1". Hope this clears it up a bit.
Thanks! as I said, its like my first time working with code ;)

Tried it and it still doesnt work, maybe i'm doing something stupid, gotta run more tests
Lmaoboat
Posts: 359
Joined: Wed Apr 11, 2012 8:55 pm

Re: Pressure Plates question

Post by Lmaoboat »

I don't think you need a script for this one, thought it's probably good to get practice.
DrTeflon
Posts: 6
Joined: Wed Sep 12, 2012 10:25 pm

Re: Pressure Plates question

Post by DrTeflon »

Lmaoboat wrote:I don't think you need a script for this one, thought it's probably good to get practice.
I'm doing this a test and adding more pressure plates ;)
User avatar
pulpum
Posts: 155
Joined: Wed Apr 18, 2012 1:23 am
Location: bordeaux, france

Re: Pressure Plates question

Post by pulpum »

you can do it with pressure plates properties "item", and activate the thing with a connector to your item... I dit it to open doors today... :mrgreen:
ad&d / ff / d&d
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Pressure Plates question

Post by Komag »

You can read some ideas relating to this in this thread:
viewtopic.php?f=14&t=3032
Finished Dungeons - complete mods to play
Post Reply