![]() |
Crowbar Issue (Almost there!) - 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: Crowbar Issue (Almost there!) (/thread-12246.html) |
Crowbar Issue (Almost there!) - Tiiwh - 01-01-2012 Hi ![]() So I am having a bit of a problem with my crowbar that is supposed to unlock a door and then shut it open. I know there is a lot of threads of people having crowbar issues, but I have read every single one I have found but it still doesn't work the way I want. I have come to the point where I can put the crowbar between the wall and the door, but then it just unlocks itself BEFORE I have pulled it to the script area. And the crowbar just stays there in the door and I can open it, I want to drag it and then make the door open, also the sound of the door being unlocked is also appearing to fast. Please help me with this ![]() Here is my script about the crowbar: void OnStart() { StopMusic(0, 1); AddEntityCollideCallback("Player", "Locked_Desktop_Area", "GetDesktopQuest", true, -1); AddEntityCollideCallback("Player", "Sound_Area1", "GetSound_Area1", true, 1); AddTimer("Water_Objects", 0.01, "FloatObjects"); AddUseItemCallback("", "crowbar_1", "prison_locked", "CrowbarOnDoor", true); AddEntityCollideCallback("crowbar_joint_1", "door_script_1", "crowbarfunc", true, 1); } void CrowbarOnDoor(string &in asItem, string &in asEntity) { SetEntityActive("crowbar_joint_1", true); SetSwingDoorLocked("prison_locked", true, false); PlaySoundAtEntity("", "unlock_door", "prison_locked", 0, false); RemoveItem("crowbar_1"); } void crowbarfunc(string &in asParent, string &in asChild, int alState) { SetPropHealth("prison_locked", 0.0f); SetEntityActive("crowbar_joint_1", false); SetEntityActive("crowbar_dyn_1", true); } __ Please help ~ RE: Crowbar Issue (Almost there!) - flamez3 - 01-01-2012 The reason the door is unlocking too early is because the script tells it to. void OnStart() { StopMusic(0, 1); AddEntityCollideCallback("Player", "Locked_Desktop_Area", "GetDesktopQuest", true, -1); AddEntityCollideCallback("Player", "Sound_Area1", "GetSound_Area1", true, 1); AddTimer("Water_Objects", 0.01, "FloatObjects"); AddUseItemCallback("", "crowbar_1", "prison_locked", "CrowbarOnDoor", true); AddEntityCollideCallback("crowbar_joint_1", "door_script_1", "crowbarfunc", true, 1); } void CrowbarOnDoor(string &in asItem, string &in asEntity) { SetEntityActive("crowbar_joint_1", true); RemoveItem("crowbar_1"); } void crowbarfunc(string &in asParent, string &in asChild, int alState) { SetPropHealth("prison_locked", 0.0f); SetEntityActive("crowbar_joint_1", false); SetEntityActive("crowbar_dyn_1", true); PlaySoundAtEntity("", "unlock_door", "prison_locked", 0, false); } Use that. Is it telling you any fatal errors? Or is it just not working right? RE: Crowbar Issue (Almost there!) - Tiiwh - 01-01-2012 It's just not working right that's it, it doesn't crash or anything. Anyway, thanks! I will let you know if it still doesnt work. |