Using pressure plate to keep portcullis open?

Post » Wed Jun 20, 2012 1:15 pm

Hi. I had an idea of using a pressure plate to keep a portcullis open. The idea is that the player has to leave an item on the plate in order to keep the the portcullis open before they can proceed through it. Once they have passed beyong the portcullis I wanted to activate a trap to move the item off of the plate allowing the portcullis to close behind them sealing them in. (Making it necessary to exit the dungeon at some other point and NOT where they entered). I have almost managed to set up the pressure plate and portcullis to do this but I am having the following trouble: Stepping on and off the plate quickly reverses the relationship between the plate and the portcullis. i.e. instead of having to weigh down the plate to open the portcullis you now have to make sure it is clear to keep to keep the portcullis open. I think this is due to the animation speed of the portcullis not being fast enough. Is it posible to speed up the animation of the portcullis so you can step on and off the plate quickly or is there a way of getting the portcullis to default to a closed position unless the plate is weighed down? Thanks in advance for any help.
User avatar
Tamara Primo
 
Posts: 3483
Joined: Fri Jul 28, 2006 7:15 am

Post » Wed Jun 20, 2012 10:25 am

Simple. In addition to catching the OnEnter to trigger the plate, catch OnTriggerLeave, and in that, call GetTriggerObjectCount() - if the value is zero, close the portcullis.
User avatar
Leah
 
Posts: 3358
Joined: Wed Nov 01, 2006 3:11 pm

Post » Wed Jun 20, 2012 4:01 pm

Hi. Thanks for the reply. I should say at this point that I'm a bit of a noob, although I do have some programming experience. I have found the default script for my pressure plate and there are 2 states containing the above references(OnTriggerLeave and GetTriggerObjectCount==0): Active and doNothing. How do I refence my portcullis from this script and which of the states do I put it in? Thanks again.
User avatar
Ells
 
Posts: 3430
Joined: Thu Aug 10, 2006 9:03 pm

Post » Wed Jun 20, 2012 2:32 pm

You don't want to edit any vanilla scripts. Trust me. If you do, every pressure plate in Skyrim will change to work like yours does. You'll want to make your own script that Extends the PressurePlate Script.

Or start from scratch: Here is a http://www.creationkit.com/Scripting_Tutorial_Pressure_Plate that goes through setting up the basic pressure plate functionality (though they accidentally used the name of a script that already exists in the game, so you'll need to use a name other than "PressurePlate")
User avatar
Steven Hardman
 
Posts: 3323
Joined: Sun Jun 10, 2007 5:12 pm


Return to V - Skyrim