Car Explosions: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎The Outputs: Minor English syntax tweaks)
No edit summary
Line 1: Line 1:
{{cleanup}}
==Introduction==
==Introduction==


In this tutorial i'm going to explain how to blow cars at 10 meters with smoke, explosions and nice effects.
In this tutorial, I'm will explain how to blow up cars with smoke, explosions and nice effects.
You need to have the basic knowledge of the hammer.
You need to have the basic knowledge of the Hammer Editor.
This tutorial is not hard to follow, it is so easy that I figured it out as soon as I discovered the [[trigger_push]].
This tutorial is not hard to follow, it is so easy that I figured it out as soon as I discovered the [[trigger_push]].


==The Car==
==The Car==


Lets start, create a [[prop_physics_override]]
To start, create a [[prop_physics_override]]


* '''Name:''' Car1
* '''Name:''' Car1
Line 15: Line 13:
* '''MinDamageToHurt:''' 90 (I'll explain later)
* '''MinDamageToHurt:''' 90 (I'll explain later)


There you have your car; put it at 10 units above the ground.
There, you have your car; put it ABOVE the ground.


To do more realism and more fun, we are going to put a fuel tank that blows the car if we shoot it.
To do more realism and more fun, we are going to put a fuel tank that blows the car if we shoot it.
Line 24: Line 22:
* '''Parent:''' Car1
* '''Parent:''' Car1
* '''MaterialType:''' Metal
* '''MaterialType:''' Metal
You may want to make it circular or something.


==The Effects==
==The Effects==
Line 29: Line 29:
Now the explosions and smoke.
Now the explosions and smoke.


Create 5 [[env_explosion]] and put them at the 5 points of the car, like on a die.
Create 5 [[env_explosion]] and put them at the 5 points of the car, like on a die. (Sides, front, back, and bottom.)


* '''Name:''' ExplosionCar1
* '''Name:''' ExplosionCar1
Line 49: Line 49:
==The Thrust==
==The Thrust==


We got explosions, physexplosions but not enough to make a car fly! It's too heavy!
We got explosions and physexplosions, but not enough to make a car fly! It's too heavy!
So, create a brush at the center of your car, make it big enough to cover all the top of it, and it must start from the bottom of the car.
So, create a brush at the center of your car, make it big enough to cover all the top of it, and it must start from the bottom of the car.
Make it the trigger texture and TieToEntity [[trigger_push]].
Make it the trigger texture and TieToEntity [[trigger_push]].
Line 65: Line 65:
==The Outputs==
==The Outputs==


OK, we got this mess, but nothing works!
Okay, we got this mess, but nothing works!
So we must create the outputs!
We must create the outputs!


First, go in the car's properties.
First, go in the car's properties.


Remember the MinDamageToHurt? It makes the car ignore all damage less than 90.
Remember the MinDamageToHurt? It makes the car ignore all damage less than 90.
And 90 is the perfect amout for grenades, rocket but none other gun!
And 90 is the perfect amout for grenades, rocket but no other gun!


So, in the Outputs of the car, put:
So, in the Outputs of the car, put:
Line 93: Line 93:


Okay, I'll explain what we just did.
Okay, I'll explain what we just did.
We made that the car ignore damage less than 90, so if a damage ABOVE 90 is apllied to the car, the explosions blow, the smoke to start, the fuel tank to be destroyed and the trigger push forget his parents, because if we leave him parented to car1, the trigger would follow the car as long as it goes up and it would never end.
We made that the car ignore damage less than 90, so if a damage ABOVE 90 is applied to the car, the explosions blow, the smoke starts, the fuel tank gets destroyed and the trigger push forgets his parents (if we leave him parented to car1, the trigger would follow the car as long as it goes up and it would never end).




Line 114: Line 114:
|}
|}


Here for the Fuel Tank!


You may wonder why I didn't put an output to disable the car outputs in case the fuel tank blows!
You may wonder why I didn't put an output to disable the car outputs in case the fuel tank blows!
Because the explosions inflict the damage to the car, so it happens TWICE :-D
Because the explosions inflict the damage to the car, so it happens TWICE :-D
Now Compile the map and test it, watchout where the car falls :P
Now compile the map and test it, watchout where the car falls :P


[[Category:Level Design]][[Category:Tutorials]]
[[Category:Level Design]][[Category:Tutorials]]

Revision as of 21:23, 4 January 2006

Introduction

In this tutorial, I'm will explain how to blow up cars with smoke, explosions and nice effects. You need to have the basic knowledge of the Hammer Editor. This tutorial is not hard to follow, it is so easy that I figured it out as soon as I discovered the trigger_push.

The Car

To start, create a prop_physics_override

  • Name: Car1
  • World Model: (In the prop_vehicles folder, choose a car with a physic model.)
  • MinDamageToHurt: 90 (I'll explain later)

There, you have your car; put it ABOVE the ground.

To do more realism and more fun, we are going to put a fuel tank that blows the car if we shoot it.

Create a brush on the car where you want the fuel tank, choose a good texture for a fuel tank and make the fuel tank func_breakable.

  • Name: FuelTankCar1
  • Parent: Car1
  • MaterialType: Metal

You may want to make it circular or something.

The Effects

Now the explosions and smoke.

Create 5 env_explosion and put them at the 5 points of the car, like on a die. (Sides, front, back, and bottom.)

  • Name: ExplosionCar1
  • Parent: Car1
  • Magnitude: 100

Then create an env_physexplosion at the center of the car.

  • Name: PhysExplosionCar1
  • Parent: Car1
  • Magnitude: 500

Now, create an env_smokestack where you want the smoke to be, the engine is the better place :)

  • Name: SmokeCar1
  • Parent: Car1
  • Color: Choose it :P

The Thrust

We got explosions and physexplosions, but not enough to make a car fly! It's too heavy! So, create a brush at the center of your car, make it big enough to cover all the top of it, and it must start from the bottom of the car. Make it the trigger texture and TieToEntity trigger_push. Now make the trigger go as high as you want your car to fly.

  • Name: PushCar1
  • Parent: Car1
  • PushDirection: Up
  • StartDisabled: Yes
  • Speed: 1500
  • Flags: OnlyOnce, Physics, Pushables

Okay thats it for the trigger push, check that the Client flag is NOT enabled.

The Outputs

Okay, we got this mess, but nothing works! We must create the outputs!

First, go in the car's properties.

Remember the MinDamageToHurt? It makes the car ignore all damage less than 90. And 90 is the perfect amout for grenades, rocket but no other gun!

So, in the Outputs of the car, put:

Car outputs
My Output Target Entity Target Input Parameter Delay Only Once
Entity-output-icon.png OnHealthChanged ExplosionCar1 Explode <none> 0.00 Yes
Entity-output-icon.png OnHealthChanged PhysExplosionCar1 Explode <none> 0.00 Yes
Entity-output-icon.png OnHealthChanged PushCar1 ClearParent <none> 0.00 Yes
Entity-output-icon.png OnHealthChanged PushCar1 Enable <none> 0.00 Yes
Entity-output-icon.png OnHealthChanged SmokeCar1 TurnOn <none> 0.00 Yes
Entity-output-icon.png OnHealthChanged FuelTankCar1 Break <none> 0.00 Yes

Okay, I'll explain what we just did. We made that the car ignore damage less than 90, so if a damage ABOVE 90 is applied to the car, the explosions blow, the smoke starts, the fuel tank gets destroyed and the trigger push forgets his parents (if we leave him parented to car1, the trigger would follow the car as long as it goes up and it would never end).


Now the car is done, what about the Fuel Tank? Well just copy the outputs of the car and change the OnHealthChanged to OnBreak, like this:

Fuel tank outputs
My Output Target Entity Target Input Parameter Delay Only Once
Entity-output-icon.png OnBreak ExplosionCar1 Explode <none> 0.00 Yes
Entity-output-icon.png OnBreak PhysExplosionCar1 Explode <none> 0.00 Yes
Entity-output-icon.png OnBreak PushCar1 ClearParent <none> 0.00 Yes
Entity-output-icon.png OnBreak PushCar1 Enable <none> 0.00 Yes
Entity-output-icon.png OnBreak SmokeCar1 TurnOn <none> 0.00 Yes


You may wonder why I didn't put an output to disable the car outputs in case the fuel tank blows! Because the explosions inflict the damage to the car, so it happens TWICE :-D Now compile the map and test it, watchout where the car falls :P