09-26-2012, 02:33 PM
Enjoy. Script is right down here
Spoiler below!
void OnStart()
{
AddEntityCollideCallback("Sledgehammer", "ImpactArea", "ImpactScript", false, 1);
}
// BreakableDoor_1 == Mansion_1 door
// Pieces_1/2 == custom Mansion_Broken made static and undying (-1 lifetime)
// Pieces just behind the door, the ImpactArea veeery close to BreakableDoor_1.
// Sledgehammer= Item used to destroy it.
// BreakEffect areas are on BreakableDoor_1
void ImpactScript (string &in asParent, string &in asChild, int alState)
{
if(GetLocalVarInt("BreakDoorInt") == 3)
{
SetEntityActive("ImpactArea", false);
SetPropStaticPhysics("Pieces_2", false);
SetPropStaticPhysics("Pieces_1", false);
AddPropImpulse("Pieces_1", 0.5, 1, 3, "world");
AddPropImpulse("Pieces_2", 0.6, 0.3, 2.5, "world");
CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect", false);
PlayGuiSound("break_wood_metal.snt",2);
}
if(GetLocalVarInt("BreakDoorInt") == 2)
{
PlaySoundAtEntity("", "break_wood_metal.snt", "Pieces_1", 0, false);
SetPropHealth("BreakableDoor_1", -1);
AddPropImpulse("BreakableDoor_1", 0, 0, -0.5, "world");
}
PlaySoundAtEntity("", "break_wood.snt", "BreakableDoor_1", 0, false);
AddLocalVarInt("BreakDoorInt", 1);
CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect", false);
CreateParticleSystemAtEntity("", "ps_hit_wood", "BreakEffect2", false);
}
How To: Create the custom .ent
- Go to your Amnesia/Entities/Door/Mansion folder
- Copy-Paste mansion_broken.ent and rename it to mansion_broken_static
- Open mansion_broken_static with a text editor
- Find and replace the value 4 with -1
- Open HPL, there should be another entity named Mansion_Broken_static and voilĂ , you have door pieces that don't fade. Check the STATICPHYSICS box and you're done.
In the video I've placed two mansion_broken_static entities right behind the door.