[TUTORIAL] Making Stationary and Moving, Breakable, Respawning Targets

Semnae

L1: Registered
Mar 10, 2008
21
4
This tutorial will give you step by step instructions on how to create both stationary and moving breakable, respawning targets in Hammer.

1. Open your map. This tutorial assumes that you've already created a map in which you want to insert moving targets. If that is not the case, then create a map before continuing on to step 2. For testing purposes, you will need to have the basic minimums of running a map in place.

2. Click on the brush tool, and create a brush. This brush will end up being your target. You can, size, shape, and texture this brush any way you want. It really doesn't matter what it looks like, so long as it's still a brush afterwards. Feel free to be as creative as you want.



3. Select your brush and press "Ctrl+t". In the "Class" tab select "func_breakable". Under "Name" put a name for the brush. It doesn't matter what you name it, so long as nothing else is named the same thing. There are several other options here, including making the target explode when you shoot it, or having something else spawn in its place when broken. Take some time to play around with these settings. Once you're done, click "Apply" and close the window.



4. Select the entity tool. On the right hand side of the screen make sure that under the "Catagories" tab "Entities" is selected. Under the "Objects" tab, select "point_template". Hit the "Z" key and use the camera to place the entity anywhere you want. It doesn't matter where it's placed since it won't be seen in the game anyways, but if you are making a lot of targets, you will probably want to place it somewhere near the appropriate target to avoid confusion. In Hammer, the entity will show as a gray cube.



5. Select the entity, right click on it in any view other than the camera, and select properties. Name Under "Name", put a name for the entity. Again, it doesn't matter what you name it. Under "Template 1", put the name you chose for your target. Once done, click "Apply" and close the window.



6. Select the entity tool again. This time, under the "Objects" tab select "logic_auto". Place this entity in the same manner as the last. It doesn't matter where you put it. You can use the same "logic_auto" entity for every target you make, so you will need only one.



7. Select the "logic_auto" entity and right click on it in any view other than the camera. Select properties, then select "Outputs" at the top of the newly opened window. Click "Add". Under "My output named" select "OnMapSpawn", under "Target entities named" put the name of the "point_template" entity you created earlier, and under "Via this input" put "Force Spawn". You can also choose a number in seconds for the object to appear in the game after the game has started on this window. When finished, click "Apply" and close the window.



8. Select your target and right click on it in any view other than the camera. Select properties, then select "Outputs" at the top of the newly opened window. Click "Add". Under "My output named" select "OnBreak", under "Target entities named" put the name of the "point_template" entity you created earlier, and under "Via this input" put "Force Spawn". Under "After a delay in seconds of" put the number of seconds you want the target to wait before respawning. Once finished, click "Apply" and close the window.



9. You have just finished creating a stationary, breakable, respawning target! Hit the "F9" key and test to see if your target works like it's supposed to.

Now that you have a respawning target, it's time to discuss how to make it move around the map.

10. Start by creating a brush. This brush will dictate where your target moves. This brush won't be seen in the game, so it doesn't matter where you put it or what it looks like. To avoid confusion later, I suggest making it vertically thin and placing it just below your target, as if it were a platform intended to carry your target around. Select your platform and click the Texture tool. Click Browse. Under "Filter" type "tools/toolsnodraw" and press the "Enter" key. Click "Apply" and close the window.



11. Select the Entity tool and under "Objects" select "path_track". These entities will determine where the platform carries your target to. Place the first one underneath your platform in the very center. This will be the starting point. We will play connect-the-dots with these entities later. For now, plot a route by placing several of these entities wherever you will want your target to change directions. They will also appear as gray cubes, so try no to confuse them with your "point_template" entities.



12. Now it's time to connect-the-dots. Open the properties of the entity at your starting location (you should know how to do it by now). Name the entity anything you want, and under "Next Stop Target", type the name of what you intend to name the second entity in the route.



13. Select the "Outputs" tab and click "Add". Under "My output named" select "OnPass", under "Target entities named" put the name of your target, under "Via this input" put "SetParent", and under "With a parameter override of" type the name of what you intend to name your platform. Click "Apply" and close the window.



14. Select the second entity in the route and open its properties. Name the entity what you called it in step 12, and under "Next Stop Target", type the name of what you intend to name the third entity in the route. Click "Apply" and close the window. Repeat this step in a similar fashion until all the entities are connected. When you reach the last entity in the route, put under "Next Stop Target" the name of the first entity in the route. At each of these entities, you will have the option to change several settings, such as the targets movement speed.



15. Select your platform and press "Ctrl-t". Under "Class" select "func_tanktrain". Name the platform what you named it in step 13. Under "First Stop Target" put the name of the entity at the start of the route. There are several other settings you might want to play with while your here. Play around with the settings under both the "Class Info" tab and the "Flags" tab until you get what you want. When your done, click "Apply" and close the window.



16. Select your "logic_auto" entity and open its properties. Select the "Outputs" tab and click "Add". Under "My output named" select "OnMapSpawn", under "Target entities named" put the name of your platform, and under "Via this input" put "StartForward". Click "Add" again. Under "My output named" select "OnMapSpawn", under "Target entities named" put the name of your target, under "Via this input" put "SetParent", under "With a parameter override of" type the name of your platform, and under "After a delay in seconds of" put "0.01". Click "Apply" and close the window.



17. You have just finished creating a moving, breakable, respawning target! All that's left to do is test it, so hit "F9" and make sure it works correctly.
 
Last edited:

Brandished

L5: Dapper Member
Jan 19, 2008
234
311
Thanks for this tutorial, I never knew hot to set up a func_tanktrain. I found this tutorial very helpful, but EXTREMELY confusing at the same time. I would have had less trouble understanding it if you would have named and set up the entities in the same step in which you created them, rather then going back to them later on in the tutorial (for example, the brush you created in step 10, but do not set up until step 15).

You seem use the long way for something that can be done much simpler, I don't understand the reasoning behind this. In this guide you use the output tab on a path_track (#13) and logic_auto (16) to parent a func_breakable to a func_tanktrain twice. Maybe there's something I don't know about (I'm still learning how to use hammer), but when I want a breakable or button to move, I open their properties and set the parent in the class info to the entity that will be moving.

Also, while I was experimenting using this guide, I found a much easier way then the one mentioned here for making a path for a func_tanktrain. Simply create your first path_track, set up it's properties and name it something like "stop_1" (the underscore is important here) and then clone it using the shift drag to were you want the second stop to be. Hammer will automatically rename the cloned "stop_1" to "stop_2" and set the "next target stop" in stop_1's class info to the newly created "stop_2". You then clone drag again on "stop_2" and hammer will repeat the process and name it "stop_3".

I'd also recommend splitting this into 2 separate tutorials, 1 for creating func_breakables, and another for making moving platforms.
 
Last edited:

l3eeron

L8: Fancy Shmancy Member
Jan 4, 2008
593
88
Some good points in the tut. A few holes here n there, but anyone with some motivation could get it from this....
I like to see pictures cuz Im a block head lol

This is the same method for making mine fields...

and invisible train with env_explosions tied to it. I also used this to make a moving blowable tank in dods. Parent a prop to the train along with an invisible func_breakable around the prop :D
 
Last edited:

Semnae

L1: Registered
Mar 10, 2008
21
4
I've finally added the pictures. Sorry it took so long. ImageShack can really be a pain in the neck some times.