First off, you'll need this for scripting.
http://wiki.frictionalgames.com/hpl2/amn..._functions
To make the crowbar joint, you'll need to add it to your map. Wedge it in the door to make it look as you want, then in the entity tab, uncheck the active box.
You can do this with chests, making them locked as well.
Now you just need to make the script, I'll assume you know how to set up the text file to read it for the map.
Under OnStart, set up the function for your crowbar, so when the player uses the crowbar on the door, it is taken away from their inventory and the joint is activated. Once the joint reaches the point you want it to break, unlock the door.
Should look like this:
void OnStart()
{
AddUseItemCallback("crowbar", "crowbar", "door", "AttatchCrowbar", true);
}
void AttatchCrowbar(string &in asItem, string &in asEntity)
{
SetEntityActive("crowbar_joint", true);
RemoveItem(asItem);
}
Now to set it so the door breaks open, make a small area that when the crowbar is bent, it'll collide with an area. Add it to your OnStart, also add the callback to unlock the door. Also, remove the crowbar joint so it's not just floating there.
void OnStart()
{
AddUseItemCallback("crowbar", "crowbar", "door", "AttatchCrowbar", true);
AddEntityCollideCallback("crowbar_joint", "AreaOpenDoor", "OpenDoor", true, 1);
}
void AttatchCrowbar(string &in asItem, string &in asEntity)
{
SetEntityActive("crowbar_joint", true);
RemoveItem(asItem);
}
void OpenDoor(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("crowbar_joint", false);
void SetSwingDoorLocked("door", false, false);
}
You will use the same callback when using a key to unlock a door, or anything for that matter. Just add an AddUseItemCallback for your script and make it so the key unlocks whatever it's unlocking.
Let me know if this makes sense to you or not.