Left 4 Dead Infected Populations

From Valve Developer Community
Revision as of 20:39, 4 August 2009 by Corion (talk | contribs) (Created page with '==The Basic Idea== Infected populations control which kinds of common infected can be spawned in the different sections of your map. For example, infected populations can cause …')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Basic Idea

Infected populations control which kinds of common infected can be spawned in the different sections of your map.

For example, infected populations can cause common infected looking like:

  • patients, nurses, and surgeons to spawn in a hospital
  • military personnel to spawn in a military base
  • rural citizens to spawn on a farm
  • police officers to spawn on a street filled with police cars

Each defined population has a name and a list of model names with associated percentages. The percentages within each population add up to 100% and define how frequently each type of infected should be spawned within the area.

For example, the "hospital" population is defined as: hospital { common_male01 15 common_patient_male01 40 common_worker_male01 15 common_female_nurse01 15 common_surgeon_male01 10 }

This means that any areas with the name "hospital" would spawn approximately:

  • 15% common_male01
  • 40% common_patient_male01
  • 15% common_worker_male01
  • 15% common_female_nurse01
  • 10% common_surgeon_male01

Additionally, the populations may also allow certain special infected to spawn. This is typically used in conjunction with Info_zombie_spawn. Currently only hunters, boomers, and smokers can be spawned through infected populations.

To specify populations within your map, your nav mesh areas must be given place names corresponding to those defined in population.txt, located within the "scripts" directory of your Left 4 Dead installation.

How To

  1. Load your map in Left 4 Dead.
  2. Enable cheats by typing "sv_cheats 1" into the console.
  3. Type "nav_edit 1" in the console to see the nav mesh.
  4. Type "nav_toggle_place_mode" into the console and hit enter (or use "nav_set_place_mode"). You should hear a beep signaling it was turned on. There is a different sound when you disable this.
  5. Type "nav_use_place <place name>" in the console. This is like picking the color of a paintbrush in an image editing program. It decides what place name will be used for all of the place commands. This place name will be referred to as your chosen place name.
  6. Paint your nav areas.
    1. Type "nav_place_floodfill" in the console to flood fill, using the chosen place name, all areas that can be reached from the nav area at which your cursor is pointed (as well as the area at which your cursor is pointed). You should use this first to set your map's default spawn type. For instance, if you're making a Hospital map but want to fine-tune a few areas, you want to set the entire map to use "hospital" so that there are no remaining nav areas using "default".
    2. You can paint areas individually using "nav_place_set".
    3. You can also turn on a special painting mode with "nav_toggle_place_painting". This command will paint every nav area you look at with the chosen place name.
    4. You can use "nav_place_pick" as a sort of eyedropper for your chosen place name. It will pick the place name from the area you are looking at at and use it as your new chosen place name.
  7. Type "nav_toggle_place_mode" into the console and hit enter (or use "nav_set_place_mode") to turn place mode off. You'll hear a different sound signifying that it has been turned off.
  8. Save the navigation mesh by typing "nav_save" into the console.
  9. Use "nav_edit 0" to turn off the nav grid display.

List of Useful Commands

  • nav_set_place_mode <0/1>
Sets the editor into or out of place mode. Place mode allows labeling of area with place names.
  • nav_toggle_place_mode
Toggle the editor into and out of place mode. Place mode allows labeling of area with place names.
  • nav_toggle_place_painting
Toggles place painting mode. When place painting, pointing at an area will 'paint' it with the chosen place name.
  • nav_place_list
Lists all place names used in the map.
  • nav_mark_unnamed
Marks all areas with no place name. Useful for finding stray areas missed while place painting.
  • nav_use_place <optional: place name>
If used without arguments, all available place names will be listed. If a place name argument is given, it becomes the chosen place name.
  • nav_place_floodfill
Sets the place name of the area at which your cursor is pointed to the chosen place name, and 'flood-fills' the chosen place name to all areas that can be reached from the area at which your cursor is pointed.
  • nav_place_pick
Changes the chosen place name to the place of the area under the cursor.
  • nav_place_replace
Replaces all instances of the first place name with the second place name.
  • nav_place_set
Sets the place name of all selected areas to the chosen place name.

List of Official Population Names

Urban

  • defaulturban
    • 30% common_male01
    • 25% common_female01
    • 15% common_male_suit
    • 10% common_police_male01
    • 10% common_military_male01
    • 10% common_worker_male01
  • police
    • 50% common_police_male01
    • 20% common_male01
    • 20% common_female01
    • 10% common_military_male01
  • maintenance
    • 35% common_worker_male01
    • 25% common_male01
    • 20% common_female01
    • 20% common_military_male01
  • hospitalgrounds
    • 20% common_male01
    • 20% common_female01
    • 15% common_police_male01
    • 15% common_military_male01
    • 15% common_worker_male01
    • 15% common_male_suit
  • hospital
    • 40% common_patient_male01
    • 15% common_male01
    • 15% common_worker_male01
    • 15% common_female_nurse01
    • 10% common_surgeon_male01
  • hospitalconstruction
    • 30% common_worker_male01
    • 20% common_patient_male01
    • 20% common_female_nurse01
    • 20% common_male01
    • 10% common_surgeon_male01
  • airport
    • 20% common_female01
    • 20% common_male_suit
    • 15% common_worker_male01
    • 15% common_male_baggagehandler_01
    • 15% common_tsaagent_male01
    • 15% common_male_pilot
  • airportfinale
    • 30% common_male_baggagehandler_01
    • 20% common_tsaagent_male01
    • 20% common_male_pilot
    • 10% common_female01
    • 10% common_male_suit
    • 10% common_worker_male01

Rural

  • defaultrural
    • 50% common_male_rural01
    • 20% common_female_rural01
    • 10% common_police_male01
    • 10% common_military_male01
    • 10% common_worker_male01

Special

  • church
    • 50% boomer
    • 25% hunter
    • 25% smoker
Note.png Note: This is used with the Info_zombie_spawn located inside of the safe room in the church of Death Toll 3 to spawn a random special infected once the crescendo event is finished.

Default and Others

  • default
    • 30% common_male01
    • 25% common_female01
    • 15% common_police_male01
    • 10% common_military_male01
    • 10% common_worker_male01
    • 10% common_male_suit
  • test_common_male_suit
    • 100% common_male_suit
  • zoo
    • 20% common_male01
    • 10% common_female01
    • 10% common_male_rural01
    • 10% common_male_suit
    • 5% common_female_rural01
    • 5%common_female_nurse01
    • 5%common_male_baggagehandler_01
    • 5%common_male_pilot
    • 5%common_military_male01
    • 5%common_patient_male01
    • 5%common_police_male01
    • 5%common_surgeon_male01
    • 5%common_TSAAgent_male01
    • 5%common_worker_male01

List of Population-Supported Infected Types

Common Infected

  • common_female01
  • common_female_nurse01
  • common_female_rural01
  • common_male01
  • common_male_baggagehandler_01
  • common_male_pilot
  • common_male_rural01
  • common_male_suit
  • common_military_male01
  • common_patient_male01
  • common_police_male01
  • common_surgeon_male01
  • common_tsaagent_male01
  • common_worker_male01

Special Infected

  • boomer
  • hunter
  • smoker
Warning.png Warning: Attempting to use "witch" or "tank" in a population will result in a common infected with the with or tank model and animations.

Creating a User-Defined Population

To do: Figure out how to create and use a custom Population and include it with an add-on. It is likely adding a population.txt inside of the /scripts directory of your add-on will allow this. Could someone please verify?