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
Making a breakable wall
Adny Offline
Posting Freak

Posts: 1,766
Threads: 6
Joined: Mar 2012
Reputation: 173
#3
RE: Making a breakable wall

To do this, create a small script_area, size it the approximate size of the wall you want to break, then place it in front of the wall. The key to placing it is to do so in a way so that if an object (i.e. a barrel) is thrown at the wall, it will hit the script_area first; you do not want the script_area to be so far out as to break the wall at an unrealistic distance. After doing so, you can use this script, replacing all necessary information (i.e. the name of the item, function, script area and wall).

void OnStart()
{
AddEntityCollideCallback("NAME_OF_OBJECT", "NAME_OF_SCRIPT_AREA", "FUNC", true, 0);
}

void FUNC(string &in asParent, string &in asChild, int alState)
{
SetPropHealth("NAME_OF_WALL", 0.0f);
}

Hope that helped!

I rate it 3 memes.
07-28-2012, 07:02 AM
Find


Messages In This Thread
Making a breakable wall - by Soverain - 07-28-2012, 06:48 AM
RE: Making a breakable wall - by Your Computer - 07-28-2012, 07:01 AM
RE: Making a breakable wall - by Adny - 07-28-2012, 07:02 AM
RE: Making a breakable wall - by Soverain - 07-28-2012, 07:26 AM
RE: Making a breakable wall - by Adny - 07-28-2012, 07:29 AM
RE: Making a breakable wall - by Soverain - 07-28-2012, 07:35 AM



Users browsing this thread: 1 Guest(s)