Difference between revisions of "TF2/Creating Respawning Dispensers"

From Valve Developer Community
< TF2
Jump to: navigation, search
m (Rewording, reworking. (When I first read this, the lack of apostrophes surrounding things like "Template1" and "Point_template to Spawn" confused me))
Line 5: Line 5:
 
== Create point_template ==
 
== Create point_template ==
 
[[Image:Dispensers2.jpg|thumb|point_template entities]]
 
[[Image:Dispensers2.jpg|thumb|point_template entities]]
Add an equal number of [[point_template]] entities as you have dispensers. Set Name to "template1", "template2", etc. Set Template1 to the matching dispenser, so point_template "template1" will have Template1 value "spawned1".
+
Add an equal number of [[point_template]] entities as you have dispensers. Set 'Name' to "template1", "template2", etc. Set 'Template1' to the matching dispenser, so point_template will have 'Template1' value "spawned1".
  
 
== Create env_entity_maker ==
 
== Create env_entity_maker ==
 
[[Image:Dispensers3.jpg|thumb|env_entity_maker entities]]
 
[[Image:Dispensers3.jpg|thumb|env_entity_maker entities]]
Create an equal number of [[env_entity_maker]] entities as you have dispensers. Set Name to "spawner1", "spawner2", etc. Set Point_template To Spawn to the matching point_template, so env_entity_maker "spawner1" will have Point_template To Spawn value "template1".
+
Create an equal number of [[env_entity_maker]] entities, one entity per dispenser. Set 'Name' to "spawner1", "spawner2", etc. Set 'Point_template To Spawn' to the matching point_template, so env_entity_maker "spawner1" will have 'Point_template To Spawn' value "template1".
 +
 
 +
'''NOTE:''' If you don't want a generic "Player" <death symbol> "Dispenser" message every time a player destroys a dispenser, don't add any env_entity.
  
 
== Dispenser Outputs ==
 
== Dispenser Outputs ==
Line 20: Line 22:
 
:'''After a delay in seconds of:''' <code>10</code>
 
:'''After a delay in seconds of:''' <code>10</code>
  
Hammer will say this is an invalid output, ignore that. Adjust the delay to the number of seconds you want the dispensers to take to respawn.
+
Hammer will say this is an invalid output, ignore that. Adjust the delay to the number of seconds you want the dispenser to take to respawn.
  
 
== Set Initial Dispensers ==
 
== Set Initial Dispensers ==
 
[[Image:Dispensers5.jpg|thumb|Set of unnamed dispensers]]
 
[[Image:Dispensers5.jpg|thumb|Set of unnamed dispensers]]
If you test your map now, you will find there are no dispensers on your map! So, we need to add some. Select all your dispensers, and make a copy set. For all these copy dispensers, and delete the Name value. Move the dispensers on top of your original ones. Now, when your map loads, there should be a set of dispensers, which, when destroyed, make another one spawn in its place.
+
If you test your map now, you will find there are no dispensers on your map! So, we need to add some. Select all your dispensers, and make a copy set. Once you've copied them, go into the copied dispensers' properties and delete the Name value. Move the copied dispensers on top of your original ones. Now, when your map loads, there should be a set of dispensers, which, when destroyed, make another one spawn in its place.
  
 
[[Category:Tutorials]]  
 
[[Category:Tutorials]]  
 
[[Category:Level Design Tutorials]]
 
[[Category:Level Design Tutorials]]
 
[[Category:Team Fortress 2]]
 
[[Category:Team Fortress 2]]

Revision as of 15:31, 20 December 2009

Create Dispensers

obj_dispenser entities

Start by placing a few obj_dispenser entities in your map. Name the first "spawned1", the second "spawned2", and so on.

Create point_template

point_template entities

Add an equal number of point_template entities as you have dispensers. Set 'Name' to "template1", "template2", etc. Set 'Template1' to the matching dispenser, so point_template will have 'Template1' value "spawned1".

Create env_entity_maker

env_entity_maker entities

Create an equal number of env_entity_maker entities, one entity per dispenser. Set 'Name' to "spawner1", "spawner2", etc. Set 'Point_template To Spawn' to the matching point_template, so env_entity_maker "spawner1" will have 'Point_template To Spawn' value "template1".

NOTE: If you don't want a generic "Player" <death symbol> "Dispenser" message every time a player destroys a dispenser, don't add any env_entity.

Dispenser Outputs

Dispenser outputs

On the output tab for each dispenser, add these values with the corresponding numbers:

My output named: OnDestroyed
Target entities named: template1
Via this input: ForceSpawn
After a delay in seconds of: 10

Hammer will say this is an invalid output, ignore that. Adjust the delay to the number of seconds you want the dispenser to take to respawn.

Set Initial Dispensers

Set of unnamed dispensers

If you test your map now, you will find there are no dispensers on your map! So, we need to add some. Select all your dispensers, and make a copy set. Once you've copied them, go into the copied dispensers' properties and delete the Name value. Move the copied dispensers on top of your original ones. Now, when your map loads, there should be a set of dispensers, which, when destroyed, make another one spawn in its place.