Jump to content

Script that relocks a door after a second?


DavideMitra

Recommended Posts

Hi! I've almost finished an exterior house mod (no shack kit! real house!). It required a lot of work, and it will be on Skyrimnexus in a few days.

 

 

 

I'm asking some help for a door lock script..is there someone who may create a script that relocks a door after one second? This way, the player will be forced to carry the keys, and enemies will be forced to stay out of the house garden..

 

If you will help me, and if your script will work, I assure you I will credit you for your help..

Thanks and have a good day!!

 

Link to comment
Share on other sites

Sounds simple enough, if I get a chance I might have a look at it.

 

Excuse me, I'm not a native english speaker and I don't know if I understood well.

 

What do you mean with "if I get a chance I might have a look at it?" Does it mean you will create it?

If you can do it, please write the script in the next message, then I will test it in game and I will reply reporting if it works.

Of course, I will credit you..the mod will be on the nexus in some days, the only missing things are navmeshes and the script itself...

Link to comment
Share on other sites

Theory only.... untested...

 

Create a trigger box outside the door.

Apply the following to the trigger box

 

 

 

Scriptname SomeScript Extends ObjectReference
 
Door Property YourDoor Auto
Actor Property PlayerRef Auto
 
Event OnTriggerEnter(ObjectReference akActionRef)
If akActionRef == PlayerRef
YourDoor.Lock()
EndIf
EndEvent
 

 

 

Link to comment
Share on other sites

Theory only.... untested...

 

Create a trigger box outside the door.

Apply the following to the trigger box

 

 

 

Scriptname SomeScript Extends ObjectReference
 
Door Property YourDoor Auto
Actor Property PlayerRef Auto
 
Event OnTriggerEnter(ObjectReference akActionRef)
If akActionRef == PlayerRef
YourDoor.Lock()
EndIf
EndEvent
 

 

 

Uhm....I never heard about this procedure...I mean, usually, when I have to put a script for something, I simply double click on the object that must be scripted, I go to scripts and I copy the script.

 

I don't know how to place a trigger OUTSIDE the door, but I know how to place a trigger in the door (I select the door, I click on the "create trigger" icon, then "new")..

Well, I don't know if I explained well, I don't think so.

Link to comment
Share on other sites

Simple. Place the trigger like you would normally and then change it's shape to encompass a larger area.

 

Is this a load door or an in same cell door? If it is an in same cell door then you might be able to get away with it being just where the door is. However you want the player to be able to move out of the way before it closes. So either add in a wait statement or move the trigger box a certain distance away from the door.

Link to comment
Share on other sites

Simple. Place the trigger like you would normally and then change it's shape to encompass a larger area.

 

Is this a load door or an in same cell door? If it is an in same cell door then you might be able to get away with it being just where the door is. However you want the player to be able to move out of the way before it closes. So either add in a wait statement or move the trigger box a certain distance away from the door.

It is in the same cell..Tamriel cell (I created an exterior house).

 

"However you want the player to be able to move out of the way before it closes" So, as I understand, this door doesn't only relock, but it also closes itself again..well..fantastic!!!

I will try your script tomorrow. I'll keep in touch and I will let you know if it works! Thanks, good night!

Link to comment
Share on other sites

I tried it..unfortunatelly the door doesn't close and doesn't re-lock.

 

I also tried to extend the trigger area, but nothing happens..

 

 

 

In the internet I found an Oblivion script, but I don't know if Oblivion scripts will work in Skyrim. What do you think? They both use Papyrus, but Papyrus language in the Skyrim version might be changed a bit

EDIT: The Oblivion script doesn't work too... :(

Edited by DavideMitra
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...