Frictional Games Forum (read-only)
Leveldoor lock doesn't work properly - 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: Leveldoor lock doesn't work properly (/thread-17512.html)



Leveldoor lock doesn't work properly - Lukaboy8 - 08-05-2012

Hello everybody,

I have a key called Bedroomkey and a leveldoor called Bedroomlevel. Now I have this script:

PHP Code:
void UsedKeyOnDoor(string &in asItemstring &in asEntity)
{
 
SetSwingDoorLocked("Bedroomlevel"falsetrue);
 
PlaySoundAtEntity("""unlock_door""Bedroomlevel"0false);
 
RemoveItem("Bedroomkey");


I can here the unlock_door sound and the Bedroomkey is gone from my inventory but the door is not unlocked :/ How can I fix this?

Luke


RE: Leveldoor lock doesn't work properly - Steve - 08-05-2012

You need SetLevelDoorLocked for level doors Wink

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetLevelDoorLocked("Bedroomlevel", false);
PlaySoundAtEntity("", "unlock_door", "Bedroomlevel", 0, false);
RemoveItem("Bedroomkey");
}



RE: Leveldoor lock doesn't work properly - Lukaboy8 - 08-05-2012

Thanks didn't know about thatWink