User:Brandished/Sandbox 1: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
m (Unicodifying, replaced: [[Image: → [[File: (22))
 
(20 intermediate revisions by one other user not shown)
Line 1: Line 1:
For this tutorial we will be making a simple 2 level campaign that never ends.  Sounds fun, right?  Well, maybe not, but the purpose really isn't to have a full campaign, but to explain the basics of level construction in L4D.
Thumbnails and image scaling.


First, lets cover what our L4D campaign will need to work right:
== Pixel scaling, no thumb tags, no align ==
* A director
[[File:nav_edit.jpg|200px|Before split]]
* A starting point
[[File:nav_split.jpg|200px|After split]]
* 2 safe house doors
[[File:nav_mark.jpg|200px|Marked first area]]
* Some weapons, ammo, and health
{{clr}}
* A rescue closet
== Thumb tags, default align ==
* A change-level
[[File:nav_edit.jpg|200px|thumb|Before split]]
* A fog controller
[[File:nav_split.jpg|200px|thumb|After split]]
[[File:nav_mark.jpg|200px|thumb|Marked first area]]
{{clr}}
== Thumb tags, left align ==
[[File:nav_jump.jpg|200px|thumb|left|'''Jump areas''' (marked with green X's) tell bots that they must jump to reach the higher connected area, and that this area is not usable as a hiding/sniping spot.]]
[[File:nav_crouch.jpg|200px|thumb|left|'''Crouch areas''' (marked with a blue diagonal slash) force bots to crouch when moving through this area.]]
[[File:nav_end_area.jpg|200px|thumb|left|Area created]]
{{clr}}
== Thumb tags, right align ==
[[File:nav_begin_area.jpg|200px|thumb|right|Start dragging area at first corner]]
[[File:nav_drag_area.jpg|200px|thumb|right|Drag area extent]]
[[File:nav_end_area.jpg|200px|thumb|right|Area created]]
{{clr}}
== Thumb tags, center align ==
[[File:nav_edit.jpg|200px|thumb|center|Before split]]
[[File:nav_split.jpg|200px|thumb|center|After split]]
[[File:nav_mark.jpg|200px|thumb|center|Marked first area]]
{{clr}}
== Thumb tags, left, center, right align ==
[[File:nav_edit.jpg|200px|thumb|left|Before split]]
[[File:nav_split.jpg|200px|thumb|center|After split]]
[[File:nav_mark.jpg|200px|thumb|right|Marked first area]]
{{clr}}
== Gallery tags ==
<gallery>
Image:nav_edit.jpg|Before split
Image:nav_split.jpg|After split
Image:nav_mark.jpg|Marked first area
</gallery>
{{clr}}
== Table enclosure ==
=== Model Description ===


Here's the map's layout and set up.
'''Skins'''
 
{|
To start with we'll add an info_director and a env_fog_controller.  Make sure to the "Fog Enable" property is set to "Yes".
| [[File:Doormain01 handle1 skin1.jpg|none|thumb|50px|Skin 1]]
 
| [[File:Doormain01 handle1 skin2.jpg|none|thumb|50px|Skin 2]]
If your spawn area has a "prop_door_rotating_checkpoint" to exit by, make sure the model is set to models/props_doors/checkpoint_door_01.mdl, the keyvalue "body" has value of 1, the Spawn Position is set to "Closed" (spawnpos keyvalue 0), and the "Starts Open" flag is unchecked.
| [[File:Doormain01 handle1 skin3.jpg|none|thumb|50px|Skin 3]]
 
| [[File:Doormain01 handle1 skin4.jpg|none|thumb|50px|Skin 4]]
To give the players a starting point, add an <code>info_player_start</code>.
|}
 
Supplies area:
* health kits, usually 4 <code>weapon_first_aid_kit_spawn</code> entities
* 2 weapons; <code>weapon_smg_spawn</code> and <code>weapon_pumpshotgun_spawn</code>.
* an ammunition resupply, <code>weapon_ammo_spawn</code>
 
Now for an exit lets add a prop_door_rotating_checkpoint entity. For it's properties, name it "checkpoint_exit", set its "body" property to "1", the "Spawn Position" to "Closed" (spawnpos keyvalue 0), the "model" to "models/props_doors/checkpoint_door_01.mdl", and the uncheck the "Starts Open" flag.
 
== Rescue closets ==
Bringing dead players back into the game.  Players respawn in a random closet that only their teammates can let them out of. Respawning players come back with basic equipment and without full health. 
 
Rescue closets are fairly basic and only consist a room with containing three <code>info_survivor_rescue</code> entities with a <code>prop_door_rotating</code> to enter and exit by.
 
== The safe house and changing levels ==
Each campaign is divided into several chapters marked by safe rooms, which are checkpoints where players can heal, re-arm, and dead players can return.
* <code>prop_door_rotating_checkpoint</code>
* <code>info_landmark</code>
* <code>trigger_changelevel</code>
{{note|Make sure the <code>info_landmark</code> is named and that the landmark name is specified inside the <code>trigger_changelevel</code> settings along with the name of the next map to be loaded. Keep in mind the <code>trigger_changelevel</code> has to come in contact with the floor space inside the safe house due to how nav generation works.  The trigger brush doesn't necessarily have to overlap the floor space, but it does have to at least touch it, or a good portion of where the nav square(s) will be generated. If the <code>trigger_changelevel</code> doesn't come in contact with the floor space, you will have nav errors when the map is loaded. For the <code>prop_door_rotating_checkpoint</code>, make sure the model is set to <code>models/props_doors/checkpoint_door_02.mdl</code> and the "Starts Open" option is checked inside the "flags" tab.}}
 
== Building a navigation mesh ==
For survivor bots and infected to be able to move, you will need to create a navigation mesh ("mapname.nav" file) for your map. To build a basic mesh you need to have the map already compile and loaded, then open up the console in game and type the following:
: <code>sv_cheats 1</code>
: <code>nav_edit 1</code>
: <code>nav_mark_walkable</code>
: <code>nav_generate</code>
 
The map will be reloaded after you type nav_generate
 
After running nav_generate we no longer have the nav error message on the screen when the map loads. Lets take a look at what nav_generate did:
 
: select_with_attribute DOOR
 
Now 4 nav squares should be highlighted...
 
: select_with_attribute CHECKPOINT
: select_with_attribute RESCUE_CLOSET
: select_with_attribute ESCAPE_ROUTE

Latest revision as of 02:38, 7 January 2024

Thumbnails and image scaling.

Pixel scaling, no thumb tags, no align

Before split After split Marked first area

Thumb tags, default align

Before split
After split
Marked first area

Thumb tags, left align

Jump areas (marked with green X's) tell bots that they must jump to reach the higher connected area, and that this area is not usable as a hiding/sniping spot.
Crouch areas (marked with a blue diagonal slash) force bots to crouch when moving through this area.
Area created

Thumb tags, right align

Start dragging area at first corner
Drag area extent
Area created

Thumb tags, center align

Before split
After split
Marked first area

Thumb tags, left, center, right align

Before split
After split
Marked first area

Gallery tags

Table enclosure

Model Description

Skins

Skin 1
Skin 2
Skin 3
Skin 4