Closing and relocking a door.
Ok I finally got it. First of all the checkbox under the lock properties
"can be relocked" can't be grayed out. I am assuming that if it is and you
try to script in a relock you get an invalid error of some sort, bottom line
is it crashes the game.
So onto the scripting
In the onopen box you want this
NWScript: "void main()
{
DelayCommand( 30.0f, ActionCloseDoor( GetObjectByTag( "objecttag" ) ) );
}"
where "objecttag" is the doortag.
In the onclose box you need this
NWScript: "void main()
{
DelayCommand (10.0, SetLocked(OBJECT_SELF, 1));
}"
Don't try the ActionLockObject tag cause that will crash the game too. I
have seen other people post that relocking doors isn't working so I assume
that command is bugged.
Oh well it took me all day to figure out how to make a chest respawn the key
and get a door to relock, man I am good
|