General Half-Life 2/Entities
description
Create a flying craft that will fly and shoot laser beams
keywords
laser, flight, craft, func_tracktrain, path_track, prop_dynamic.
I originally wrote this tutorial for Project Valkyrie however it can easily be used in any mod - simply replace the Fighter with the appropriate model of your choice.
Entities you will learn to use:
func_tracktrain
path_track
prop_dynamic
env_explosion
env_beam
This tutorial assumes you already know how to create a basic map. It also assumes you have basic knowledge of working with entities and props.
1. The first step is to create a small box where you want your fighter to start. This box should be tied to func_tracktrain.

2. Use whatever naming sequence you like, but I tend to try and keep things simple enough that I can find the entity later without really thinking about it. These are the things you should change to get the properties set
Name: fighter_train
First Stop Target: fighter_train_path_1
Max Speed: 1750
Initial Speed: 1750
Under flags – I usually check passable and nothing else. This will allow bullets to pass through and appear to hit the prop parented to the train. The fighter change its orientation as needed as long as you leave everything else unchecked.

3. Insert a prop_dynamic above the func_tracktrain. Under the property field "Parent" select "fighter_train"

Under the world model field browse and select fighter_pheonix.mdl from the model list. You do not need to change any other properties. Select apply and you have your fighter done. This is all you need to do for the fighter and train.

4. Select path_track from the prop field and place one in front of the train, where you want your fighter to begin its run. Under the properties field change the "name" to fighter_train_path_1 and the "new train speed" to 1750


5. Hold down the shift key, click on the path_track then drag your mouse out to the left. This will automatically create your second path_track and will automatically name it fighter_train_path_2

That’s it for making a plane fly around in your map.
Understanding what is happening: When you run the map the map brush you created called func_tracktrain is what actually moves. Anything you have parented to this brush, i.e. the prop_dynamic, will move with it. The props themselves do nothing (in theory).
If you run your map now the plane will just spawn launch across the two paths and then vanish. Again this tutorial is basic. If you want it to keep flying you can take it the next level by doing two things…..
5a. Teleport it back to fighter_train_path_1, or create several path_tracks and make it fly in a circle around the map.
5b. You can add a logic_auto to "stop" the train when the map starts, then start it when you are ready for it.
Remember if you want to do anything to the train, do it to the brush entity you created called func_tracktrain.
Now more advance:
6. Extend your path_traintrack so that you have more than one. This is important because the path_traintrack will be what we use to trigger the bombing animations.

7. Wherever you want your explosion to take place when the fighter fires his laser you need to create the entity env_explosion.

8. Name the explosion "explosion_1" and under the flags set "repeatable" and "damage above ground" – (you do not have to set damage above ground if you want players under the explosion to be hurt to)


There are several fields here you need to understand. The magnitude is the distance where a player will be hurt. I generally use 200 in this field but you need to find what works for you in your map. Fireball Sprite is the field where you can select how the explosion will look. Browse the sprites and select the one you feel works best for your environment.
9. Go back to your fighter. We are going to create a nodraw brush and tie it to func_brush. This brush should be placed directly in front of the guns on the fighter. Name the brush "fighter_guns" and parent this brush to "fighter_train"



10. Place an env_beam in your map wherever you want. Where you place it is not important, I usually place it by the env_explosion so I can keep track where everything is.

11. Under the properties set the following information:
Name: beam_1
Start Entity: fighter_guns
Ending Entity: explosion_1
Width of Beam: 10
Under flags select "toggle"

The sprite name is where you set what you want your beam to look like. Browse the selection and take a look at the options. You can also change the color of the beam by playing around with the color field.
We set the width to 10 because 10 will cover both guns on the fighter model.
If you set everything correctly you should see a line connecting the env_explosion and the func_brush "fighter_guns"

12. Go to the path_track where you want to fighter to start shooting. In our tutorial it is the second one.

Set the following output properties

OnPass -> beam_1 -> TurnOn
OnPass -> explosion_1 -> Explode -> Delay of 0.5
I have a delay of .05 so that the player sees the laser beam about half a second before the explosion. This gives to illusion of realism.
This is as far as I intend to go with this tutorial. This was just enough to get you started and is not intended to create your map for you. Here are things I recommend you try.
1. Adding an explosion sound
2. Adding more than 1 laserbeam and explosion
3. Start the fighter run via a button (or) start it via a timer
4. Add several path_tracks at different heights. This will make it look like your fighter is "swooping" towards its target.
DeathToll_David


