Igniting entities

== Igniting Entities ==
This tutorial uses an env_entity_igniter to light compatible entities on fire.
=== The Fiery Tool ===
First make a stick (long, thin brush), and make it into a func_physbox (ctrl-t).
A physbox is preferable so that the fire tool is like a "torch" you move with the Gravity Gun (and +USE key).
thumb| It should look like this.
The Prop Data was not set because it applies health, and you don't want to break your stick. You may also want to set the spawnflag "Only Break on Trigger", so that it will not break unless told to.
You may also want to set the "preferred carry angles" so the the stick always points the same way while being carried, something like (-5, 0, 90) is a good place to start.
After you've created your physbox, you'll want to move the origin to end of the stick, because that's where the fire will sit once it is caught alight (It also represents the center of mass, but that's hard to avoid). The origin is a little circle in the 2D views, and a blue orb in the 3D views (only visible when the physbox is selected).
Next, make the env_entity_igniter, this can be placed anywhere on the map.
The next entity we will need a is a trigger_multiple. Put it on end of the pole, like an extension (or a fire).
thumb| It should look like this.
Make sure you set the trigger's spawnflags correctly. The best choice is probably the "everything (except physics debris)" and the "physics debris" boxes. ; )
The outputs of the trigger should be as followed:
"trigger_igniter" Outputs
	My Output 	Target Entity	Target Input	Parameter	Delay	Only Once
	OnStartTouch	igniter 	Ignite 	<none> 	0.00 	No
Setting the env_entity_igniter's target to "!activator" will make it ignite whatever triggers the trigger_multiple.
Now you may have noticed that the trigger starts disabled, and the stick is not fire yet, hmm...
=== The Source Fire ===
Make an env_fire entity somewhere on your map. Make sure set its spawnflags to your liking; You'll probably at least want "Start On" and "Infinite Duration". Then make another trigger_multiple around the fire.
Make this trigger exactly like the one on your stick:thumb| It should look like this.
Trigger Outputs
	My Output 	Target Entity	Target Input	Parameter	Delay	Only Once
	OnStartTouch	igniter 	Ignite 	<none> 	0.00 	No
This will cause the stick (and more) to ignite, but not enable the sticks own igniter, so continue reading...
==== The spread ====
The simplest thing to do is to have the pole enable the trigger when damaged, like this:
"physbox_pole" Outputs
	My Output 	Target Entity 	Target Input	Parameter	Delay	Only Once
	OnHealthChanged	trigger_igniter	Enable 	<none> 	0.00 	No
	OnHealthChanged	trigger_igniter	Disable 	<none> 	10.00	No
This way, when the pole is damaged, it enables the trigger (and lets you burn more things) for 10 seconds, which is the default flame lifetime set by the env_entity_igniter.
Unfortunately, now the pole will enable the trigger when it takes damage in any way!
To fix this we will use a filter_damage_type
 
Make sure you set "physbox_pole"'s keyvalue "damage filter" to "filter_burn".
=== Victims ===
thumb| It should end up something like this.
*A nice place to start is a func_physbox, since you already know all about them from trying to understand this tutorial ; )
*The next step up would be to use a prop_physics (Pick a model that breaks!). Like "models/props_junk/wood_crate001a.mdl"
*An interesting entity is the func_breakable because it does not "catch" fire. You will need keep a fire close by to constantly supply damage until it breaks. If you're really ambitious, you may even add a func_detail "cage" around your breakable, so the player knows this object cannot be picked up.
*A fun one is the prop_ragdoll. Since they do not break, they can be re-lit many times.
**A cool model might be: "models/zombie/classic_torso.mdl" or "models/zombie/zombie_soldier_torso.mdl".
*Of course, the most tempting option is an NPC, but they can be the hardest to successfully implement.
==== A note about NPC's ====
*Not all NPCs will react to being set on fire. Obviously, zombies will, but the best selection is the npc_metropolice (they dance and call for help).
*If you choose a hostile NPC, such as a zombie or a cop, be sure to use an ai_relationship to prevent them from starting a fight with you.
*If you place an NPC in your map, the game console will print the error at play time: "Warning: Level contains NPCs, but no path nodes." Although this error can be safely ignored, it is also easily fixed by adding an info_node under your NPC's feet (or really anywhere).
== Conclusion ==
thumb
Don't forget to make a player start, a Gravity Gun, and other things like an HEV Suit (or maybe a Healthcharger).
Your finished map should look like the picture -->
== Wrap up ==
Feel free to play around see what works, hopefully this article has stimulated your imagination.
* A flashier example map. 
 Credits 
* The tutorial was created by Bit Mage 14:37, 21 Mar 2008 (EST)
**Last update 12:05, 4 Jan 2009 (EST)
Category:Level Design
Category:Tutorials