![]() |
How to use crowbar to unlock door? (Solved) - 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: How to use crowbar to unlock door? (Solved) (/thread-6131.html) Pages:
1
2
|
How to use crowbar to unlock door? (Solved) - HumiliatioN - 01-09-2011 Okay why my Crowbar is not working with the door? What i am doing wrong? Simple Script using crowbar on "Prison door" i use that crowbar but then it disappears and its gone.. And door is locked.. Full Script just in case: void OnStart() { SetPlayerLampOil(0); //if(ScriptDebugOn()) //{ // GiveItemFromFile("lantern", "lantern.ent"); // for(int i=0;i<10;i++) GiveItemFromFile("tinderbox_"+i, "tinderbox.ent"); // SetPlayerLampOil(100); //} AddUseItemCallback("", "crowbar_1", "prison_section_1", "UsedCrowbarOnDoor", true); AddEntityCollideCallback("crowbar_joint_1", "ScriptArea_1", "CollideAreaBreakDoor", true, 1); } void OnEnter() { } /// Actual Functions void UsedCrowbarOnDoor(string &in asItem, string &in asEntity) { AddTimer("", 0.2, "TimerSwitchShovel"); RemoveItem("crowbar_1"); } void TimerSwitchShovel(string &in asTimer) { PlaySoundAtEntity("","puzzle_place_jar.snt", "", 0, false); SetEntityActive("crowbar_joint_1", true); } void CollideAreaBreakDoor(string &in asParent, string &in asChild, int alState) { AddPlayerSanity(25); PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false); SetSwingDoorLocked("prison_section_1", false, true); SetMoveObjectState("prison_section_1", 1); PlaySoundAtEntity("","break_wood_metal", "AreaBreakEffect", 0, false); CreateParticleSystemAtEntity("", "ps_hit_wood", "AreaBreakEffect", false); SetEntityActive("crowbar_joint_1", false); SetLocalVarInt("Door", 1); } RE: How to use crowbar to unlock door? - triadtimes - 01-09-2011 (01-09-2011, 09:24 PM)HumiliatioN Wrote: Okay why my Crowbar is not working with the door? Here is what I have (Must have gotten it from the same place.) Spoiler below!
What is the problem? Can you not interact with the crowbar once it is in the door? Is the crowbar showing up at all? RE: How to use crowbar to unlock door? - HumiliatioN - 01-09-2011 What is the problem? Can you not interact with the crowbar once it is in the door? Is the crowbar showing up at all? I cant interact and its not showing at all. :/ RE: How to use crowbar to unlock door? - triadtimes - 01-09-2011 (01-09-2011, 10:53 PM)HumiliatioN Wrote: What is the problem? Can you not interact with the crowbar once it is in the door? Is the crowbar showing up at all? Do you have a "crowbar_joint" which is not active on your door in the Level Editor? Because the code does the following: Spoiler below!
The problems might be that you don't have a crowbar_joint_1 (which should be not active) at prison_section_1, and you might not have all of the necessary scripting areas. RE: How to use crowbar to unlock door? - HumiliatioN - 01-09-2011 The problems might be that you don't have a crowbar_joint_1 (which should be not active) at prison_section_1, and you might not have all of the necessary scripting areas. Oh, I Forgot that thanks... But now its only opens and there is that Area effect but not that when you must turn that crowbar to open.. Only Soundeffect and particle then its open not that Crowbar animation i mean ![]() RE: How to use crowbar to unlock door? - triadtimes - 01-09-2011 (01-09-2011, 11:38 PM)HumiliatioN Wrote: The problems might be that you don't have a crowbar_joint_1 (which should be not active) at prison_section_1, and you might not have all of the necessary scripting areas. I think your problem is that you have your area directly on the crowbar It should look (somewhat) like this: Spoiler below!
I think yours looks like this: Spoiler below!
RE: How to use crowbar to unlock door? - HumiliatioN - 01-09-2011 Oh many thanks now it works ![]() You are good with scripting ![]() RE: How to use crowbar to unlock door? (Solved) - Tony32 - 01-11-2011 Surely an intresting script. I think I'll use it aswell. Thank you! ![]() RE: How to use crowbar to unlock door? (Solved) - Vradcly - 01-28-2011 Now I am trying this aswell, but there is one thing that is a bit unclear. Where do I create the joint?, Is the joint also a script area or what is it and how do I create it? Cant find joint creation on the level editor, so it must be something else that i just move into position and call a joint? RE: How to use crowbar to unlock door? (Solved) - Vradcly - 01-28-2011 Nwm, now i understand, its an entity of the crowbar ![]() |