Car Explosions: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 143: Line 143:
----
----


[[Category:LevelDesign]]
[[Category:Level Design]]

Revision as of 16:28, 14 November 2005

by Mxthe

To Begin

In this tutorial i'm going to explain how to blow cars at 10 meters with smoke, explosions and nice effects. You need to have the basic knowledge of the hammer. 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

Lets start, create a prop_physics_override

Name : Car1

World Model : (In the prop_vehicles folder, choose a car with a physic model.)

MinDamageToHurt : 90 (ill explain later)

There you have your car, put it at 10 units 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


The Effects

Now the explosions and smoke.

Create 5 env_explosion and put them at the 5 points of the car, like on a dice.

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 Fly

We got explosions, physexplosions but not enough to make a car fly!It is 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! So 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 none other gun!

So, in the Outputs of the car, put :

OnHealthChanged : ExplosionCar1 Explode OnlyOnce : Yes

OnHealthChanged : PhysExplosionCar1 Explode OnlyOnce : Yes

OnHealthChanged : PushCar1 ClearParent OnlyOnce : Yes

OnHealthChanged : PushCar1 Enable OnlyOnce : Yes

OnHealthChanged : SmokeCar1 TurnOn OnlyOnce : Yes

OnHealthChanged : FuelTankCar1 Break OnlyOnce : 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 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.


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 :

OnBreak : ExplosionCar1 Explode OnlyOnce : Yes

OnBreak : PhysExplosionCar1 Explode OnlyOnce : Yes

OnBreak : PushCar1 ClearParent OnlyOnce : Yes

OnBreak : PushCar1 Enable OnlyOnce : Yes

OnBreak : SmokeCar1 TurnOn OnlyOnce : Yes

Here for the Fuel Tank!

You may wonder why I didnt 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