Frictional Games Forum (read-only)
[SCRIPT] Unlock a door. - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Unlock a door. (/thread-21566.html)



Unlock a door. - Bonehead - 05-21-2013

I've been searching everywhere but cannot seem to find it. I don't mean to unlock a door with a key.. just that when I pick up an item.. the door unlocks automatically. Any way to do that?


RE: Unlock a door. - Adrianis - 05-21-2013

Sure can!

void SetSwingDoorLocked(string& asName, bool abLocked, bool abEffects);
http://wiki.frictionalgames.com/hpl2/amnesia/script_functions#doors


Also, if you want to trigger the unlock on item pickup, you can use this

void SetEntityCallbackFunc(string& asName, string& asCallback);

Calls a function when the player interacts with a certain entity.
Callback syntax: void MyFunc(string &in asEntity, string &in type)
Type depends on entity type and includes: “OnPickup”, “Break”, “OnIgnite”, etc"
http://wiki.frictionalgames.com/hpl2/amnesia/script_functions#entities