Frictional Games Forum (read-only)
Key On a Cabinet - 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: Key On a Cabinet (/thread-17152.html)



Key On a Cabinet - TheIcyPickle - 07-21-2012

Ok, so quick question

what would I use to make a key on a closet door unlock it


Like

would this work

void OnStart()

{
AddUseItemCallback("", "key1", "door1", "KeyOnDoor", true);

}


void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door1", false, true);
PlaySoundAtEntity("", "unlock_door", "door1", 0, false);
RemoveItem("key1");
}


but for a closet door? I dont know what function you would use..


RE: Key On a Cabinet - SilentHideButFine - 07-21-2012

void OnStart()

{
AddUseItemCallback("", "Thekey", "TheDoor", "Thefunc", true);
}


void Thefunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("TheDoor", false, true);
PlaySoundAtEntity("", "unlock_door", "TheDoor", 0, false);
RemoveItem("Thekey");
}

try that!


RE: Key On a Cabinet - Adny - 07-21-2012

Doors, closets, and that desk with the swing door on the right hand side all use the same functions. Setswingdoorlocked will work properly on all of them.


RE: Key On a Cabinet - TheIcyPickle - 07-21-2012

right, but what function would that be?

hmm. I see what you mean, I've done level doors and regular doors no problem, but a closet door... Im not sure on.


RE: Key On a Cabinet - TheIcyPickle - 07-21-2012

ah thank you andy, always helpful!