Trigger Pressure Plates by certain item?

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Brodie301
Posts: 286
Joined: Sun Apr 08, 2012 6:00 pm
Location: Mississippi, USA

Trigger Pressure Plates by certain item?

Post by Brodie301 »

Trying to open a door by pressure only if certain item is on it.
I can trigger by any item in editor and i even tried my hand at scripting finally to do this and a couple other things.
But script comes back as error nil value no matter how i try it.
Any ideas helpful welcome
The FORCE is with me!!!
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: Trigger Pressure Plates by certain item?

Post by Neikun »

...Hmm Alcove with xyz position on the ground and a on insertitem hook?
Sorry. I'm tired and sick. Kinda a half-assed answer, and I'm sure there's an easier way.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
YpsiNine
Posts: 36
Joined: Wed Oct 10, 2012 1:08 am

Re: Trigger Pressure Plates by certain item?

Post by YpsiNine »

You can do something like this if you go by name of the item, just connect the pressure plate to the script.

Code: Select all

function itemCheck()
  for item in entitiesAt(1, 16, 21) do
    if item.name == "dagger" then
      print("yeah baby")
    end
  end
end
Or by the id of the item:

Code: Select all

function itemCheck()
  for item in entitiesAt(1, 16, 21) do
    if item.id == "dagger_1" then
      print("yeah baby")
    end
  end
end
And just add as much code as you need instead of the print-line. And remember to change to the 1, 16, 21 numbers to your Level number and X and Y coordinates of your pressure plate. And of course the item you want instead of dagger.
User avatar
Brodie301
Posts: 286
Joined: Sun Apr 08, 2012 6:00 pm
Location: Mississippi, USA

Re: Trigger Pressure Plates by certain item?

Post by Brodie301 »

Could not get this to work with pressure plate but did with this script and alcove instead like Neikun suggested but I used wall alcove and didn't try to flip it to floor since still figuring out scripting.
The FORCE is with me!!!
YpsiNine
Posts: 36
Joined: Wed Oct 10, 2012 1:08 am

Re: Trigger Pressure Plates by certain item?

Post by YpsiNine »

Brodie301 wrote:Could not get this to work with pressure plate but did with this script and alcove instead like Neikun suggested but I used wall alcove and didn't try to flip it to floor since still figuring out scripting.
It works fine but you have to set the pressure plate to activate by item only.
User avatar
Brodie301
Posts: 286
Joined: Sun Apr 08, 2012 6:00 pm
Location: Mississippi, USA

Re: Trigger Pressure Plates by certain item?

Post by Brodie301 »

When I did it was any item would trigger even with script I'll try it again deeper in my dungeon since it was the first script I actually got to work even if it was a little altered.
Thanks for it.
The FORCE is with me!!!
Broken|Glass
Posts: 2
Joined: Tue Oct 09, 2012 11:32 pm

Re: Trigger Pressure Plates by certain item?

Post by Broken|Glass »

viewtopic.php?f=14&t=3620

I posted this a while back, and this works perfectly.
Post Reply