Car Explosions: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (→‎The Thrust: Formatting tweaks)
m (→‎The Outputs: Minor English syntax tweaks)
Line 65: Line 65:
==The Outputs==
==The Outputs==


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


Line 73: Line 73:
And 90 is the perfect amout for grenades, rocket but none other gun!
And 90 is the perfect amout for grenades, rocket but none other gun!


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


{|
{|
Line 92: Line 92:
|}
|}


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 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?
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 :
Well just copy the outputs of the car and change the OnHealthChanged to OnBreak, like this:


{|
{|
Line 116: Line 116:
Here for the Fuel Tank!
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!
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 04:07, 8 December 2005

Broom icon.png
This article or section needs to be cleaned up to conform to a higher standard of quality.
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.

Introduction

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 (I'll 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 die.

  • 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, 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

OK, 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:

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 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:

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

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! 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