Team Fortress 2/Creating a Payload Map: Difference between revisions
mNo edit summary |
Rockn-Roll (talk | contribs) m (→Setting up the round: game_round_win entity does not have a parameter.) |
||
Line 66: | Line 66: | ||
! || My Output || Target Entity || Target Input || Parameter || Delay || Only Once | ! || My Output || Target Entity || Target Input || Parameter || Delay || Only Once | ||
|- | |- | ||
| [[Image:Io11.png]] || OnFinished || Round_Win || RoundWin || | | [[Image:Io11.png]] || OnFinished || Round_Win || RoundWin || || 0.00 || No | ||
|} | |} | ||
Revision as of 08:02, 19 February 2011
This gametype is included in A Boojum Snark's Team Fortress 2 Gametype Library
The complete entity setup for this gametype is included in "A Boojum Snark's Team Fortress 2 Gametype Library," a downloadable VMF that includes all official Team Fortress 2 gametypes. The entities can easily be transferred from the VMF to your own custom map without the hassle of having to build it yourself or debugging it.
"A Boojum Snark's Team Fortress 2 Gametype Library" can be downloaded here: TF2Maps.net
This tutorial covers the creation of a Payload map, such as Gold Rush and Badwater Basin.
This tutorial presumes that you are able to at least create round spawns and the basic layout of the map, presuming that the blue team attacks and the red team defends you will need to have a basic layout for the payload to travel along and know where the capture points will need to go. In this tutorial you will create the train for the payload and all the necessary entities to work the map with 2 capture points on the first round.
Setting up the round
For this tutorial there is only 1 round but has been made with other rounds in mind.
- Create a tf_gamerules and name it GameRules.
- Create a logic_auto entity and select the outputs tab.
- Place a team_control_point_master and name it CP_master, and adjust the properties (not all are displayed).
Property Name Description Value Name Name of the entity CP_Master Start Disabled Self-explanatory No Cap Layout Self-explanatory Restrict team from winning Self-explanatory Red Switch teams on map win? Self-explanatory Yes Scoring Style Self-explanatory Add team score for each captured point Play all rounds before changelevel Self-explanatory Only changelevel after all mini-rounds have been played to completion Partial cap rate Rate at which to give partial cap points for area captures 0.1
- Create a team_control_point_round and name it Round_A, presuming that this is the only 1 round and there are only 2 capture points.
Property Name Description Value Name Name of the entity Round_A Start Disabled Self-explanatory No Print Name Self-explanatory Priority Higher rounds are played first 0 Control points in this round Self-explanatory CP_A_1 CP_A_2 Restrict team from winning Self-explanatory Red
If you had 2 round then the priority of Round_A would be 1 and Round_B would be 0.
- Create a game_round_win entity and name it Round_Win Set Team to Red. Then go to your team_round_timer entity and set a new output as follows:
This sets the winner of the round to Red when time runs out.
This tutorial presumes that you all ready know how to use a team_round_timer entity and will not be explained here.
Building the payload
This section will help you build the train section and the entities needed to get it to function.
- Create a brush the same size of the payload model, but using the
tools/toolsclip
texture and make it a func_tracktrain. The train needs to be pointing right on the top view for the engine to automatically orientate the train correctly in game. Name this brush Bomb_Train. Set the origin of the func_tracktrain to be above the train. This will ensure that the spectator camera view of the cart is above the cart, and not in the cart. - Create a prop_dynamic and set the model to
models/props_trainyard/bomb_cart.mdl
, name this Bomb_Model and set the parent to Bomb_Train. Resize the Bomb_Train brush so that it matches the size of the model. This ensures that the players won't get stuck in the model. - Using the
tools/toolstrigger
texture create a box around the train to be used as the capture zone. Make this a trigger_capture_area and name it Bomb_CapArea and set the parent to Bomb_Train. This is the brush which will actually be used to trigger the payload to move, so needs to extend out from the model as far as you wish players to be when moving the payload. - Create another box using the
tools/toolstrigger
again around the train, the same size as the Bomb_CapArea brush, which will be the regen and health zone. Make this into a dispenser_touch_trigger naming it Bomb_Dispense and setting the parent again to Bomb_Train. - Create a mapobj_cart_dispenser entity and place it where you want the healing beam to come from, Name this Bomb_DispenseBeam and set the parent to Bomb_Train (set the team to Blue and the custom touch trigger to Bomb_Dispense and that is all that is needed for the healing zone)
- Place a math_remap entity above the train and name it Bomb_Remap.
- Finally place a logic_case entity above the train and name it Bomb_LogicCase.
Activating the payload
You should now have what looks like a bomb surrounded by 3 cubes and a few entities, in this section you will need to set the values, the inputs and the outputs required to get the train working.
Cap Zone
First set up the capture zone.
- Click on and find the properties of the Bomb_CapArea, we will be using CP_A_1 as the first capture point
Property Name Description Value Name Name of the entity Bomb_CapArea Start Disabled Self-explanatory No Parent Self-explanatory Bomb_Train Control Point The cap assigned to this trigger CP_A_1 Can RED cap? Self-explanatory No Can BLUE cap? Self-explanatory Yes Number of RED players to cap Self-explanatory 1 Number of BLUE players to cap Self-explanatory 1 RED spawn adjust How much to change the spawn time on cap 0 Blue spawn adjust How much to change the spawn time on cap 0 Time to cap Self-explanatory 99999
- Now select the outputs tab and create 2 new outputs, Watcher_A will be created later and is used to display the trains progress on the HUD.
Remap
Now we can set up the Bomb_Remap entity, this is used to limit the number of player caps from 0 to 3 and the train will only have 3 speed (It is possible to create a greater number of train speeds).
- Click on the Bomb_Remap entity and find the properties.
Property Name Description Value Name Name of the entity Bomb_Remap Start Disabled Self-explanatory No Minimum Valid Input Value Self-explanatory 0 Maximum Valid Input Value Self-explanatory 3 Output Value When Input Is Min Self-explanatory 0 Output Value When Input Is Max Self-explanatory 3
- Now select the outputs tab and create a new output, this will send the amended value to the Bomb_LogicCase.
- Under the Flags tab, uncheck "Ignore Out of Range Input Values".
Logic Case
We are now able to setup the Bomb_LogicCase to set the speed of the train on its path.
- Again click on and find the properties of the Bomb_LogicCase.
Property Name Description Value Name Name of the entity Bomb_LogicCase Case 01 Self-explanatory 0 Case 02 Self-explanatory 1 Case 03 Self-explanatory 2 Case 04 Self-explanatory 3
The rest can be ignored.
- Now select the outputs tab and create a new output, this will send the amended value to the Bomb_LogicCase.
Train
We can work on the Bomb_Train, this tutorial presumes that you want the mine cart sounds from Goldrush.
- Begin changing properties of Bomb_Train, presuming that Track_A_01 is the first point of the track, not all values will be shown here.
Property Name Description Value Name Name of the entity Bomb_Train First Stop Target Self-explanatory Track_A_01 Max Speed Self-explanatory 90 Change Velocity How the acceleration is handled Linear blend Distance Between the Wheels Self-explanatory 20 Damage on Crush Self-explanatory 99999 Move Sound Self-explanatory Cart.Roll Start Sound Self-explanatory Cart.RollStart Stop Sound Self-explanatory Cart.RollStop Manual Train Speed Self-explanatory On Manual Accel Speed Self-explanatory 70 Manual Decel Speed Self-explanatory 150
You will also have to set the Height above track property to match the height of the origin of the func_tracktrain from the bottom of the func_tracktrain. This will make sure that your train sits on the ground nicely, but also that the spectator camera still works. You will most likely need to modify this value slightly, so that if you have any track props, or rims on the wheels of the cart, that they match up neatly when compiled.
The Bomb_Train doesn't have any outputs but does require a few flags to be enabled.
- Click on the Flags tab and enable No User Control and Is unblockable by player.
Building the Track
You may want to lay track models first until you know what each model is.
You now have a working train but you will now need to build a line for it to run on.
- Create a path_track entity and place it where you want to start the track, Name this Track_A_01.
- Create another path_track and place it where you next want the line to follow and name this Track_A_02.
- Click back on Track_A_01 and set
Next Stop Target
to Track_A_02. - Keep creating new path_track and continue naming and linking them in the line you want the train to follow.

To mimic the track models seen in tf2, use several prop_static entities to generate the track segments, and place these on the path underneath the path_track entities. The models required are those named props_mining/track*.mdl
with the asterisk in place of the type of track segment required. For the model around the midpoint capture points, use a prop_dynamic entity, with the world model as props_trainyard/track_midcap.mdl
. Name this CP_A_1_Model.
Adding a Capture Point
There can be 1 to 3 capture points per round making 2 different types, mid point captures and final captures.
Warning: If you have not created capture points before then please read Creating a Capture Point to go over the details of setting up a team_control_point correctly!
Mid point cap
First create a logic_relay next to the cap and name it CP_A_1_Relay, this is used to trigger a number of actions and can be used to open mid point gates or close other gates, use this to add time to the round timer and to change the skin of any models you have at the mid point.
- Select CP_A_1_Relay and select the outputs tab.
You will need to find the path_track in the middle of the cap, in this example it's Track_A_24.
- Select the middle path_track and go to the outputs tab.
This tutorial presumes that you know how to create a team_control_point, name this CP_A_1 and set the owner to Red.
- Don't forget on the properties to set warning type to No Announcements, the announcements are handled by the team_train_watcher.
- Open the outputs tab and add the following.
This disables the path behind the train and prevents it rolling back, it also sets up the next capture point.


End point cap
The end point is set up in exactly the same way as a mid point, the only difference is what you want to do with it.
- The main difference is you will need to disable the Bomb_CapArea and anything else appropriate to your map, you can use the logic_relay and the end point to disable them.
If you intend to have another round you can use the trigger to keep the train moving along the path, you will then need to stop it when it reaches it next starting point, you will also need to disable the team_train_watcher presumed to be Watcher_A in this example and to enable the next team_train_watcher when needed. If you need to enable anything at the right time give it a delay of 15 seconds on the trigger_relay's outputs.
Train Watcher
The final stage is to add in the train display, which is also used to tell when the train should start rolling back.
- Create a team_train_watcher and name this Watcher_A.
- Presuming that there are 2 caps and the path_track are changed where needed set the properties to.
Property Name Description Value Name Name of the entity Watcher_A Start Disabled Self-explanatory No Train to watch Self-explanatory Bomb_Train Node that the path starts at Self-explanatory Track_A_01 Node that the path ends at Self-explanatory Track_A_43 Linked PathTrack 1 Self-explanatory Track_A_24 Linked CP 1 Self-explanatory CP_A_1 Linked PathTrack 2 Self-explanatory Track_A_43 Linked CP 2 Self-explanatory CP_A_2 Linked PathTrack 3 Self-explanatory Linked CP 3 Self-explanatory Min Speed for Speed level 1 Self-explanatory 1 Min Speed for Speed level 2 Self-explanatory 60 Min Speed for Speed level 3 Self-explanatory 80
- Now select the outputs tab.
This will cause the train to start moving backwards at 10% of the maximum speed.
Additional Effects
On Gold Rush and Badwater, additional effects are added to the cart, such as a flashing light and sparks while the train is moving backwards along the track. Both are simple entities that start and stop depending on certain conditions.
Flashing Light
- Create a info_particle_system and align it with the light on top of the bomb cart, and name it Bomb_Light
Property Name Description Value Name Name of the entity Bomb_Light Parent Self-explanatory Bomb_Train Particle System Name Self-explanatory cart_flashinglight Start Active? Self-explanatory No
- Select your cart's logic_case entity's outputs tab and add the following
Additionally, you may want to disable the light at the end of the level.
Sparks
- Create a env_spark entity at the bottom center of both rear wheels and name it Bomb_Sparks
Property Name Description Value Name Name of the entity Bomb_Sparks Parent Self-explanatory Bomb_Train Spark Trail Length Self-explanatory Medium
- Open your cart's logic_case entity's outputs tab, and add the following:
- Open your team_train_watcher entity and select the outputs tab, and add:
- Finally, add an output for each control point's center path_track and the starting one, such as Track_A_01 and Track_A_24 in this tutorial.
Capture Bell
On Badwater and Gold Rush, a bell "ding" is used to announce point captures by BLU. Making this sound is simple.
- Create a new ambient_generic and name it cap_sound
Property Name Description Value Name Name of the entity cap_sound Sound Name Self-explanatory Hud.EndRoundScored

- Next, select your first cap point's logic_relay, and select the Outputs tab


Final Explode
Now we are going to create the final explosion without terrain destruction. (First see Badwater Basin's version)
Upgrade Cart
- Replace the (prop_dynamic named Bomb_Model) with prop_physics_override.
Now the cart has become physical.
- Now create a phys_constraint with the parameters:
Property Name Value Name Bomb_Const Entity 1 Bomb_Train Entity 2 Bomb_Model
It will attach the cart's model to the Bomb_Train
Explode Pit
Pit Model
- First create a prop_static with World Model models/hybridphysx/badwater_destruction_before.mdl and make another with World Model models/props_farm/sewer_cap001a.mdl.
Doors to Pit
- Create two brush-entities func_door, with the material glass/glasswindow002a on the upper face.
Parameters for two func_door:
Property Name Value Name cap_door Speed 700 Move Direction (Pitch Yaw Roll) 0 270 0
- In "Flags" check "Touch Opens" to false and check Toogle to true.
- On one of two doors create the outputs:
It will destroy the door when it's fully open.
- In the pit create a brush-entity trigger_hurt with the parameters Damage - 1000, Damage Cap - 1000.
- Create a brush-entity func_nobuild on the upper doors with parameter Team - Any.
Barrels in Pit
- Create 10-15 entities prop_dynamic_override with WorldModel models/props_badlands/barrel03.mdl and Name - End_Barrels
Explode

Place final path_track near pit. Now we create more Outputs and effects.
- Create near pit two ambient_generic.
Parameters of first:
Property Name Value Name pre_kaboom SoundName Cart.Trigger
Second:
Property Name Value Name kaboom SoundName Cart.Explode
- Now create under doors one info_particle_system with parameters:
Property Name Value Name pit_effect Particle System Name cinefx_goldrush Pitch Yaw Roll (Y Z X) -90 0 0
- Now create trigger_multiple with name KaBoomZone
Outputs:
Outputs for final path_track
It is: 0.0:
- open doors to pit
- destroy Bomb_Train'
0.01 - detach and fall cart's model 1.0 - "beep" 2.0:
- play ka-boom sound
- play ka-boom effect
- destroy barrels
- destroy cart's model
- capture final CP
- destroy Capture Zone
- activate killing zone
2.1 - deactivate killing zone
Conclusion
You should now have at least a fully working 1 stage round of payload style game play, if you have taken in this tutorial fully you should be able to change the number of rounds and capture point to anything you need. If you have any questions or complaints, post them on the talk page.