Help: Scripting - Lock the door behind you.

Post » Mon Jun 18, 2012 4:00 am

Is there a script already made for something like that? If not, what do I need to add, or how do I need to write it?


For example:
I want to have the safe in Proudspire Lock itself after I use it.
OR
I want the door to Proudspire manor to lock after using it.



Thanks ahead of time for anyone who knows what to do.
User avatar
The Time Car
 
Posts: 3435
Joined: Sat Oct 27, 2007 7:13 pm

Post » Mon Jun 18, 2012 7:31 am

Take a look at the http://www.creationkit.com/Lock_-_ObjectReference function.

Cipscis
User avatar
X(S.a.R.a.H)X
 
Posts: 3413
Joined: Tue Feb 20, 2007 2:38 pm

Post » Mon Jun 18, 2012 1:44 am

Take a look at the http://www.creationkit.com/Lock_-_ObjectReference function.

Cipscis

Yea, but how can I set it to re-lock the reference automatically after I am done using it in game? > ie: without entering "lock" in the command prompt.
User avatar
Erin S
 
Posts: 3416
Joined: Sat Jul 29, 2006 2:06 pm

Post » Mon Jun 18, 2012 1:39 am

Perhaps put it in an http://www.creationkit.com/OnClose_-_ObjectReference event?

You could use an http://www.creationkit.com/OnOpen_-_ObjectReference event and a http://www.creationkit.com/OnUpdate_-_Form event if you want to make it close automatically after some time.

Cipscis
User avatar
Elizabeth Lysons
 
Posts: 3474
Joined: Fri Feb 02, 2007 7:16 am

Post » Sun Jun 17, 2012 11:29 pm

Perhaps put it in an http://www.creationkit.com/OnClose_-_ObjectReference event?
Cipscis

That's what I was looking for!
now why the heck couldn't I find it before?

Thanks for the help!
User avatar
Sherry Speakman
 
Posts: 3487
Joined: Fri Oct 20, 2006 1:00 pm

Post » Mon Jun 18, 2012 4:58 am

I believe there is a Utility.Wait command, so you could use that to wait x seconds before locking again

on close event
utility.wait(120)
self.Lock(difficulty) - guessing thats an argument
end event




Question - Do NPC's actually steal from your containers?

I mean, if you really feel that they might try something.
Set the safe to be

On Open
if not PC
Actor.Die or something like that
User avatar
roxanna matoorah
 
Posts: 3368
Joined: Fri Oct 13, 2006 6:01 am

Post » Sun Jun 17, 2012 8:37 pm

I believe there is a Utility.Wait command, so you could use that to wait x seconds before locking again


Question - Do NPC's actually steal from your containers?

I mean, if you really feel that they might try something.
Set the safe to be

On Open
if not PC
Actor.Die or something like that

I don't know about containers, (chests, desks, etc) but I've seen them steal a weapon off of a weapon rack.

Who knows for sure. Maybe they do. I think that was one of the bugs the developers had to deal with from the start. I remember reading something about an NPC that stole all the weapons in the towns and hoarded them in his house.

Either way, I'll give both scripts a test to see what happens. I guess if I find a bunch of dead NPC's in my house, I'll know.
User avatar
Carlitos Avila
 
Posts: 3438
Joined: Fri Sep 21, 2007 3:05 pm

Post » Mon Jun 18, 2012 7:08 am

apparently I am no good at this scripting.
However, I've found that using the script "dunFellglowOnLoadUpdateDoor " works, for the most part. Every time you load the area with the container, or another area, that container is locks. It stays locked until you unlock it again. (in case anyone was wondering how I solved this)
User avatar
Jesus Duran
 
Posts: 3444
Joined: Wed Aug 15, 2007 12:16 am


Return to V - Skyrim