Difference between revisions of "Survival Gametype (L4D)"

From Valve Developer Community
Jump to: navigation, search
(Clarified the use of nav attributes)
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{otherlang2
+
{{lang|Survival Gametype (L4D)}}
|noborder=true
 
|es=Survival_Gametype_(L4D):es
 
|ru=Survival Gametype (L4D):ru
 
}}
 
 
This article includes basic instructions for creating a Survival mode map for [[Left 4 Dead]].  
 
This article includes basic instructions for creating a Survival mode map for [[Left 4 Dead]].  
  
 
== Starting Survival ==
 
== Starting Survival ==
 +
Survival rounds begin by triggering any form of panic event.<br>
 +
Any entity capable of telling the Director to force a [[L4D Level Design/Panic Events|Panic Event]] will work. Such as [[func_button]], [[func_button_timed]], [[trigger_finale]], [[trigger_once]], [[prop_car_alarm]] or even that one song on the Jukebox.<br>
 +
This is set up in the same method as starting a finale or crescendo event.
  
Use a [[Trigger_finale|trigger_finale]] or a [[L4D Level Design/Panic Events|Director Panic Event]] input to start the finale. This is set up in the same method as starting a finale or crescendo event.
+
== Navmesh ==
  
== Battlefield ==
+
All Survival mode maps rely on using the "'''Finale'''" or "'''Battlefield'''" and the optional "'''Battlestation'''" attribute on your navigation mesh to define the play space for the Survival mode.
 +
Setting up the Nav mesh works differently based on whether your map is exclusively for survival, or if it adds survival mode to maps already used for campaigns.
  
All Survival mode maps rely on the BATTLEFIELD or FINALE attributes on your navigation mesh to define the play space for the Survival mode. In [[L4D Level Design/Nav Meshes|Nav edit mode]], mark the spaces which will be used for the Survival playspace with BATTLEFIELD or FINALE. Also, the BATTLESTATION attribute can be used to define good holdout spots for the Survivor Bots. This is set up in the same way as finales or [[L4D Level Design/Panic Events|Crescendo Events]]. Also mark the area where players start with the PLAYER_START attribute.
+
=== Pure Survival Maps===
 +
If your map is only meant for survival, select the starting area navmesh In [[L4D Level Design/Nav Meshes|Nav edit mode]] and use the command "'''mark Player_start'''". to mark it as starting location.<br>
 +
Afterwards use the console command "'''nav_select_radius 1000000000'''" to select the entire navmesh and mark it using the command "'''mark finale'''".<br>
 +
Also, the "'''Battlestation'''" attribute can be used to define good holdout spots for the Survivor Bots, which will then prefer to stick to that area. This is set up in the same way as finales or [[L4D Level Design/Panic Events|Crescendo Events]].
  
It is possible to control which areas infected can spawn in by either marking all areas with both FINALE and BATTLEFIELD and then removing the FINALE attribute from areas to disable spawning there, or by adding the NO_MOBS and EMPTY attributes to disabled areas.
+
For pure survival maps, it is possible to control which areas infected can spawn in by either marking all areas with both "'''Finale'''" and "'''Battlefield'''" and then removing the "'''Finale'''" attribute from areas to disable spawning there. Note that this will break navigation for other game modes.<br>
 +
{{note|This behavior may be a bug rather than an intentional feature.}}
  
== info_gamemode ==
+
=== Multi-Gamemode Maps===
 +
Existing crescendo or finale events that use the "''Battlefield'''" or "''Finale''" nav attributes can often be used without any changes to the nav mesh.
  
Use the [[Info_gamemode|info_gamemode]] entity to set up specific map logic if a single .BSP runs in multiple modes. The '''OnSurvival''' output will fire when a map is loaded in Survival mode to set up any specific logic you'd like to do in survival mode. This will allow you to enable/disable or spawn func_brush walls, clip brushes, dynamic props, items, etc. You can use [[Point_template|point_template]] and [[Logic_relay|logic_relay]] entities triggered here for complex changes to the map.  
+
If your map adds survival sections to a coop map, add a [[func_nav_attribute_region]] encasing the area you want to play Survival in, as well as areas where infected should spawn for survival.<br>
 +
Call it "survival_nav_battlefield" and enable the Flag "'''Battlefield'''". You may also add additional "func_nav_attribute_region" entities of same names for more attributes like "'''Battlestation'''", where Survivor bots tend to stay.<br>
 +
{{note|Using both the "'''Player_start'''" and "'''Finale'''" attributes in the same area does not work in multi-mode maps.}}
 +
 
 +
To enable the nav attributes, you need a [[info_gamemode]] entity which force spawns a [[point_template]] entity with the output '''OnSurvivalPostIO'''.<br>
 +
{| {{OutputsTable}}
 +
| [[Image:Io11.png]] || OnSurvivalPostIO|| Point_template|| ForceSpawn|| <none> || 0.0 || No
 +
|}
 +
This very same point_template can be used to spawn all other entities required by survival, such as all weapons and props to block paths.
  
 
== info_survivor_position ==
 
== info_survivor_position ==
 
+
Survivors spawn at [[Info_survivor_position|info_survivor_position]] entities.<br>
Survivors spawn at [[Info_survivor_position|info_survivor_position]] entities for Survival maps. Simply place four of these in your map to signify where the survivors should spawn in survival mode. In the case of a finale map with an escape vehicle which already uses info_survivor_positions, you may need to use the [[Info_gamemode|info_gamemode]] to kill these other positions so the survivors will spawn at the proper positions.  
+
Unfortunately finale maps use the same entity to "teleport" the survivors away when approaching the escape vehicle. If your survival map is also the finale of a campaign, or if your map uses the info_survivor_position for anything but the survival spawnpoint, you will need to delete those. Else your players might spawn at the wrong place.<br>
 +
Delete the extra info_survivor_position entities via the [[Info_gamemode]] entity, using the following outputs
 +
{| {{OutputsTable}}
 +
| [[Image:Io11.png]] || OnSurvival|| '''''info_survivor_position used by finale''''' || kill|| <none> || 0.0 || No
 +
|}
  
 
== Items ==
 
== Items ==
 +
In L4D, all placed items in the map will spawn in survival mode regardless of the normal densities allowed in other modes. If you wish to change the item placement or numbers, you can use the info_gamemode to spawn or kill items.
  
In L4D, all placed items in the map will spawn in survival mode regardless of the normal densities allowed in other modes. If you wish to change the item placement or numbers, you can use the info_gamemode to spawn or kill items.  
+
In L4D2, all item spawns are removed in survival mode.<br>
 +
In order to spawn items, you must give every intended survival item a name. You may give all of them the same name to make it easier.<br>
 +
{{note|Director controlled entities such as [[Weapon_spawn|weapon_spawn]] and [[Weapon_item_spawn|weapon_item_spawn]] do not work.}}
 +
<br>
 +
Add a [[Point_template|point_template]], give it a unique name which lists all survival item names in its "Template" lines.<br>
 +
Add a [[Info_gamemode|info_gamemode]] entity with the following outputs
 +
{| {{OutputsTable}}
 +
| [[Image:Io11.png]] || OnSurvivalPostIO|| Point_template|| ForceSpawn|| <none> || 0.0 || No
 +
|}
 +
{{warning|Using "OnSurvival" instead of "OnSurvivalPostIO" will cause ammo and ammo upgrades not to be spawned.}}
  
In L4D2, all item spawns are removed in survival mode. The intended way to spawn items is using a [[Point_template|point_template]], usually triggered using a [[Info_gamemode|info_gamemode]]. Director controlled entities such as [[Weapon_spawn|weapon_spawn]] and [[Weapon_item_spawn|weapon_item_spawn]] do not work.
+
== info_gamemode - other uses ==
 +
Maps are able to load different entities, depending on which gamemode the map is run in. As mentioned in the previous section, survival gamemodes in L4D2 require a info_gamemode and point_template to spawn any items in survival gamemode at all.<br>
 +
The same two entities can be used to load [[func_brush]] walls, clip brushes, [[prop_dynamic]], items, or any other sort of entity into your map for survival gamemodes. Like adding barricade props to stop players from reaching the end map saferoom.<br>
 +
Alternatively, you could use info_gamemode along with a [[Logic_relay|logic_relay]] to delete items you do not wish to have in survival, like [[prop_car_alarm|Alarm cars]] which when shot would start the survival round prematurely.
  
 
== Mission file and testing ==
 
== Mission file and testing ==
 +
Before you can test your map in survival mode, you must add your map to the mission files "survival" mode section.
  
Add your .BSP to the mission file in the modes section as a survival map and it will work through the menu system. See the [[Deadline_Mission_File]] as an example. You may also set the game mode directly in the console by setting "<code>mp_gamemode survival</code>", however, the mission file will require setup before shipping for the game to play in the correct mode online. When you're done, you can create an [[Add-on]] that includes your map.
+
Example:
 +
"modes"
 +
{
 +
  "survival"
 +
  {
 +
  "1"
 +
  {
 +
  "Map" "mymap"
 +
  "DisplayName" "My survival Map"
 +
  "Image" "maps/preview_01"
 +
  }
 +
  }
 +
}
  
{{note|The command <code>mp_gamemode survival</code> does not function in L4D2.  To test your survival map in L4D2, type in this command instead: <code>map <map name> survival</code>}}
+
The map can be loaded into survival either through the main menu, or using the console via the Command "'''map mapname_here survival'''". The latter allows you to use sv_cheats 1 while on survival mode.
  
 
== See also ==
 
== See also ==

Latest revision as of 02:16, 20 July 2021

English Español Русский 简体中文

This article includes basic instructions for creating a Survival mode map for Left 4 Dead.

Starting Survival

Survival rounds begin by triggering any form of panic event.
Any entity capable of telling the Director to force a Panic Event will work. Such as func_button, func_button_timed, trigger_finale, trigger_once, prop_car_alarm or even that one song on the Jukebox.
This is set up in the same method as starting a finale or crescendo event.

Navmesh

All Survival mode maps rely on using the "Finale" or "Battlefield" and the optional "Battlestation" attribute on your navigation mesh to define the play space for the Survival mode. Setting up the Nav mesh works differently based on whether your map is exclusively for survival, or if it adds survival mode to maps already used for campaigns.

Pure Survival Maps

If your map is only meant for survival, select the starting area navmesh In Nav edit mode and use the command "mark Player_start". to mark it as starting location.
Afterwards use the console command "nav_select_radius 1000000000" to select the entire navmesh and mark it using the command "mark finale".
Also, the "Battlestation" attribute can be used to define good holdout spots for the Survivor Bots, which will then prefer to stick to that area. This is set up in the same way as finales or Crescendo Events.

For pure survival maps, it is possible to control which areas infected can spawn in by either marking all areas with both "Finale" and "Battlefield" and then removing the "Finale" attribute from areas to disable spawning there. Note that this will break navigation for other game modes.

Note.png Note: This behavior may be a bug rather than an intentional feature.

Multi-Gamemode Maps

Existing crescendo or finale events that use the "Battlefield'" or "Finale" nav attributes can often be used without any changes to the nav mesh.

If your map adds survival sections to a coop map, add a func_nav_attribute_region encasing the area you want to play Survival in, as well as areas where infected should spawn for survival.
Call it "survival_nav_battlefield" and enable the Flag "Battlefield". You may also add additional "func_nav_attribute_region" entities of same names for more attributes like "Battlestation", where Survivor bots tend to stay.

Note.png Note: Using both the "Player_start" and "Finale" attributes in the same area does not work in multi-mode maps.

To enable the nav attributes, you need a info_gamemode entity which force spawns a point_template entity with the output OnSurvivalPostIO.

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnSurvivalPostIO Point_template ForceSpawn <none> 0.0 No

This very same point_template can be used to spawn all other entities required by survival, such as all weapons and props to block paths.

info_survivor_position

Survivors spawn at info_survivor_position entities.
Unfortunately finale maps use the same entity to "teleport" the survivors away when approaching the escape vehicle. If your survival map is also the finale of a campaign, or if your map uses the info_survivor_position for anything but the survival spawnpoint, you will need to delete those. Else your players might spawn at the wrong place.
Delete the extra info_survivor_position entities via the Info_gamemode entity, using the following outputs

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnSurvival info_survivor_position used by finale kill <none> 0.0 No

Items

In L4D, all placed items in the map will spawn in survival mode regardless of the normal densities allowed in other modes. If you wish to change the item placement or numbers, you can use the info_gamemode to spawn or kill items.

In L4D2, all item spawns are removed in survival mode.
In order to spawn items, you must give every intended survival item a name. You may give all of them the same name to make it easier.

Note.png Note: Director controlled entities such as weapon_spawn and weapon_item_spawn do not work.


Add a point_template, give it a unique name which lists all survival item names in its "Template" lines.
Add a info_gamemode entity with the following outputs

  My Output Target Entity Target Input Parameter Delay Only Once
Io11.png OnSurvivalPostIO Point_template ForceSpawn <none> 0.0 No
Warning.png Warning: Using "OnSurvival" instead of "OnSurvivalPostIO" will cause ammo and ammo upgrades not to be spawned.

info_gamemode - other uses

Maps are able to load different entities, depending on which gamemode the map is run in. As mentioned in the previous section, survival gamemodes in L4D2 require a info_gamemode and point_template to spawn any items in survival gamemode at all.
The same two entities can be used to load func_brush walls, clip brushes, prop_dynamic, items, or any other sort of entity into your map for survival gamemodes. Like adding barricade props to stop players from reaching the end map saferoom.
Alternatively, you could use info_gamemode along with a logic_relay to delete items you do not wish to have in survival, like Alarm cars which when shot would start the survival round prematurely.

Mission file and testing

Before you can test your map in survival mode, you must add your map to the mission files "survival" mode section.

Example:

"modes"
{
 	"survival"
 	{
 		"1"
 		{
 		"Map" "mymap"
 		"DisplayName" "My survival Map"
 		"Image" "maps/preview_01"	
 		}
 	}
}

The map can be loaded into survival either through the main menu, or using the console via the Command "map mapname_here survival". The latter allows you to use sv_cheats 1 while on survival mode.

See also