Lock Object when closed
GAGE HOLSTON
10 Dec 2017, 23:23In my game, you need to use a keycard to unlock a door. Once unlocked, it opens automatically and you go inside automatically.
Once you return from that area I want to close the door and lock it. The thing is I noticed there doesn't seem to be a way to manually lock an object, at least not in the menus. Is there a way to lock an object manually through the script?

DarkLizerd
11 Dec 2017, 00:12Anything can be done with script...
(Even exciting hard-to-find typo!!! LOL)
Do you want the door to auto lock when it closes?
You could pot a bit of code in the room, in the "After leaving the room" (like)
Lock exit [exit] room door...
You may be able to leave the door locked, but with the keycard, it automatically opens...
Or do you mean "lock the door" (I think that is what you are after, after re-reading your post...)
How do you unlock the door?
You could add to the "use card" code to ...
Unlock door... (it is now unlocked)
lock door... (it is not locked)

K.V.
11 Dec 2017, 00:37If it opens automatically, you can probably fake it all in the SWIPE CARD script.
...unless you have to enter OPEN DOOR before you leave the room.
If you can never actually get the door open by entering OPEN DOOR, you could just have one line for the script for opening that door: msg("It is locked. You can only open it by swiping a key card.")
(or something to that effect), and never set up anything else. It wouldn't need to be a lockable container at all.
If you can enter OPEN DOOR (which I imagine is the case), DL's suggestion is spot on. Do it in the After leaving the room: script: door.locked = true
. (As long as door is your door's name. If not, substitute your door's name for door in door.locked
.)
jmnevil54
11 Dec 2017, 02:37See here.
(I realize I put the script in the wrong spot. Oh well.)
https://i.imgur.com/lsJFdwd.png
https://i.imgur.com/SvNXzkt.png