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
Help with breakable wall!!
AtraNox Offline
Junior Member

Posts: 10
Threads: 4
Joined: Apr 2013
Reputation: 0
#1
Help with breakable wall!!

I wanted to make the player respawn in a cellar when he dies, and to get out he has to break the wall, just like in the main story.. But when I test the map the wall isn't breakable and the hand icon doesn't appear. Do you have any idea on what might be the problem? Thank you Big Grin
04-13-2013, 05:25 PM
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#2
RE: Help with breakable wall!!

Does the player require a tool to break the wall? Do you have an area infront of the wall with ItemInteraction checked?

"What you think is irrelevant" - A character of our time

A Christmas Hunt
04-13-2013, 05:33 PM
Find
AtraNox Offline
Junior Member

Posts: 10
Threads: 4
Joined: Apr 2013
Reputation: 0
#3
RE: Help with breakable wall!!

(04-13-2013, 05:33 PM)i3670 Wrote: Does the player require a tool to break the wall? Do you have an area infront of the wall with ItemInteraction checked?

No i wanted to make that the player has to hit the wall with something like a big throwable rock or a metal chair..
04-13-2013, 05:40 PM
Find
VeNoMzTeamHysterical Offline
Member

Posts: 240
Threads: 36
Joined: Dec 2012
Reputation: 3
#4
RE: Help with breakable wall!!

Script to break wall with hammer

Spoiler below!

{
AddUseItemCallback("", "stone_hammer_1", "cell_breakable_wall_1", "BreakWall", true);
}

void BreakWall(string &in asItem, string &in asEntity)
{
SetPropHealth("cell_breakable_wall_1", 0);
SetEntityActive("fragment1",true);
SetEntityActive("fragment2",true);
SetEntityActive("fragment3",true);
CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "impact", false);
}


Make a script area called Impact on the wall so there is gonna be dust.
Also name brick pieces frament1/2/3 you can make more if you liked to.

http://www.frictionalgames.com/forum/thread-21719.html
Evil Awaking Work In Progress!
Hours Spend 472.
04-13-2013, 06:11 PM
Website Find
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#5
RE: Help with breakable wall!!

(04-13-2013, 06:11 PM)VeNoMzTeamHysterical Wrote: Script to break wall with hammer

Spoiler below!

{
AddUseItemCallback("", "stone_hammer_1", "cell_breakable_wall_1", "BreakWall", true);
}

void BreakWall(string &in asItem, string &in asEntity)
{
SetPropHealth("cell_breakable_wall_1", 0);
SetEntityActive("fragment1",true);
SetEntityActive("fragment2",true);
SetEntityActive("fragment3",true);
CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "impact", false);
}


Make a script area called Impact on the wall so there is gonna be dust.
Also name brick pieces frament1/2/3 you can make more if you liked to.
YOU. READ. IT. WRONG. He wants the wall to be crushed by ANYTHING.
Create an area at the part where it's supposed to appear.
And now, try this one out.
Spoiler below!

PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("""AREANAME""WallCrush"true1); //Change AREANAME to your area's name at the part where you want it to be crushed.
}

void WallCrush(string &in asParentstring &in asChildint alState)
{
SetPropHealth("cell_breakable_wall_1"0); //Sets the wall to destruct
SetEntityActive("Fragment_1"true); //Fragment #1 that will appear
SetEntityActive("Fragment_2"true); //Fragment #2 that will appear
SetEntityActive("Fragment_3"true); //Fragment #3 that will appear
CreateParticleSystemAtEntity("""ps_dust_impact.ps""AREANAME2"false); //Creates a particle to add some dust particles
//And change AREANAME2 to whatever your area's name is. You can place it in front of the wall but it's better if it covered the entire hole.



"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 04-14-2013, 12:14 AM by PutraenusAlivius.)
04-14-2013, 12:13 AM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: Help with breakable wall!!

I don't think this line will work:
AddEntityCollideCallback("", "AREANAME", "WallCrush", true, 1);

Since you have no asParent, there will be no collision, and therefore the callback will not call.
Instead, you can define all the objects you're gonna need.
Call all the objects: "BreakWall_1, BreakWall_2, BreakWall_3 etc.
After that, create a for-script, and make it work with the collide function, so you can write:
AddEntityCollideCallback("BreakWall_"+i, "AREANAME", "WallCrush", true, 1);

Trying is the first step to success.
04-14-2013, 11:36 AM
Find




Users browsing this thread: 1 Guest(s)