TF2/Creating Respawning Dispensers: Difference between revisions

From Valve Developer Community
< TF2
Jump to navigation Jump to search
No edit summary
m (Unicodifying, replaced: See Also → See also, [[Image: → [[File: (4))
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{lang|TF2/Creating Respawning Dispensers}}
== Create Dispensers ==
== Create Dispensers ==
[[Image:Dispensers1.jpg|thumb|obj_dispenser entities]]
[[File:Dispensers1.jpg|thumb|obj_dispenser entities]]
Start by placing a few [[obj_dispenser]] entities in your map. Name the first "spawned1", the second "spawned2", and so on.
Start by placing a few [[obj_dispenser]] entities in your map. Name the first "spawned1", the second "spawned2", and so on.


== Create point_template ==
== Create point_template ==
[[Image:Dispensers2.jpg|thumb|point_template entities]]
[[File: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 will have 'Template1' value "spawned1". In the 'Flags' tab, tick "Don't remove template entities" to make sure the dispensers spawn on start-up.
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". In the 'Flags' tab, tick "Don't remove template entities" to make sure the dispensers spawn on start-up.


== Create env_entity_maker ==
== Create env_entity_maker ==
[[Image:Dispensers3.jpg|thumb|env_entity_maker entities]]
[[File:Dispensers3.jpg|thumb|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".
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's.}}
{{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_maker's.}}


== Dispenser Outputs ==
== Dispenser Outputs ==
[[Image:Dispensers4.jpg|thumb|Dispenser outputs]]
[[File:Dispensers4.jpg|thumb|Dispenser outputs]]
On the output tab for each dispenser, add these values with the corresponding numbers:
On the output tab for each dispenser, add these values with the corresponding numbers:
      
      
Line 22: Line 23:
:'''After a delay in seconds of:''' <code>10</code>
:'''After a delay in seconds of:''' <code>10</code>


OnDestroyed is not one of the selectable outputs, so Hammer will say this is an invalid output. Ignore that, it will work in game. Adjust the delay to the number of seconds you want the dispenser to take to respawn.
OnDestroyed is not one of the selectable outputs, so Hammer will say this is invalid. Ignore that, it will work in game. Adjust the delay to the number of seconds you want the dispenser to take to respawn.


Now, when your map loads, there should be a set of dispensers, which, when destroyed, make another one spawn in its place.
Now, when your map loads, there should be a set of dispensers, which, when destroyed, make another one spawn in its place.


== See Also ==
== See also ==
*[[TF2/Creating Respawning Sentries|Creating Respawning Sentries]]
*[[TF2/Creating Respawning Sentries|Creating Respawning Sentries]]


[[Category:Tutorials]]  
[[Category:Tutorials]]  
[[Category:Level Design Tutorials]]
[[Category:Level Design]]
[[Category:Team Fortress 2]]
[[Category:Team Fortress 2]]

Latest revision as of 05:49, 7 January 2024

English (en)한국어 (ko)Русский (ru)Translate (Translate)

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". In the 'Flags' tab, tick "Don't remove template entities" to make sure the dispensers spawn on start-up.

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.pngNote: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_maker's.

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

OnDestroyed is not one of the selectable outputs, so Hammer will say this is invalid. Ignore that, it will work in game. Adjust the delay to the number of seconds you want the dispenser to take to respawn.

Now, when your map loads, there should be a set of dispensers, which, when destroyed, make another one spawn in its place.

See also