Team Fortress 2/Creating a Payload Map: Difference between revisions
| Line 161: | Line 161: | ||
| !   || My Output || Target Entity || Target Input || Parameter || Delay || Only Once | !   || My Output || Target Entity || Target Input || Parameter || Delay || Only Once | ||
| |- | |- | ||
| | [[Image: | | [[Image:Io11.png]] || OnCase01 || Bomb_Train || SetSpeedDirAccel || 0 || 0.00 || No | ||
| |- | |- | ||
| | [[Image: | | [[Image:Io11.png]] || OnCase02 || Bomb_Train || SetSpeedDirAccel || 0.5 || 0.00 || No | ||
| |- | |- | ||
| | [[Image: | | [[Image:Io11.png]] || OnCase03 || Bomb_Train || SetSpeedDirAccel || 0.75 || 0.00 || No | ||
| |- | |- | ||
| | [[Image: | | [[Image:Io11.png]] || OnCase04 || Bomb_Train || SetSpeedDirAccel || 1 || 0.00 || No | ||
| |} | |} | ||
| The outputs will show as broken but will work later. | The outputs will show as broken but will work later. | ||
Revision as of 23:11, 13 June 2008
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 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 - 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
This section will help you build the train section and the entities needed to get it to function.
- Create a small cube with the tools/toolscliptexture and make it a func_tracktrain remember the train is pointing right on the top view, name this Bomb_Train.
- 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.
- Using the tools/toolstriggertexture 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.
- Create another box using the tools/toolstriggeragain around the train, this will be the regen 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 entitys, 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.
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.
The outputs will show as broken but will work later.
Train
We can work on the Bomb_Train, this tutorial presumes that you want the mine cart sounds from gold rush itself.
- This time on the properties of the Bomb_Train you will need to turn smart edit off temporarily and create 3 new key variables.
- Key - Value - ManualAccelSpeed - 70 - ManualDecelSpeed - 150 - ManualSpeedChanges - 1 
 
- You can now turn smart edit back on and begin changing the other 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 
 
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
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 Targetto 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.
Adding a Capture Point
There can be 1 to 3 capture points per round making 2 different types, mid point captures and final captures.
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 got 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.
 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.
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.
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 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.

