TF2/Creating a Payload Map

From Valve Developer Community
< TF2
Revision as of 21:52, 23 August 2008 by Smurfy (talk | contribs) (Building the payload)

Jump to: navigation, search

This tutorial covers the creation of a pl_goldrush "Payload" style map.

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 logic_auto entity and select the outputs tab.
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnMapSpawn GameRules SetRedTeamRole 1 0.00 No
Io11.png OnMapSpawn GameRules SetBlueTeamRole 2 0.00 No
Io11.png OnMultiNewMap GameRules SetRedTeamRespawnWaveTime 4 0.00 No
Io11.png OnMultiNewMap GameRules SetBlueTeamRespawnWaveTime 8 0.00 No
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
Rate at which to give partial cap points for area captures Self-explanatory 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.

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

Basic payload train.

This section will help you build the train section and the entities needed to get it to function.

  • 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.
  • 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.
  • 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.
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnNumCappersChanged Bomb_Remap InValue <none> 0.00 No
Io11.png OnNumCappersChanged Watcher_A SetNumTrainCappers <none> 0.00 No

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.
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OutValue Bomb_LogicCase InValue <none> 0.00 No

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.
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnCase01 Bomb_Train SetSpeedDirAccel 0 0.00 No
Io11.png OnCase02 Bomb_Train SetSpeedDirAccel 0.5 0.00 No
Io11.png OnCase03 Bomb_Train SetSpeedDirAccel 0.75 0.00 No
Io11.png OnCase04 Bomb_Train SetSpeedDirAccel 1 0.00 No

Train

We can work on the Bomb_Train, this tutorial presumes that you want the mine cart sounds from gold rush itself.

  • 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
Height above Track Self-explanatory 1
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

The Bomb_Train doesent 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

Trains path.

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.
Note:If you clone a path_track entity(Shift-drag), Hammer will automaticly link these together so you can quickly build track without naming manually.

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 them please read Creating a Capture Point to go over the details of setting up a Team_control_point correctly!

Mid point cap

Middle capture point.

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.
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger Bomb_CapArea CaptureCurrentCP 0.00 No
Io11.png OnTrigger CP_A_1_Model Skin 1 0.00 No

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 got to the outputs tab.
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnPass CP_A_1_Relay Trigger 0.00 Yes
Io11.png OnPass CP_A_1 SetOwner 3 0.20 No

This tutorial presumes that you know how to create a team_control_point, name this CP_A_1 and set the owner to Red.

Note:Note the 0.20 delay on SetOwner, which prevent from capping both current (CP_A_1) and next point (CP_A_2; see below) at the same time.
  • 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.
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnCapTeam2 Track_A_23 DisablePath 0.00 No
Io11.png OnCapTeam2 Bomb_CapArea SetControlPoint CP_A_2 0.00 No

This disables the path behind the train and prevents it rolling back, it also sets up the next capture point.

Note:Track_A_23 is the path_track before the center of the Capture Point. Adjust as necessary.

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.
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrainStartRecede Bomb_Train SetSpeedDirAccel -0.2 0.00 No

This will cause the train to start moving backwards at 0.2 of the maximum speed.

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.