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
(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..
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.
void OnStart() { AddEntityCollideCallback("", "AREANAME", "WallCrush", true, 1); //Change AREANAME to your area's name at the part where you want it to be crushed. }
void WallCrush(string &in asParent, string &in asChild, int 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.)
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);