Team Fortress 2/Creating a CP assault map: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (spellings)
(cleanup and organization)
Line 2: Line 2:
This tutorial covers the creation of a Dustbowl-style system of rounds.
This tutorial covers the creation of a Dustbowl-style system of rounds.
__TOC__
__TOC__
=Outlining=
=Outlining=
This section will cover the outlines of the linear system.
This section will cover the outlines of the linear system.
==Step 1==
==Step 1==
[[Image:Tutlin outline.jpg|right|thumb|150px|The "outline"]]
[[Image:Tutlin outline.jpg|right|thumb|150px|The "outline"]]
This tutorial is assuming that you already created the skeleton of your map - which would be the status when the map is nearly completed. The map this tutorial is going to use is a simple, three round map you can see on the picture. It would be vital that you check out the labels on the picture, as everything is written down using those labels.
This tutorial is assuming that you already created the skeleton of your map - which would be the status when the map is nearly completed. The map this tutorial is going to use is a simple, three round map you can see on the picture. It would be vital that you check out the labels on the picture, as everything is written down using those labels.
{{clr}}
{{clr}}
==Step 2==
==Step 2==
[[Image:Tutlin properties.jpg|right|thumb|150px|The "properties"]]
[[Image:Tutlin properties.jpg|right|thumb|150px|The "properties"]]
This step introduces the usage of the '''[[team_control_point_master]]''' and '''[[team_control_point_round]]''' entities.<br />
This step introduces the usage of the '''[[team_control_point_master]]''' and '''[[team_control_point_round]]''' entities.
Place a '''[[team_control_point_master]]''' anywhere on your map and go to its properties. The setup differs from a one-round map, as, basically the '''[[team_control_point_round]]''' entities control the gameplay - much like in a parliamentary democracy: the nation has its own head of the state, but the parliament is governing. Set the '''Switch teams on map win?''' field to <tt>Yes</tt>, and this entity is done. The next step is placing as many '''team_control_point_round''' entities as many rounds your map has. The properties of these entities are much like those of the master. Make sure you set an easily identifiable name for each round, such as <tt>round_1</tt>. The priority field will make sure that the game is linear: Set it to 100 for the first round, 99 for the second round and so on. You may also want to restrict the defending team from winning - set the '''Restrict team from winning''' to Red. Finally, in the '''Control points in this round''' field, input the '''Name'''s of the control points for that round, separated by a space.<br˛/>
<br />
You may also use the '''OnWonByTeam1''', '''OnStart''' and '''OnWonByTeam2''' outputs of the round controls to enable/disable certain entities on the map.
* Place a '''[[team_control_point_master]]''' anywhere on your map and go to its properties.
{{note|The setup differs from a one-round map, as basically the '''[[team_control_point_round]]''' entities control the gameplay - much like in a parliamentary democracy: the nation has its own head of the state, but the parliament is governing.}}
* Set the '''Switch teams on map win?''' field to <tt>Yes</tt>.
* The next step is placing a '''team_control_point_round''' entity for each round your map has. The properties of these entities are much like those of the [[team_control_point_master]]. Make sure you set an easily identifiable name for each round, such as <tt>round_1</tt>. The priority field will make sure that the game is linear: Set it to 100 for the first round, 99 for the second round and so on. You may also want to restrict the defending team from winning - set the '''Restrict team from winning''' to Red. Finally, in the '''Control points in this round''' field, input the '''Name'''s of the control points for that round, separated by a space.
<br˛/>
{{note|You may also use the '''OnWonByTeam1''', '''OnStart''' and '''OnWonByTeam2''' outputs of the round controls to enable/disable certain entities on the map.}}
 
=Setup=
=Setup=
In this section, you will learn how to set up different entities for round-based gameplay.
In this section, you will learn how to set up different entities for round-based gameplay.
==Step 1==
==Step 1==
[[Image:Tutlin spawn.jpg|right|thumb|150px|The "playerspawn"]]
[[Image:Tutlin spawn.jpg|right|thumb|150px|The "playerspawn"]]
Now that you have your rounds, you might want to specify the entry points of each team. Now, if you had placed '''[[info_player_teamspawn]]''' entities on your map, you will either have to delete them all or configure them individually. It is advised that you place one of these spawns in each spawnroom, and when you have them configured, copy it multiple times. Set the teamspawn's '''Team''' keyvalue to any of the teams, it doesn't matter. What might matter is '''Associated Control Point''' - if you want the spawnplace to be useable by the team who owns a certain control point, then input its name into this field. Important  
Now that you have your rounds, you might want to specify the entry points of each team.
fields are '''Blue''' and '''Red spawn for round'''. Type the name of the rounds into these fields for which you want a team to spawn at these spawnpoints.
* Fill your respawn rooms with '''[[info_player_teamspawn]]''''s and set their teamspawn's '''Team''' key value to any of the teams, it doesn't matter. What might matter is '''Associated Control Point''' - if you want the spawn place to be usable by the team who owns a certain control point, then input its name into this field. Important fields are '''Blue''' and '''Red spawn for round'''. Type the name of the rounds into these fields for which you want a team to spawn at these spawn points.
 
{{clr}}
{{clr}}
==Step 2==
==Step 2==
[[Image:Tutlin time.jpg|right|thumb|150px|The "time"]]
[[Image:Tutlin time.jpg|right|thumb|150px|The "time"]]
The map has almost everything it requires, there is only one little problem: neither teams can win. To fix this problem, add a '''[[team_round_timer]]''' entity. Its keyvalues are explained in the table below.
The map has almost everything it requires, there is only one little problem: neither teams can win.
{| border="1" style="text-align:left"
* Add a '''[[team_round_timer]]''' entity. Its key values are explained in the table below.
!Keyvalue || Description || Suggested value
::{|
! Property Name || Description || Value
|-
|-
!Name
| Name || Name of the entity || start_timer
|Self-explanatory || <tt>start_timer</tt>
|-
|-
!Timer Length
| Timer Length || Time limit at the beginning (in seconds) || 180-300
|The time limit at the beginning (in seconds) || <tt>180-300</tt> depending on difficulty
|-
|-
!Max Timer Length
| Max Timer Length || Max amount of time limit (0 = no limit) || 0
|The maximum amount of time limit (0 = no limit) || <tt>0</tt>
|-
|-
!Setup Timer Length
| Setup Timer Length || Setup time before gates open (in seconds) || 45-60
|The setup time, before the gates open || <tt>45-60</tt>
|-
|-
!Reset Time on Round Restart
| Reset Time on Round Restart || Self-explanatory || No
|Self-explanatory || <tt>No</tt>
|-
|-
!Use Countdown Sounds
| Use Countdown Seconds || Self-explanatory || Yes
|Self-explanatory || <tt>Yes</tt>
|-
|-
!Show Timer in HUD
| Show Timer in Hud || Self-explanatory || Yes
|Self-explanatory || <tt>Yes</tt>
|}
|}
You can use this entity to open the doors of the attacking team's spawnrooms. To do this, create '''[[logic_relay]]''' entities, name them in a sequence such as <tt>relay_spawn_1</tt>, <tt>relay_spawn_2</tt> and so on. Disable all of them but the first one. Add these outputs to the timer:
 
* This entity can open the doors of the attacking team's spawn rooms. To do this, create '''[[logic_relay]]''' entities, name them in a sequence such as <tt>relay_spawn_1</tt>, <tt>relay_spawn_2</tt> , etc and disable all of them but the first one. Add these outputs to the [[team_round_timer]]:
 
[[Image:Tutlin win.jpg|right|thumb|150px|The "win"]]
[[Image:Tutlin win.jpg|right|thumb|150px|The "win"]]
{| border="1" style="text-align:left"
 
!Output || Target || Input || Parameter || Delay
::{|
!   || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
!OnSetupFinished
| [[Image:Io11.png]] || OnSetupFinished || relay_spawn_1 || Trigger || <none> || 0.00 || No
|relay_spawn_1 || Trigger || || 0.00
|-
|-
!OnSetupFinished
| [[Image:Io11.png]] || OnSetupFinished || relay_spawn_2 || Trigger || <none> || 0.00 || No
|relay_spawn_2 || Trigger || || 0.00
|}
 
And so on for all of them.
 
* On each relay, add these outputs:
::{|
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
| [[Image:Io11.png]] || OnTrigger || !self || Disable || <none> || 0.00 || No
|-
| [[Image:Io11.png]] || OnTrigger || (spawn room door) || Open || <none> || 0.00 || No
|-
| [[Image:Io11.png]] || OnTrigger || (name of next relay) || Enable || <none> || 0.00 || No
|}
 
* The specified time seems a little short to win 3 rounds, that's why the control points need to be set up for this. For each '''[[trigger_capture_area]]''' add an output:
::{|
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
| [[Image:Io11.png]] || OnCapTeam2 || start_timer || AddTime || (same time limit as beginning) || 0.00 || No
|}
This will add more time once the capture point is taken.
 
* Moving on to address the issue of Red not being able to win. You need to add a '''[[game_round_win]]''' entity for this. Set the properties as the following:
::{|
!  Property Name || Value
|-
| Name || end_of_game
|-
| Team || Red
|-
| Force map reset || Yes
|-
|-
| Switch teams on map win? || Yes
|}
|}
And so on for all of them. On each relay, add these outputs:
 
{| border="1" style="text-align:left"
* Now, go back to the [[team_round_timer]] and add an output:
!Output || Target || Input || Parameter || Delay
 
::{|
!   || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
!OnTrigger
| [[Image:Io11.png]] || OnFinished || end_of_game || RoundWin || <none> || 0.00 || No
|(name of this relay) || Disable || || 0.00
|}
 
* The issue of Blu not being able to win is a little bit simpler. Add another '''[[game_round_win]]''' entity with the following properties:
 
::{|
!  Property Name || Value
|-
|-
!OnTrigger
| Name || blue_win
|(spawnroom door name) || Open || || 0.00
|-
|-
!OnTrigger
| Team || Blue
|(name of the next relay (for example if this is relay_spawn_1, then relay_spawn_2)) || Enable || || 0.00
|-
| Force map reset || Yes
|-
| Switch teams on map win? || Yes
|}
 
* For the very last '''[[trigger_capture_area]]''' of the very last round, add an output:
 
::{|
!  || My Output || Target Entity || Target Input || Parameter || Delay || Only Once
|-
|-
| [[Image:Io11.png]] || OnCapTeam2 || blue_win || RoundWin || <none> || 0.00 || No
|}
|}
The specified time seems a little short to win 3 rounds, that's why the control points need to be set up for this. For each '''[[trigger_capture_area]]''' add an output of '''OnCapTeam2''', targeting <tt>start_timer</tt> via the input '''AddTime'''. You will want to set the parameter to the same amount as the time limit in the beginning.<br />
 
Moving on to address the issue of Red not being able to win. You need to add a '''[[game_round_win]]''' entity for this. Set its '''Name''' to <tt>end_of_game</tt> and its '''Team''' to Red. You will also want to set '''Force map reset''' and '''Switch teams on map win?''' to <tt>Yes</tt>. Now, go back to the timer and add an output of '''OnFinished''', targeting <tt>end_of_game</tt> via input '''RoundWin'''. As soon as the timer expires, RED team wins the game.<br />
The issue of Blu not being able to win is a little bit simpler: add another '''[[game_round_win]]''' entity with the same keyvalues as the last one, except for the '''Name''', which should be <tt>blue_win</tt> and the '''Team''', which should be Blue. For the very last '''[[trigger_capture_area]]''' of the very last round, add an output of '''OnCapTeam2''', targeting <tt>blue_win</tt> via input '''RoundWin'''.
=Theory=
=Theory=
This is the end of the tutorial. You should have a fully functional linear round-based map. If you have any questions, complaints, shoot, on the [[Talk:Creating_A_Linear_Gameplay_Map|talk page]].
This is the end of the tutorial. You should have a fully functional linear round-based map. If you have any questions, complaints, shoot, on the [[Talk:Creating_A_Linear_Gameplay_Map|talk page]].

Revision as of 14:42, 25 November 2007

This tutorial covers the creation of a Dustbowl-style system of rounds.

Outlining

This section will cover the outlines of the linear system.

Step 1

The "outline"

This tutorial is assuming that you already created the skeleton of your map - which would be the status when the map is nearly completed. The map this tutorial is going to use is a simple, three round map you can see on the picture. It would be vital that you check out the labels on the picture, as everything is written down using those labels.

Step 2

The "properties"

This step introduces the usage of the team_control_point_master and team_control_point_round entities.

Note.pngNote:The setup differs from a one-round map, as basically the team_control_point_round entities control the gameplay - much like in a parliamentary democracy: the nation has its own head of the state, but the parliament is governing.
  • Set the Switch teams on map win? field to Yes.
  • The next step is placing a team_control_point_round entity for each round your map has. The properties of these entities are much like those of the team_control_point_master. Make sure you set an easily identifiable name for each round, such as round_1. The priority field will make sure that the game is linear: Set it to 100 for the first round, 99 for the second round and so on. You may also want to restrict the defending team from winning - set the Restrict team from winning to Red. Finally, in the Control points in this round field, input the Names of the control points for that round, separated by a space.

<br˛/>

Note.pngNote:You may also use the OnWonByTeam1, OnStart and OnWonByTeam2 outputs of the round controls to enable/disable certain entities on the map.

Setup

In this section, you will learn how to set up different entities for round-based gameplay.

Step 1

The "playerspawn"

Now that you have your rounds, you might want to specify the entry points of each team.

  • Fill your respawn rooms with info_player_teamspawn's and set their teamspawn's Team key value to any of the teams, it doesn't matter. What might matter is Associated Control Point - if you want the spawn place to be usable by the team who owns a certain control point, then input its name into this field. Important fields are Blue and Red spawn for round. Type the name of the rounds into these fields for which you want a team to spawn at these spawn points.

Step 2

The "time"

The map has almost everything it requires, there is only one little problem: neither teams can win.

Property Name Description Value
Name Name of the entity start_timer
Timer Length Time limit at the beginning (in seconds) 180-300
Max Timer Length Max amount of time limit (0 = no limit) 0
Setup Timer Length Setup time before gates open (in seconds) 45-60
Reset Time on Round Restart Self-explanatory No
Use Countdown Seconds Self-explanatory Yes
Show Timer in Hud Self-explanatory Yes
  • This entity can open the doors of the attacking team's spawn rooms. To do this, create logic_relay entities, name them in a sequence such as relay_spawn_1, relay_spawn_2 , etc and disable all of them but the first one. Add these outputs to the team_round_timer:
The "win"
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnSetupFinished relay_spawn_1 Trigger <none> 0.00 No
Io11.png OnSetupFinished relay_spawn_2 Trigger <none> 0.00 No

And so on for all of them.

  • On each relay, add these outputs:
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnTrigger !self Disable <none> 0.00 No
Io11.png OnTrigger (spawn room door) Open <none> 0.00 No
Io11.png OnTrigger (name of next relay) Enable <none> 0.00 No
  • The specified time seems a little short to win 3 rounds, that's why the control points need to be set up for this. For each trigger_capture_area add an output:
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnCapTeam2 start_timer AddTime (same time limit as beginning) 0.00 No

This will add more time once the capture point is taken.

  • Moving on to address the issue of Red not being able to win. You need to add a game_round_win entity for this. Set the properties as the following:
Property Name Value
Name end_of_game
Team Red
Force map reset Yes
Switch teams on map win? Yes
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnFinished end_of_game RoundWin <none> 0.00 No
  • The issue of Blu not being able to win is a little bit simpler. Add another game_round_win entity with the following properties:
Property Name Value
Name blue_win
Team Blue
Force map reset Yes
Switch teams on map win? Yes
My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnCapTeam2 blue_win RoundWin <none> 0.00 No

Theory

This is the end of the tutorial. You should have a fully functional linear round-based map. If you have any questions, complaints, shoot, on the talk page.