Frictional Games Forum (read-only)
Level Doors & Keys - 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: Level Doors & Keys (/thread-9334.html)



Level Doors & Keys - Angerpull - 07-24-2011

Can keys open locked level doors? I tried it and it doesn work, the script is okay since I switched doors to try if there was something wrong with my script, but the key and the door worked fine but not the Level door. What's wrong?


RE: Level Doors & Keys - JenniferOrange - 07-24-2011

Keys can in fact open level doors, but level doors are very very different from swing doors.
You have to use SetLevelDoorLocked(string& asName, bool abLocked); instead of SetSwingDoorLocked.
Ex:
void OnStart()
{
AddUseItemCallback("", "nameofkey", "nameofleveldoor", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("nameofleveldoor", false);
SetLevelDoorLockedSound("nameofleveldoor", "door_level_wood_locked.snt");
RemoveItem("nameofkey");
}


RE: Level Doors & Keys - Angerpull - 07-24-2011

(07-24-2011, 03:09 AM)JenniferOrange Wrote: Keys can in fact open level doors, but level doors are very very different from swing doors.
You have to use SetLevelDoorLocked(string& asName, bool abLocked); instead of SetSwingDoorLocked.
Ex:
void OnStart()
{
AddUseItemCallback("", "nameofkey", "nameofleveldoor", "UsedKeyOnDoor", true);
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("nameofleveldoor", false);
SetLevelDoorLockedSound("nameofleveldoor", "door_level_wood_locked.snt");
RemoveItem("nameofkey");
}

Holy potato canon, that worked! Thank you! I am so glad this site exists.




RE: Level Doors & Keys - JenniferOrange - 07-24-2011

Haha, no problem. Smile Happy mapping!