Explosive Mines

Tutorial collection, comprehensive listings on main site.

Explosive Mines

Postby Tutorial on Wed Mar 22, 2006 11:54 pm

category
General Half-Life 2/Entities

description
Blowing people up is so much fun, so why not blow the player up with this mine tutorial.

keywords
explosive, mines, mine.

In this tutorial I will tell you how to add an explosive, invisible, underground mine to your map. This tutorial can be very customizable so you can change some settings to your liking.

Our mine will be underground, and when the or a player steps on it, it will explode. According to your settings it can automatically kill the player or weaken their health.

First we need to make a skybox room, creat a sand, dirt, or rock floor, and put in an info_player_start, ONLY at one of the corners of our floor.

Image

So we made our setting, now we need to make the actual mine. Create a 48x48x80 box in the CENTER of the floor. Select it and cover it with our trigger texture. Then CTRL-T and make it a trigger_multiple, NOT a trigger_once or any other type of trigger.

Keyvalues:

Name: explosion_trigger1 (not necassary)
Delay Before Reset: 3 seconds is resonable if you ONLY WANT IT TO BE CONTINUOS

Flags to check:

Clients should be checked, but it can be unchecked if you want it to.

You can check anything else if you want to.

We then want to create the explosion entity. In the CENTER of your trigger_multiple make an env_explosion. ALT-ENTER and place the following keyvalues:

Keyvalues:

Name: explosion1
Magnitude: (The amount of damage you want the mine to do do the player, mine will be 150)

Flags:

Repeatable if you want the mine to be continuous.

All the other flags can be checked or unchecked to your liking.

Image

Now the triggering.

Go back to the trigger_multiple and ALT-ENTER. Go to Outputs, click "Add" and type in the following:

My output named: OnEndTouch
Targets entities named: explosion1
Via this input: Explode

(Delay seconds can be added but not recommended)

NOTE: If the explosion is repeatable the trigger output "Fire once only" must NOT be checked.

Press apply and exit.

Image

Now we want to add some realism. When a person gets off a mine there is a "tick" noise. Right after that tick the explosion happens.

Let's create an ambient_generic. Place it a few units above our env_explosion. ALT-ENTER and apply these Keyvalues:

Keyvalues:

Name: ambient_generic_tick1
Soundname: buttons/lightswitch2.wav
Volume: 10 (It's not a loud sound)
Max Audible Distance: 150

Flags to be checked:

Start Silent
Is NOT Looped

Press apply then exit.Now we have to trigger our ambient_generic.

Go back to our trigger_multiple, go to Outputs, click "Add" and insert the following:

My output named: OnStartTouch
Targets entities named: ambient_generic_tick1
Via this input: PlaySound

(There should be no delay seconds)

Under your trigger_multiple you should place a scorch decal so you know where the trigger you made is. Decals/scorch1 is good to use.

So there you have it! A fully exploding, ticking, and invisible mine. When the player enters the trigger_multiple the ticking sound will play, when the player leaves the trigger_multiple the explosion will go off, just like a real mine. Heres what it should look like in the end:

Image

Of course some settings can be changed. This is good for open fields for a player or players to walk upon. This tut is very customizable so if you want to add more like displacements, change the trigger box to a cyclinder, or add an extra explosion sound it can all be done.

Save, compile, and have fun blowing your self up.

Spas12
- Don't send PM's to this user -
Tutorial
Not A Real User
 
Joined: Sun Mar 06, 2005 11:00 pm

Postby Spas12 on Tue Apr 25, 2006 4:06 am

This also might be of use:

link
Past Treyarch Level Designer

Portfolio
Spas12
Veteran
Veteran
 
Joined: Thu Mar 31, 2005 3:21 pm
Location: trapped in level-design factory, send help

Postby Snap_shot on Mon Oct 09, 2006 9:43 pm

Does this work for css because i thought it would be funny to add to my map.
User avatar
Snap_shot
Member
Member
 
Joined: Fri Dec 16, 2005 7:59 pm

Return to Tutorials

Who is online

Users browsing this forum: No registered users