Respawning Items

Category:Tutorials
This is a tutorial for creating respawning items that can be either placed at a position, or dropped from the sky.
== Step by step ==
First, create your room however you want it, or open up an existing map.
=== Entities ===
The following entities will be used:
* - makes copies of the item to spawn.
* - spawns the item in the game.
* - used to trigger the .
* - used to trigger the and select a random spawner.
== Item templates ==
Now, place into the level the item you want to spawn (e.g., ) and name it .
Place near a , name it and set the Template 1 property to .
Repeat this process for every other item you want to be able to spawn, remembering to use different names (e.g., becomes and becomes ).
== Add your entity makers ==
Place around your map a number of entities. The first one should be named and each should be named in a consecutive manner (i.e., , , and so forth).
Each of these should have their Point_template To Spawn property set to the template you want to spawn (e.g., ).
== Add your logic_case ==
The entity will contain a list of all the entities, and will be used to make the entities spawn.
Begin by naming your and giving a value to each Case xx property. You can simply put a number in each, counting upwards. Only put as many values in as you have entities though.
On the Output tab, add an output for each you have. Set each to a different OnCaseXX output, and put the name of the you want to spawn in the target field (e.g., ) and set the input to be ForceSpawn.
== Add your timer ==
The will be used to make each item spawn. It works by using the PickRandomShuffle input of the .
Add your and set Start Disabled to . Under Refire Interval set the delay (in seconds) of how often you would like your items to spawn. For testing purposes, I used a value of 2.
Add the following output to your :
:My output named: 
:Target entities named: 
:Via this input: 
== Creating props that only respawn after they have been destroyed (only works in Half-Life 2: Deathmatch) ==
To create a prop which will respawn once it has been destroyed, simply follow these quick and easy steps. Please note that in this example we will be using the explosive oildrum prop as it's the simplest prop to destroy. Note that this tutorial is written for the newest of hammer users and may seem a little drawn out. In an effort to expedite the completion of this tutorial for users more experience with hammer I have made the numbers of the most key steps bold.
1) Select the Entity tool
2) In the box on the right side of your screen, that has the words "to world" and "to entity" above it you will see some text describing the current type of entity selected. In that box type: .
3) Select what the prop will look like by opening it's properties (select it and press +), then clicking on world model and then clicking on browse.
4) In the bottom of the new window that opens up, there is box labeled "filter" type in oildrum. Select the oildrum001_explosive prop. Then click on "apply"
5) If you have closed the prop's property window, reopen it by pressing +. In this window you will see a column on the left. Scroll to the bottom, where you will see "respawn time". Click on that and on the right side of the window you will see a value of 60. Set it to whatever time period you desire or leave it as is. Once again, click "apply".
6) You're done. That's it. Easy right?
== Creating weapons that only respawn after they have been picked up/used (only tested in Garry's Mod) ==
1) Create the weapon that you want to use. Place it where you want it to be placed in the level. Give it the name "spawnedgun"
2) Create an env_entity_maker and put it in the same place as your gun. Give it the name "spawngun"
3) Create a point_template near your other entities and give it the name "tempgun". Go back to your env_entity_maker and put "tempgun" under "Point_template To Spawn"
4) Go to your point_template and under Template 1 put "spawnedgun"
5) Go to your gun and set an output to "OnPlayerPickup" with the Target Entity to "spawngun" and the input of "ForceSpawn". You might want to add a delay.
== Test your map ==
Compile and test your map.