Friday, November 20, 2009

Lesson 14 - Explosions - Bombs - Mines - dod_bombtarget

If you are New to Mapping Click this link and start at the beginning.



To make a bomb you need to use env_explosion.


Select the entity tool.


Choose env_explosion from the pulldown menu.


Place it in your map.


To make the env_explosion explode, you need to use either a trigger brush, a button, or a logic_timer.


Double click on the env_explosion. And give your env_explosion a name. Click apply.


Also, if you want the explosion to go off more than once then go to the "flags" tab, and put a check mark in the checkbox next to "repeatable", click apply.


Trigger_Multiple


Now, we will use the trigger brush to explode the bomb. Draw the trigger brush and double-click on it, hit Ctrl-t on your keyboard. From the pulldown menu select trigger_multiple. Then click apply.

Now, select the "output" tab on the dialog box. Click "add"
Put on "my output named" - OnStartTouch
(that means when they touch the trigger the action will start)
"targets entities named" - boom
(that is the name of our env_explosion)
"via this input" - explode
(this is what you want the named entity to do)
"with parameter of override of" (not used)
"after a delay in seconds of" - 0.00
(this is used to delay the action should be necessary, for example if you set it to five, then five seconds after someone touched it, it would explode.)

After you change your settings, don't forget to click apply.


Arrange the trigger_multiple and the env_explosion like it is shown in the pic above. Now when you compile the map this will act like a little land mine, and when someone steps on it, it will explode. Compile the map and test it out. (Note: when you compile the map the trigger_multiple and the env_explosion will be an invisible, so you have to remember where they are to test it.)


Button


To make a button, draw a small brush using whatever texture you want. Double-click on the brush, and hit Ctrl-t on your keyboard. From the pulldown menu select func_button. Then click apply


Now, select the "output" tab on the dialog box. Click "add"
Put on "my output named" - OnPressed
(that means when they press the button the action will start)
"targets entities named" - boom
(that is the name of our env_explosion)
"via this input" - explode
(this is what you want the named entity to do)
"with parameter of override of" (not used)
"after a delay in seconds of" - 0.00
(this is used to delay the action should be necessary, for example if you set it to five, then five seconds after someone pressed the button, it would explode.)

Click apply
Compile your map, press the button and watch the explosion.


logic_timer


The final way to make a bomb explode, is to use a logic_timer. Select the entity tool, Choose logic_timer from the pulldown menu, and place it in your map. Next, Double-click on the logic timer.
Name - whatever
(you can give the name if you want to, but for this it is not necessary)
Start Disabled - no
(put no because, you want it to start active)
use random timer - Yes
(you want the bomb to be random, so you would say yes here)
minimum random interval 3 (the minimum wait time between explosions)
maximum random interval 100 (the longest it will wait to fire,)
refire interval (not used) (you would only used this if you were not using random)
( so anywhere between 3 and 100 seconds the bomb will randomly fire)


Now, select the "output" tab on the dialog box. Click "add"
Put in
"my output named" - OnTimer
(that means when the time is up the action will take place)
"targets entities named" - boom
(that is the name of our env_explosion)
"via this input" - explode
(this is what you want the named entity to do)
"with parameter of override of" (not used)
"after a delay in seconds of" - 0.00
(this is used to delay the action should be necessary, for example if you set it to five, then five seconds after someone pressed the button, it would explode.)

Click apply

Compile your map, and watch the explosion.


dod_bombtarget


These can be used to blow up walls and stuff.


First, Select the entity tool, Choose dod_bombtarget from the pulldown menu, and place it in your map.

Then draw a brush using a brick texture and make a wall.


Use the carve tool and cut the wall into three sections.


Select the middle section. Hit Ctrl-t on your keyboard, from the pulldown menu select func_breakable. Click apply. And give it a name, I named mine wall1. Change the material type to cinder block. Click apply


click the "flags" tab. Put a checkmark in the checkbox next to "only break on trigger" this way if someone shoots the wall or throws a grenade at it it will not break.

Click apply


Place your dod_bombtarget next to the wall and line it up nice and neat. Double-click on your dod_bombtarget and select which team you want to be able to plant their bomb , then click apply.


Now, select the "output" tab on the dialog box. Click "add"
Put in
"my output named" - OnBombExploded (that means when bomb explodes the action will take place)
"targets entities named" - wall1
(that is the name of our wall)
"via this input" - break
(this is what you want the named entity to do)
"with parameter of override of" (not used)
"after a delay in seconds of" - 0.00
(this is used to delay the action should be necessary, for example if you set it to five, then five seconds after someone pressed the button, it would explode.)


Now we need, Bombs for the players to pick up, use the entity tool to place a prop_static in your map. Double-click on the prop static and change the world model to "models/props_crates/tnt_dump.mdl" click apply
then using the trigger texture draw a brush enclosing the model of the TNT. Double-click on the brush and Hit Ctrl-t and change the trigger brush into a "dod_bomb_dispenser". Click apply and you are done.

Compile the map, join the correct team, and plant the bomb.



That's the basics, now you can be creative with it, for example you can put an explosion in front of the tank model, on a timer and it will look like the tank is firing.


Put another env_explosion downrange from the tank name it " boom2". then dubbleclick on the timer select the "output" tab and click add. then add
"my output named" - OnTimer
"targets entities named" - boom2
"via this input" - explode
"with parameter of override of" (not used)
"after a delay in seconds of" - 3 (this way when the tank fires three seconds later the other explosion will go off and it will look like that's where the shell landed that the tank fired.)

Don't forget to check the "repeatable" checkbox under the "flags" tab on the env_explosion.

The rest is up to you.

6 comments:

Judah said...

Thank you SO much for your whole blog, it really is the EASIEST bunch of tutorials that I have found!

You may have no time, or maybe you don't even map anymore but I was wondering if you could explain a concept to me? I am creating a map where the allies have to break into an Axis bank vault and steal valuable documents/treasure/whatever really. Is there any way to create this capture the flag type scenario, and then have the allies bring back the item to their base?

Thank you, thank you ,thank you!!!

Pupster said...

Sorry that is beyond my capabilities.
You need someone who knows how to program code, like those people who make mods, like gun game, medic and stuff. They might be able to make the players be able to pick up stuff.

Thank you for you kind words.

Pup

Unknown said...

Big thanks to you also, you Guide is very clear and consice.
I am slowly creating my levels now.
I have one basic question that you may be able to help, when I load my level the camera is under my map and I cant seem to change this location having search online for the answer.
Any Ideas.

Pupster said...

Yes Nex,
You are talking about when the game starts and the camera shows some part of the map. That is controlled by the point_viewcontrol. Click on the entity tool, the one that looks like the chest piece. Select point_viewcontrol place it in your map where you want. It looks like a little blue movie camera. Go to the object properties by Double-clicking on the camera, then select "pitch yaw role (xyz) " Then click on the button called "point at" the mouse cursor will turn into a gun target. Wherever you click, is where the camera will point. You can put more than one point_viewcontrol in your map if you like. If you use more than one camera, the camera view changes every 10 seconds by default. We can change this by changing the "hold time" in the properties, but 10 seconds is fine. Also, if you do not put a point_viewcontrol. Then the default camera position is at (0,0, 0) the origin, the center of the map. You can avoid this by always centering your map at (0,0,0) before you compile. If not, no big deal, just add a point_viewcontrol and the problem will be fixed.

Unknown said...

awesome thanks mate, that sorted it.
Now to tackle lighting and water textures. I find myself trying to make things beyond my skills, rather than getting a working map down lol.

If you have any other tips or best practices, feel free to keep blogging!

Cheers once again for all your efforts.

Glassjaw said...

Hi Pupster, great tutorials. I have made my first map using your help and have it on rotation on my clan server. I uploaded it to map factory and it is called dod_para_s, which you can find through google. It's not the best map, but looks okay using your ideas for lighting, ambient sounds, fog, smoke and I also added in a moving panzer tank. My question is do you know much about modelling? I know that milkshape seens to be able to do it (I think) and if you do can you point me toward a tutorial to make static models.

P.S. I also have a blog - look up adct glassjaw and see my attempts at messing around dod source.