Doors unlocked after picking up the key? - 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: Doors unlocked after picking up the key? (/thread-10812.html) |
Doors unlocked after picking up the key? - Darkdevil725 - 10-17-2011 My doors were working just fine this morning but after adding some scripting now my doors unlock as soon as I pick up there respective keys rather than waiting till I use them. I check the scripting and nothing has changed. Thats the script, what is wrong? void OnStart() { } void OnEnter() { AddUseItemCallback("", "Study_Closet_Key", "Study_Closet", "KeyOnDoor", true); AddUseItemCallback("", "hallway_key_1", "hallway_door_1", "KeyOnDoor", true); AddEntityCollideCallback("Player", "hallway_door_slam_1", "func_slam", true, 1); SetEntityPlayerInteractCallback("mansion_4", "func_slam", true); } void KeyOnDoor(string &in asItem, string &in asEntity) { SetSwingDoorLocked("Study_Closet", false, true); PlaySoundAtEntity("", "unlock_door", "Study_Closet", 0, false); RemoveItem("Study_Closet_Key"); SetSwingDoorLocked("hallway_door_1", false, true); PlaySoundAtEntity("", "unlock_door", "hallway_door_1", 0, false); RemoveItem("hallway_key_1"); } void func_slam(string &in asParent, string &in asChild, int alState) { SetSwingDoorClosed("hallway_door_2", true, true); PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); GiveSanityDamage(5.0f, true); } void func_slam(string &in asEntity) { SetPropHealth("mansion_4", 0.0f); PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false); PlaySoundAtEntity("", "react_scare", "Player", 0, false); PlaySoundAtEntity("", "close_door.snt", "Player", 0, false); GiveSanityDamage(5.0f, true); } void OnLeave() { } RE: Doors unlocked after picking up the key? - Your Computer - 10-17-2011 Your script shows that unlocking one door unlocks both doors, but it doesn't show that they unlock when picking up a key. RE: Doors unlocked after picking up the key? - Darkdevil725 - 10-17-2011 (10-17-2011, 05:31 AM)Your Computer Wrote: Your script shows that unlocking one door unlocks both doors, but it doesn't show that they unlock when picking up a key.Where are you seeing that at and what alterations should I make to fix it? RE: Doors unlocked after picking up the key? - Your Computer - 10-17-2011 (10-17-2011, 05:33 AM)Darkdevil725 Wrote: Where are you seeing that at and what alterations should I make to fix it? Replace this: Code: void KeyOnDoor(string &in asItem, string &in asEntity) With: Code: void KeyOnDoor(string &in asItem, string &in asEntity) RE: Doors unlocked after picking up the key? - Darkdevil725 - 10-17-2011 THANKS! |