Igniting entities: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
m (Unicodifying, replaced: [[Image: → [[File: (5))
 
(21 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<div style="text-align: left; background: lightblue; font-weight: bold; margin: 5em 10%; padding: 2em 1em; border: red 3px solid;">
Someone is currently in the process of editing this article. In order to prevent edit conflicts, please refrain from making edits until the other editor is done. This should not take more than 24 hours.
</div>
== Igniting Entities ==
== Igniting Entities ==
This tutorial uses an env_entity_igniter to light compatible entities on fire.
This tutorial uses an [[env_entity_igniter]] to light compatible entities on fire.
First make a stick, (long, thin brush) tie it to a [[func_physbox]] (ctrl-t).
 
=== 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 [[Weapon_physcannon|Gravity Gun]] (and +USE key).
{{entity-kvalue-start|[[func_physbox]]}}
{{entity-kvalue-start|[[func_physbox]]}}
{{entity-kvalue|Name|physbox_pole| The name that other entities refer to this entity by.}}
{{entity-kvalue|Name|physbox_pole| The name that other entities refer to this entity by.}}
{{entity-kvalue|Prop Data|None| If set, it will override this entity's health and damage taken from various weapons.}}
{{entity-kvalue|Prop Data|None| If set, it will override this entity's health and damage taken from various weapons.}}
{{entity-kvalue-end}}
{{entity-kvalue-end}}[[File:BitMage_pole_origin.PNG|thumb| It should look like this.]]
The Prop Data was no set because it applies health, and we don't want our stick to break. You may also want to set the spawnflag "Only Break on Trigger", so that it will not break unless told to.
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.
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.
[[Image:wiseOnewayGlass02.jpg|thumb|150px|It should look like this]]
{{Tip|Setting the spawnflag "Start Asleep" will make the physbox spawn suspended in the air just as you see it in the editor until acted upon by a force.}}
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. The origin is a little circle in the 2D views, and a blue orb in the 3D views (only visible when the physbox is elected).
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).
{{Tip|If can't see it, go to View->Show Helpers}}
{{Tip|If you can't see it, go to View->Show Helpers}}
 
 
 
<!-- Is there a way to make these images not look crappy when thumbnailed? -->
 
 
 


Next, make the [[env_entity_igniter]], this can be placed anywhere on the map.
Next, make the [[env_entity_igniter]], this can be placed anywhere on the map.
Line 20: Line 27:
{{entity-kvalue|Entity to ignite|[[Targetname#Keywords|!activator]]| Name of the entity to catch on fire.}}
{{entity-kvalue|Entity to ignite|[[Targetname#Keywords|!activator]]| Name of the entity to catch on fire.}}
{{entity-kvalue-end}}
{{entity-kvalue-end}}
<br>
The next entity we will need a is a [[trigger_multiple]]. Put it on end of the pole, like an extension (or a fire).
{{entity-kvalue-start|[[trigger_multiple]]}}
{{entity-kvalue|Name|trigger_igniter| The name that other entities refer to this entity by.}}
{{entity-kvalue|Parent|physbox_pole| The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.}}
{{entity-kvalue|Start Disabled|Yes|}}
{{entity-kvalue-end}}[[File:BitMage_trigger_igniter.PNG|thumb| It should look like this.]]


The first window is a typical One-way Glass.
Make sure you set the trigger's spawnflags correctly. The best choice is probably the "everything (except physics debris)" and the "physics debris" boxes. ; )
* On one face it’s textured with glass/glasswindow070a
* On the opposite face it’s textured with the same brick texture I used on the walls: brick/brickwall003a


The outputs of the trigger should be as followed:


To browse for these textures:
{| class=standard-table
* Click the '''Toggle Texture''' tool, or press '''Shift+A'''.
|+'''"trigger_igniter" Outputs'''
* Now click the '''Browse''' button.
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
* In the lower '''Filter''' area enter filter words like “''glass''”, “''wall''”, etc.
|-
* Double-click on the texture you want to use.
| {{IO11}} || OnStartTouch || igniter || Ignite || <none> || 0.00 || No
* Now with the '''Face Edit''' tool still open Right-click on any brush face to texture it. ('''Left-Click selects''')
|}


Starting from the left:
* Typical One-way Glass.
* Breakable Glass made with [[func_breakable_surf]], ''more on that soon''.
* Normal brush with '''nodraw''' on one face and a Glass texture on the opposite face.
* Layered textures created with [[func_illusionary]] entities.


[[Image:wiseOnewayGlass02.jpg|thumb|150px|right|Blends in with the wall]]
Setting the [[env_entity_igniter]]'s target to "[[Targetname#Keywords|!activator]]" will make it ignite whatever triggers the [[trigger_multiple]].


=== One-way ===
Now you may have noticed that the trigger starts disabled, and the stick is not fire yet, hmm...
The One-way Glass is created with a normal brush that has any ''opaque'' textured face opposite a Glass textured face. In this example I’ve used a brick texture and opposite that a glass texture.


=== Breakable ===
=== The Source Fire ===
The Breakable glass is created by turning a normal brush into [[func_breakable_surf]].
{{Tip|This step is for added realism, complexity, and the heck of it. You can skip it, by adding a [[env_fire|fire]] or a [[env_sprite|sprite]] to end of your stick, and starting the trigger enabled.}}
Do that by selecting the brush and pressing '''Ctrl+T''', choose [[func_breakable_surf]], and finally click '''Apply'''.
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:[[File:BitMage_fire_big.PNG|thumb| It should look like this.]]
{| class=standard-table
|+'''Trigger Outputs'''
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
| {{IO11}} || 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 properties for our Breakable window are:
==== The spread ====
* Prop Data: Glass.Window
The simplest thing to do is to have the pole enable the trigger when damaged, like this:
* Health: 80
{| class=standard-table
* Material Type: Glass
|+'''"physbox_pole" Outputs'''
* Fragility: 50
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
* Surface Type: Glass
|-
* This Breakable glass is 1.0 units thick.
| {{IO11}} || OnHealthChanged || trigger_igniter || Enable || <none> || 0.00 || No
:Don’t make them thinner than 0.5 units thick and don’t make the too thick.
|-
:Breakable glass gets textured on only one face, all other faces will be textured with '''nodraw''', the easiest way to do that is create them entirely with '''nodraw''' and then use the '''Face Edit''' tool to apply the breakable glass texture.
| {{IO11}} || 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]]
{{entity-kvalue-start|[[filter_damage_type]]}}
{{entity-kvalue|Name|filter_burn| The name that other entities refer to this entity by.}}
{{entity-kvalue|Filter mode|Allow entities that match criteria| If set to Allow, only entities who match the criteria will pass the filter.}}
{{entity-kvalue|Damage type|BURN| The damage type to filter by.}}
{{entity-kvalue-end}}
'''Make sure you set "physbox_pole"'s keyvalue "damage filter" to "filter_burn".'''
{{Note|A more elegant solution would be to create second trigger that only reacts to the stick, and whose sole purpose is enabling the stick's fire.}}


The texture to use on that face is: glass/glasswindowbreak070a (Don’t use glass/glasswindowbreak070'''b''')
=== Victims ===
[[File:BitMage_fire_simple.PNG|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.


[[Image:wiseOnewayGlass03.jpg|thumb|150px|right|The three windows]]


=== Layered texture ===
==== A note about NPC's ====
The last example is our layered texture, created with [[func_illusionary]] entities.
*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).
The first brush is only textured on the outside face; metal/metalfence004a
*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.
The next brush is textured on two faces;
*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).
# metal/metalgrate013a
# brick/brickwall003a


== Conclusion ==
== Conclusion ==
With the methods illustrated here you can create any type of One-way glass you need.
[[File:BitMage_fire_done.PNG|thumb]]
{{Note|The player, and objects, can pass right through the illusionary wall.}}
Don't forget to make a [[info_player_start|player start]], a [[Weapon_physcannon|Gravity Gun]], and other things like an [[item_suit|HEV Suit]] (or maybe a [[item_healthcharger|Healthcharger]]).
Keep in mind that while the '''nodraw''' texture doesn’t show it was invaluable in creating these effects.
 
{|border="0" align="left" style="background:transparent" cellpadding="0" cellspacing="0"
|+ Here are some shots of the effects in the game:
|-
|valign="top"|[[Image:wiseOnewayGlass04.jpg|right|thumb|295px]]
|
|valign="top"|[[Image:wiseOnewayGlass05.jpg|right|thumb|200px]]
|
|valign="top"|[[Image:wiseOnewayGlass06.jpg|right|thumb|195px]]
|}{{clr}}


Your finished map should look like the picture -->
== Wrap up ==
== Wrap up ==
There’s a lot more you can do, hopefully this article have stimulated your imagination.
Feel free to play around see what works, hopefully this article has stimulated your imagination.
* [http://type3studios.com/downloads/tutorials/SdkNutsTutorials/wiseOneWayGlass.zip The example used in this tutorial.]  
* [https://drive.google.com/file/d/1bKBqRtMUZOiLvLR2oFushE37C1oyyKM0/view?usp=sharing A flashier example map.]  


<h2> Credits </h2>
<h2> Credits </h2>
* The tutorial was created by [[User:Bitmage|Bit Mage]] 14:37, 21 Mar 2008 (EST)
* The tutorial was created by [[User:Bitmage|Bit Mage]] 14:37, 21 Mar 2008 (EST)
**Last update 12:05, 4 Jan 2009 (EST)


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

Latest revision as of 10:10, 8 January 2024

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).

Class: func_physbox
Keyvalues Comments
Name physbox_pole The name that other entities refer to this entity by.
Prop Data None If set, it will override this entity's health and damage taken from various weapons.
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.

Tip.pngTip:Setting the spawnflag "Start Asleep" will make the physbox spawn suspended in the air just as you see it in the editor until acted upon by a force.

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).

Tip.pngTip:If you can't see it, go to View->Show Helpers




Next, make the env_entity_igniter, this can be placed anywhere on the map.

Class: env_entity_igniter
Keyvalues Comments
Name igniter The name that other entities refer to this entity by.
Entity to ignite !activator Name of the entity to catch on fire.


The next entity we will need a is a trigger_multiple. Put it on end of the pole, like an extension (or a fire).

Class: trigger_multiple
Keyvalues Comments
Name trigger_igniter The name that other entities refer to this entity by.
Parent physbox_pole The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.
Start Disabled Yes
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
Entity-output-icon.png 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

Tip.pngTip:This step is for added realism, complexity, and the heck of it. You can skip it, by adding a fire or a sprite to end of your stick, and starting the trigger enabled.

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:

It should look like this.
Trigger Outputs
My Output Target Entity Target Input Parameter Delay Only Once
Entity-output-icon.png 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
Entity-output-icon.png OnHealthChanged trigger_igniter Enable <none> 0.00 No
Entity-output-icon.png 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

Class: filter_damage_type
Keyvalues Comments
Name filter_burn The name that other entities refer to this entity by.
Filter mode Allow entities that match criteria If set to Allow, only entities who match the criteria will pass the filter.
Damage type BURN The damage type to filter by.

Make sure you set "physbox_pole"'s keyvalue "damage filter" to "filter_burn".

Note.pngNote:A more elegant solution would be to create second trigger that only reacts to the stick, and whose sole purpose is enabling the stick's fire.

Victims

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

BitMage fire done.PNG

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.

Credits

  • The tutorial was created by Bit Mage 14:37, 21 Mar 2008 (EST)
    • Last update 12:05, 4 Jan 2009 (EST)