Table of Contents

Automatically Closing/Locking Doors

By default, doors stays open until last player leaves an area. This suffices in most of the situations.

But sometimes you might want to make sure that specific doors closes and locks automatically. For example if you have rogue-only doors that acts as a shortcut or the door requires a key that needs to be obtained from named monster first.

To do that, put script ark_zamkni into doors's OnOpen event. Or, in special case where the doors leads to subarea with no return, you might want to use OnAreaTransitionClicked event - that will prevent the typical issue where the player opens the doors and then decides to rest before entering, in which case door would close and lock normally.

Default timer for locking and closing door with this script is 15 seconds. If you want different time, you can specify this with these variables:

If the door is linked to another door then, closing the door from one side, closes it from the other as well.

This script also delays closing if there is a player within 5 meters from door to avoid issue with the player opening and resting or player being stuck inside doors which sometimes happens.

Area-Triggered Automatic Closing

There are additional options for the script that closes doors when last player exits the area.

Respawning Doors

If you want to make doors destroyable in non-instanced area, then you will want those doors to respawn themselves after some time. To do this, set script sh_respdvere into Door's OnDeath event. Then set up other door characteristics such as hitpoints, automatically closing script, hardness or even trap and press OK. Once you have that, you need to make a blueprint from these doors. To do that, right click on the doors and select Add To Palette.

That will popup door properties window again, but this time you will be able to change its resref in Advanced tab and Blueprint ResRef field. Set a new resref, and then select a palette category (Basic tab), if there is none, where you will find the doors later.

By default the respawn will happen in 300 seconds after destruction. You can change this via variable:

Note that adding a pre-placed object into palette will automatically change its resref to the new resref you choose in the properties window, however any other changes you made during this process will not be copied to the pre-placed object in area. Therefore I recommend to delete the pre-placed object and place it again from palette.

Other Scripts and variables for Doors

Script sh_useablefalse in OnOpen event will make doors no longer useable and interactable after opened. I sometimes do this in instances areas especially if the door is obstructing another object somehow. This can be used for placeables as well, they will turn unusable if their inventory was emptied, but in case of placeable you want to put this script into OnClosed event instead.

Doors with area transition can have additional variables: