Post tutorial Report RSS Blow up a wall tutorial

This tutorial will show you how to make a wall get hit by an explosion and be destroyed. This assumes you know basic hammer functions.

Posted by on - Advanced Mapping/Technical

[page=First Step]
Create two brushes, as shown.

User Posted Image

Next, use the "clip tool" on one of the brushes, and get an angle similar to what I have. To make it only cut, and not delete, click the tool more then once, till the whole box is white, like shown. Hit enter when you like the angle.

User Posted Image

Now do the same for the other wall, make sure the edges meet at the bottom.

User Posted Image

Next select both your newly created clips, as shown, and hit "ctrl+t" to tie them to an entity. Make them a func_breakable.

User Posted Image

In the first tab, make the value for "prop data" stone medium. Then make "material type" cinder block. Give it the name "wall" (without quotes) Go the the "flags" tab and make sure the only thing checked is "only break on trigger" then Hit apply.

Next we need to make a button for the trigger. Create a prop_dynamic, and give it the keypad model. (its in props_lab) Place it away from the wall, but facing it so you can see the wall when you push it. Create a small brush directly in front of it, and tie it to entity func_button. Under "flags" make sure "don't move" is checked. The rest of the default settings will be fine.

Now lets create the explosions. On the inside corner of your walls, place an env_explosion entity. Name it "explosion" In the flags tab, check "no damage" and "no sound"

User Posted Image

Next are the sounds. Create a ambient_generic somewhere inside the map. I am doing it near the button so its easy to find. Name thi,s "explosion_sound" Now choose the sound. Click on "sound name" then browse. In the filter type HeadcrabCanister.Explosion. You can preview the sound. Hit OK then apply. Also make sure the "play everywhere" flag is enabled. Create another ambient generic just like this one, but call it "incoming" and give it the sound HeadcrabCanister.IncomingSound. Now we are ready to link all our entities.

Select the button and click on the "outputs" tab. Click on "add". On the first line,"my output named" click the down arrow and a list of your options will appear. Make it "OnPressed" the next line, "target entities named" , click the down arrow, and you should see a list of the 4 entities you can trigger. Select explosion. On the third line "via this input" select "explode". This will link the button with the explosion, so when pressed, the explosion will happen. Give it a delay of .5 seconds, and select "fire once" as shown in picture.

User Posted Image
User Posted Image
User Posted Image

Next we will tie the explosion sound to the button. Click add again. Set the output named to onpressed again, select the target entity "explosion_sound" and set the input to "playsound" (you will have to scroll down for it). Give it a dely of .5 seconds and fire once.

User Posted Image

same as before,add, then onpressed, then the entity named "incoming", via "playsound." For this one, do not delay the sound, but check fire once.

User Posted Image

Same as before, add, then "onpressed", the entity named "wall", via input "break" Delay .5 seconds, fire once. You should now have 4 outputs tied to this entity.

User Posted Image

Prepare Level. Add a floor, walls, and apply a skybox to the ceiling, as shown.
User Posted Image

Lighting - Add a light_environment to the map, close to the top of the skybox. Make the pitch -45. Now add a spawn point, info_player_start. Thats it. Compile and run. Push the button, watch the destruction.
User Posted Image

The result:
User Posted Image
User Posted Image
User Posted Image

Spruce it up. Make the destruction more random looking, texture the breaks in the walls with broken concrete, add rebar that will stick out when its blown up, have fun with it. I did this real fast, just for fun. Put a bunch of combine on top of the building then blew it up.
User Posted Image

Post comment Comments
Collo
Collo - - 56 comments

clear n simple, gj!

Reply Good karma Bad karma+1 vote
hip_hop_x
hip_hop_x - - 6 comments

Nice tutorial A+.

Reply Good karma Bad karma+1 vote
AccursedAce
AccursedAce - - 2 comments

nice tutorial

Reply Good karma Bad karma+1 vote
bertrum
bertrum - - 1 comments

Fo whatever reason, my wall doesn't collapse with the explosion.

The button is set to trigger the explosion to go off like you stated above, but the wall just sits there.

Is it possible that the wall is too big?

Any ideas?!?!?!

Reply Good karma Bad karma+1 vote
jeremebp Author
jeremebp - - 4 comments

Re-read the 4th function for the button trigger. It needs to be set to "break" the broken part of the wall at the same time the explosion is triggered, the explosion itself won't break the wall as we set the wall to break on trigger only, and like I said before, the trigger is the button not the explosion.

Reply Good karma+1 vote
barness
barness - - 28 comments

I could spend days filling up rooms and blowing people up like that, thanks!

Reply Good karma Bad karma+1 vote
XV8Crisis
XV8Crisis - - 7 comments

Excellent tutorial, really helpful.

PS: Great idea with blowing up the combine, it is really funny and cool!

Reply Good karma Bad karma+1 vote
drhead
drhead - - 59 comments

Awesome Nice and clear been looking for help with da clip tool to .

Reply Good karma Bad karma+1 vote
laserpanda
laserpanda - - 181 comments

does it have to be triggered by a button instead of just shooting it with a rocket or other weapon, that would seem more useful

Reply Good karma Bad karma+1 vote
foxconn_subversion
foxconn_subversion - - 5 comments

nicely done.

Reply Good karma Bad karma+1 vote
Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: