Frictional Games Forum (read-only)
How to make a crowbar break a door? - 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 (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: How to make a crowbar break a door? (/thread-6832.html)



How to make a crowbar break a door? - Raymond - 03-09-2011

Title, i don't know how to make a crowbar break a door Huh.


RE: How to make a crowbar break a door? - Kyle - 03-09-2011

It took me from a few days to a week to figure it out, but the thing is it doesn't want to work the way I want it to work.

If you truely want to make a crowbar break a door, then go load the game level that had you break the door open with it, and copy and edit it to work with whatever you got planning. Don't forget the scripting!


RE: How to make a crowbar break a door? - Anxt - 03-10-2011

I actually put that into one of my most recent maps, and here's how it works:

First, you have the player use the crowbar on the door.

Next, you have, in the map, a NON-ACTIVE "crowbar_joint" entity. Upon using the crowbar on the door, set the crowbar_joint active. Now, basically the joint works as a lever. The next thing you need to do is create an area near the edge of the joint's movement limit, such that, when the crowbar reaches the area, it calls a new function.

So, to do this, you will need the following:

AddUseItemCallback for your crowbar and your door;
AddEntityCollideCallback for your crowbar_joint and your area;
Inactive crowbar_joint in the map, preferably placed such that it looks like it is going in the edge of the door;
An area on the map placed such that the joint will enter it towards the end of its movement range;
A function to open the door and give it an impulse, which will give the appearance of the crowbar prying the door open;
Sounds and effects if you so choose (like Kyle said, take a look at the map for the guest room from the main game for more details on this stuff)

That should be about it. Hope that helped Smile