The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SCRIPT] Breakable Door
Vic7im Offline
Junior Member

Posts: 44
Threads: 9
Joined: Sep 2012
Reputation: 3
#1
[SCRIPT] Breakable Door





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.
(This post was last modified: 09-26-2012, 02:41 PM by Vic7im.)
09-26-2012, 02:33 PM
Find


Messages In This Thread
[SCRIPT] Breakable Door - by Vic7im - 09-26-2012, 02:33 PM
RE: I'll just leave this here. - by Robby - 09-26-2012, 02:34 PM
RE: [SCRIPT] Breakable Door - by Fatalist - 12-22-2012, 08:59 AM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-21-2013, 06:21 PM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-22-2013, 03:13 AM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-23-2013, 09:01 AM
RE: [SCRIPT] Breakable Door - by Knusper. - 03-23-2013, 10:33 AM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-23-2013, 10:41 AM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-23-2013, 02:54 PM
RE: [SCRIPT] Breakable Door - by Knusper. - 03-23-2013, 12:01 PM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-23-2013, 01:48 PM
RE: [SCRIPT] Breakable Door - by Knusper. - 03-23-2013, 06:09 PM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-24-2013, 08:04 AM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-24-2013, 08:21 AM
RE: [SCRIPT] Breakable Door - by Knusper. - 03-24-2013, 09:14 AM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-24-2013, 12:05 PM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-24-2013, 12:19 PM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-24-2013, 12:27 PM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-24-2013, 02:14 PM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-24-2013, 02:26 PM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-24-2013, 02:27 PM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-24-2013, 02:58 PM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-24-2013, 02:59 PM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-24-2013, 03:18 PM
RE: [SCRIPT] Breakable Door - by PutraenusAlivius - 03-24-2013, 03:19 PM
RE: [SCRIPT] Breakable Door - by Erik The Born - 03-24-2013, 03:30 PM
RE: [SCRIPT] Breakable Door - by Adrianis - 03-24-2013, 10:21 PM
RE: [SCRIPT] Breakable Door - by The chaser - 03-24-2013, 11:55 AM
RE: [SCRIPT] Breakable Door - by The chaser - 03-24-2013, 03:09 PM



Users browsing this thread: 1 Guest(s)