1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Left 4 Dead 2 resources & commands

Discussion in 'Tools & Guides' started by detritus, Apr 13, 2012.

  1. detritus

    detritus angry angry Staff Member Administrator

    Nov 23, 2009
    Likes Received:
    Hey there,

    This guide is a WIP so it will be added to bit by bit.

    Awhile back, I made a few videos of Zoey from L4D and L4D2 and I had a lot of people asking me about the console commands I used and if I could put up my skin for download.

    When I originally made Raver Trash Zoey, skins weren't really "drop in" so you had to be familiar with the file structure and file types of the Source Engine and all that. L4D2 has an addon system which makes using them much simpler. Thought I'd write up a little guide about L4D2 resource extraction, console commands, and just general modding info I've picked up while making my Zoey skin. Pretty much everything from the first game has been moved over into L4D2 so I won't cover L4D1.

    GCFScape and VTFEdit were more of a necessity when modding/ripping L4D1 but you still find uses for them. You can find them over at Nem's Tools [Home - News]

    I would suggest grabbing the L4D2 Authoring Tools on Steam as well. There's a program in particular that comes in handy (vpk.exe) included in there that you will use to both extract resources and to pack your skins or other mods into an easily shareable addon file. You can download this on Steam by going to the Library window and on the right side of the search bar (although I suppose this might be in a different place depending on Steam skins), change the drop down to Tools, and find it in the list there and install it.

    File types
    vpk - Valve pack file, these can contain game resources or resources for a single addon
    vtf - Valve texture file, these are the actual textures used by the game. If you're skinning, these are of interest to you
    vmt - Valve material file, these are basic text files that contain information on how to handle textures and other parameters
    Handy console commands
    These can be punched in from the console. You will have to enable this in the game's control options otherwise you can't get to it. The default key for it is the tilde key. That one above Tab that's got the squiggly.
    sv_cheats 1 // This enables most of the commands that are of interest to you
    map blah // Use the map command to load a specific map. Replace blah with the map name. The map names start with c and a number, m and a number (c for campaign, m for map), an underscore, and then the section of the map.  For example: c8m1_apartments is the first campaign from L4D1 (No Mercy). If you just type in map and a space, the console actually has an autocomplete function that will let you scroll through the possible maps with the up and down arrow keys
    god 1 // Makes survivors immune to damage
    host_timescale x // Set the timescale. 1 is 100% = default speed. 4 is 400% = 4 times faster than normal. 0.5 is 50% = 1/2 speed
    sb_move 0 // This prevents the survivors from moving
    sb_dont_shoot 1 // This prevents the survivors from firing their weapons
    sb_dont_bash 1 // This prevents the survivors from meleeing
    give blah // Gives "blah" to a survivor. This can be an item or weapon
    ent_create blah // Spawns a "blah" at your cursor. This can be an item or weapon
    // Here's a short list of things you can give/create
    warp_all_survivors_here // This will teleport all the survivors (including you, if you're playing as one) to where your crosshair is pointing
    warp_far_survivor_here // This will teleport the survivor furthest away from you to where your crosshair is pointing
    ent_remove // Be careful using this command, it can essentially erase any entity (object) from the game world. The best way to explain the behavior of this is imagining you have a gun that fires bullets that will erase things from existence. The first thing in your line of sight it hits will be gone. This includes survivors/zombies. It is possible to erase your own character with this command so don't hit yourself in the foot with it. If this happens, you can reload the map or just restart the game
    Handy launch options
    You can add these by going to the Steam Library window, right clicking L4D2, click properties, then clicking the "SET LAUNCH OPTIONS..." button. You can enter these in any order.
    -novid // Skips the Valve intro logo
    -nointro // Skips the game specific intro movie
    // I find those two help get you into the game quicker to test how skins look in game. If you're particularly obsessive and jump in and out of the game a lot, put these in for sure
  2. ghostlion88

    ghostlion88 Potential Patron

    May 13, 2012
    Likes Received:
    lol I just went into my L4D2 folder in program files and deleted the Valve logo. The game just skips over automatically and that's a few megabytes free on your hard drive ^_^ For now I'm leaving the main intro movie because I like it, but I might delete it if I have to since there's always youtube.

    I did the same with BR2: deleted a bunch of the movies. The games still run with no problem, and are slightly quicker. Mainly I do that to free up hard drive space because I am always running out, what with all the photoshop files and games installed (only L4D2, Serious Sam 2, BR2 and RE4 at the moment, but they take up a lot!!)

    btw Is there any way to disable special infected from ever spawning? I would like to be able to do that from time to time for testing purposes and especially while playing through the Silent Hill map for the first time since it's so confusing and you backtrack so much and there is no ammo or health anywhere. I know there is the "kick" command. (kick boomer, tank, smoker, etc), but that is annoying.

    Or perhaps there is a way to disable incapacitation? That would be ideal.
    Last edited by a moderator: May 13, 2012
  3. detritus

    detritus angry angry Staff Member Administrator

    Nov 23, 2009
    Likes Received:
    Not sure what you mean by "disable incapacitation"? Using "god 1" will prevent most everything. I'll dig around the console commands about disabling the special infected spawns though.

    ---------- Post added at 10:30 PM ---------- Previous post was at 10:24 PM ----------

    Try "director_stop" as soon as the map loads and see if that works. This won't despawn special infected that are statically placed on the map, but will prevent the AI from spawning additional. If you see static spawns, you can always bind a key to "ent_remove" and just zap them out of existence.