Frictional Games Forum (read-only)
[Help Needed] Key found in one level used on Door in another. - 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: [Help Needed] Key found in one level used on Door in another. (/thread-19709.html)



[Help Needed] Key found in one level used on Door in another. - Jeeper - 12-28-2012

Hello!

As the title says, i wonder how to make a key that you find in one level open a door in another level. In what Hpl File should it be in? The one with the door? The one with the key? Or maybe both?

Thanks a lot!


RE: [Help Needed] Key found in one level used on Door in another. - Adny - 12-28-2012

As long as you don't try to duplicate key/door names, it should work fine with a regular script when you transfer it from level to level. Just be sure to put the callback/function in the same level as the door


RE: [Help Needed] Key found in one level used on Door in another. - The chaser - 12-28-2012

The key you find in the level 1 is named "Key". The door in the 2 level is named "Door".

Code for level 2:

Code:
void OnStart()
{
AddUseItemCallback("", "Key", "Door", "Opendadoor", true);
}

void Opendadoor (string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("Door", false, true);
}