I haven't seen anything on this yet so for those who don't know, this is how you can script doors to lock/unlock
To lock a dynamic door, you can block it using a dynamic shape and unlock it by unspawning the shape.
The best shape for this is the ‘Wood Plank.’ Place the plank against the door and wedge part of it inside a tight gap using static shapes. This will keep the plank from moving and should block the door. Then you can customise the door angle so that it only opens in one direction, towards the wedge/plank. (you may need a few planks so its strong enough that it can't be kicked open.)
To unlock it, unspawn the plank – I usually script it to unlock on the destruction of the ‘Animal Chain Lock’ or some kind of power supply.
This can also be done with generic dynamic shapes but their physics don't work until you give them a nudge. If you spawn another dynamic shape to fall on it and nudge it, this should do the trick.
true, I usually use them where the player has no weapons to start with and has to escape a prison or something
you can also create an indestructible sort of fake door with the planks by wedging a few of them across a doorway to block it and hiding them with the big letter 'I's which can also be spawned/unspawned.
Here is a list of indestructible (un)spawnable blocking objects without physics if you want to create obstacles that can withstand explosions and only be overcome through scripting.
Some of those dynamic objects are only available if you use my "New Assets"-map as a base for your map (or if you're on PC, using my editormod).
I'll be publishing a new version of the New Assets map soon, it will feature more texturable objects.![]()