Left 4 Dead

Left 4 Dead

Not enough ratings
How to Mod Left 4 Dead
By vollerei
This guide will allow you to completely modify Left 4 Dead to your liking. It also includes a new method, so new mods will not weigh an additional 1 GB.
   
Award
Favorite
Favorited
Unfavorite
Welcome to my first guide
This guide aims to explain to the casual user how to mod Left 4 Dead 1 (not Left 4 Dead 2), just as Left 4 Dead 2. To start, in L4D1, we can't use the traditional add-on system that's implemented, but we can use the gameinfo.txt system, which will allow us to load our custom mod. This guide has a new method that will also allow L4D1 to fall back to the original materials/content if one from your mod is missing or the Source Engine can't load the right files for anything you have modified.
Prerequisites / Requirements
You will need to have:
  • A working Windows or Linux computer (sorry, don't own anything Apple-related, and I'm not sure how it would work on there)
  • GCFScape installed - Download[nemstools.github.io]
  • Crowbar installed - Download[github.com]
  • Have Left 4 Dead and Left 4 Dead Dedicated Server
  • Have Left 4 Dead Authoring Tools installed too.

You might also need (in case):
  • nekomdl - will be required for models that use large vertices, or models that cause the default studiomdl to exit with: "ERROR: 'EXCEPTION_ACCESS_VIOLATION' (assert: 1)"
Chapter 1
Setting Up Left 4 Dead
If we installed everything, you can continue reading this chapter. Go to your Steam Library and search for "Left 4 Dead"


Press the cogwheel here...


...and click on "Manage"...


then select "Browse local files" option.


Getting files ready for Left 4 Dead
Please ignore that I'm on Linux, as there should be no difference between doing this on Windows

We are in the local files of Left 4 Dead, and it should look something like this:

Go into the second left4dead folder, then locate pak01_dir.vpk.


Double-click pak01_dir.vpk to open it with GCFScape.


Once you have GCFScape open, go back to the previous folder, like so:

Right-click, then select Create New Folder.
Name your folder "l4d_aseets" or anything of your choosing, just remember that folder will contain the default L4D1 assets, and the game will fallback on that folder if anything goes missing from your mod that the game requires. (Linux users: Click Create on the Create New Folder box)

We have created our fallback folder, but we are not fully done yet! We need to go back to GCFScape, and click on "materials", "models", "particles", then right-click and select "Extract".
You will need to check where Steam has installed Left 4 Dead on your computer, copy the path, and make it match what is seen in the File name box.


Telling Left 4 Dead to not load pak01_dir.vpk
Now that we have a l4d_assets (this guide assumes your folder is also called l4d_assets), but the game will override that folder if you have "pak01_dir.vpk" still intact. So, for backup purposes, unless you mess up something very badly, you will need to rename the file to something that the game will make it not load.


Here comes my mod
The game will not load "pak01_dir.vpk", allowing you to fully modify the game, meanwhile having a fallback option if you somehow mess up with your mod. Go back to the first "left4dead" folder, then create a folder for your mod to be named as (IMPORTANT: The name you gave to the folder will also be used in gameinfo.txt, but more on that a bit later. Make sure the name you gave can't use any special characters or spaces. English alphabet and numbers only).

You now have a mod folder where you can place your custom materials, models, sounds, and everything. Your limitation is your imagination and creativity.

Making sure my mod will not crash on startup
Great, now you have the folder for your custom mod, but the game will still not load it and will crash on startup. This can be resolved by adding your custom mod and l4d_assets to gameinfo.txt.

Press Enter, then press tab, now enter "Game" then press Tab again, and enter "mymod_example". Your gameinfo.txt file should look like this:


Now the game will load your mod properly. You can now move on to the difficult part, getting the custom player models to work from L4D2 to work in L4D with the correct animation sequence (more about it later in the appropriate chapter).
Chapter 2
Lazy Work, Lazy Me (Not Recommended)
If you only want a complete Single-player experience, where not even your Friends can play with you on your local server or any dedicated server, you can continue on this Chapter; otherwise, please skip this chapter.

If an L4D2 model is made for the L4D1 survivors, you can simply copy the models from the addon itself using GCFScape into your custom mod.
However, this will only allow you to play on a local server, where only you with the mod can play. So if you were to play on a dedicated server or a friend joins your local server, the survivors' animation sequence no longer matches, causing the survivors to play weird animations or T-pose for them.

Getting Files ready for your use
Crowbar is a tool we will use for decompiling and compiling. This guide will assume you have also installed Left 4 Dead Authoring Tools, and if you don't have it installed, install it now.





Open it with any archiver that supports .7z



Introduction to Crowbar
After opening up Crowbar, make sure the "Set Up Games" tab looks like this:
Keep in mind that by default, Crowbar will set the games to the default Steam library folder; only change them if Left 4 Dead isn't in the default Steam library folder (if Left 4 Dead is on another hard drive or on a different path than steamapps).



If you're sure, go back to your "mymod_example_files" folder, then create a "decompiled", "compiled", and "raw" folders. The "raw" folder will contain the model you obtained from the L4D2 workshop (WITH permission from the model author).



Obtaining the L4D2 model from the workshop (purchased L4D2)
You can use any Left 4 Dead 2 or Left 4 Dead survivor from Left 4 Dead 2, as mostly models usually use Zoey's animations for proportions, but a model can also use it's own survivor animations (for example Francis uses his own animations .etc etc). For this example, we will use Lenna (Energetic Magic) [Girls' Frontline 2] : Rochelle from the Steam Workshop. We will create a 4-survivor pack while only using this model (the steps for making it as a single survivor replacement mod will not differ, as you will not need to include the model replacement for every survivor) for easier demonstration.

In this case, the "Shared Assets" will contain the materials for the model, since it's required, you are also required to download that workshop item too. Usually, these models come with their own materials included, but some workshoppers like to make them as a different workshop item.


Obtaining the L4D2 model via SteamCMD - not recommended


If you, for whatever reason, don't own L4D2 and still want to download the example model, you can do so via a tool called SteamCMD. It's mainly used for game servers, but you should also have SteamCMD included (unless you directly downloaded the Dedicated Server via Steam).

Get the model's workshop id (3554511117) then obtain the shared assets (materials)'s workshop id: (3554496496)

./steamcmd.sh +login anonymous +workshop_download_item 550 3554511117 ./steamcmd.sh +login anonymous +workshop_download_item 550 3554496496

OR If you are on Windows:
steamcmd.exe +login anonymous +workshop_download_item 550 3554511117 steamcmd.exe +login anonymous +workshop_download_item 550 3554496496
Keep in mind that SteamCMD might not work in your case, as SteamCMD can't download files higher than 1 GB

Unpacking the VPK downloaded from the workshop
To get the VPK, you need to start up Left 4 Dead 2, then wait for the game to download the VPKs (this is usually indicated by the loading spinner before the Addons menu text).


If the loading spinner has disappeared, click on it and check if the required addons are there.


If the add-ons are indeed installed, it's safe to close the game and click on Steam (and follow the steps below).



Unpacking via Crowbar
Click on Unpack.


Unpacking the VPK downloaded from the workshop (continues)
If you unpacked the vpk correctly, your folder should have a models and materials folder along with the addons vpk file.
Chapter 3
Decompiling using Crowbar
The model files are there, but it's still not enough to make it work for Left 4 Dead. You will need to modify the model to correct the animation sequence (by removing all L4D2 animations and replacing them with the L4D1 original animations; you shouldn't decompile the animation models, as Crowbar will not recompile them)

Go to the Decompile tab, and change every tickbox until it matches the screenshot, then click on "Decompile".

This will decompile the model, and we are now halfway done with this process. In the "decompiled" folder, we now have the required files to recompile the model into Left 4 Dead.


Updating .QC file to match with the Left 4 Dead survivors
The survivor_producer.qc file tells the game how to load or manage the model. Left 4 Dead doesn't have Producer (Rochelle) as a survivor; nothing will be changed.

In order to get the model to replace one of the Left 4 Dead survivor, you will need to use one of:

  • survivor_teenangst (Zoey)
  • survivor_namvet (Bill)
  • survivor_biker (Francis)
  • survivor_manager (Louis)

We will replace all survivors in this example pack with the same survivor model for easier demonstration. You will need to rename any references to survivor_producer. For example, if you want to replace Zoey, you will need to rename survivor_producer to survivor_teenangst. I will replace Producer (Rochelle) with Bill in this example first, but you are not required to replace Bill immediately; you can replace any survivor with anyone you want.


Double-click on now renamed survivor_namvet.qc, which should bring up your default text editor (Use Notepad++ if you're on Windows). You will need to use Find and Replace to quickly rename every reference from Rochelle to Bill.


Removing L4D2 animations
The model will replace Bill, but what about the animations? Both survivor_namvet.qc and survivor_namvet_DeclareSequence.qci contain references to animations Left 4 Dead doesn't have; you will need to remove them. It's important to check what animation models are being imported into the model, but mostly, you will need to use Zoey's animations unless the model uses its own survivor's animation.

If the model gets compiled now, the game will try to load Zoey's animation, then Rochelle's animation, since Rochelle's animation doesn't exist in Left 4 Dead, this will end up namvet T-posing or the wrong animation will play. We will need to keep Zoey's animation due to proportion.

You will need to replace $includemodel to include these:
$include "namvet_fixDeclareSequence.qci" $includemodel "survivors/anim_teenangst.mdl" $includemodel "survivors/anim_namvet.mdl" $includemodel "survivors/gestures_namvet.mdl"


What is $include "namvet_fixDeclareSequence.qci"?
By default, L4D will load Zoey's animation, then Namvet's animation, overriding Bill's animations with Zoey's, which causes the survivor to play the wrong animation or just T-pose. That file will fix this issue, as Zoey's animation will align with Bill's animation set.

You can download namvet_fixDeclareSequence.qci and other animation fixes for other survivors here:
Zoey animations on Bill[drive.google.com]
Zoey animations on Francis[drive.google.com]
Zoey animations on Louis[drive.google.com]
The Entire Collection[drive.google.com]



You will also see a lot of $declaresequence with spaces between them; those are the L4D2 animations for the model, you are not gonna need those.


If you removed those sequences from the model, it should look like this:


If that's how the sequences look, you can safely save the file and close it for now. It's now time to modify survivor_namvet_DeclareSequence.qci. The .qci file also contains L4D2 animations and other animations we won't need to make the animation fix work.


You will need to remove everything starting from "Idle_Standing_Align" up until "g_Namvet_Wave". This is how it should look:


Re-open survivor_namvet.qc and comment out the "CustomModel" sequence.


If you are replacing other survivors
The steps for making the model for other survivors are relatively the same; however, the animation sequences are the only difference. Here are the screenshots for the different survivors:

Replacing to Francis
survivor_biker.qc:


survivor_biker_DeclareSequence.qci:



Replacing to Louis
survivor_manager.qc:


survivor_manager_DeclareSequence.qci:



Replacing to Zoey
Since every model uses Zoey's animation, we won't need teenangst_fixDeclareSequence.qci (or for other survivors that use it's own animation set and doesn't rely on Zoey's animation set).

survivor_teenangst.qc:


survivor_teenangst_DeclareSequence.qci:
Chapter 4
Compiling
Once you are finished with the model, open up Crowbar, then go to "Compile" tab, and select "Compile". You may want to use nekomdl for compiling the models but the default studiomdl included can also compile the models fine. However, if the default studiomdl fails or corrupts the model completely, you will need to use nekomdl instead.

Using nekomdl
Go to nekomdl v2.3.0[drive.google.com] and download the file (it's safe as it's extracted from the nekomdl addon zip). Open up Steam, locate Left 4 Dead, press on the cogwheel, select Manage, then Browse local files.


If you want to switch between the two model compilers, rename the included studiomdl to studiomdl.exe_org or to something else you definitely know is the original studiomdl.



Now go to the original location where you downloaded the exe file, copy it to left 4 dead/bin.


Moving files to correct paths
If you successfully compiled the model, these two folders should appear in the compiled folder. You will need to check the compiler logs if you miss any models/files from those folders. Follow the steps shown in the screenshots below.





Click on "mymod_example" folder...



...then paste the "model" folder there.


Moving materials to correct paths
The model will need the materials to load the textures. If you don't do this, the model will have the missing texture (the pink-black checkerboard).


If you did correctly paste the folder, the models, and materials folder should appear in your mods root directory (mymod_example).

Getting the Dedicated Server Ready
To truly test if our model is using the correct animations, listen servers (such as singleplayer servers) will NOT work. Go to the folder where you have the Dedicated Server installed, then write this in left4dead/cfg/server.cfg:
sv_cheats 1 director_no_survivor_bots 1 director_stop

When the server starts, the above config file will prevent the director from starting which prevents spawning zombies, and it will disable survivor bots so you would be the only player, and truly alone.

If you installed the Dedicated Server via on linux, you will have to invoke
./srcds_run
in the terminal where the L4D SRCDS is.

If you installed it via Windows, and want to use the command line, you will have to type
srcds.exe -console -game left4dead +map l4d_hospital01_ apartment
into command prompt in the same location as L4D SRCDS.

If you see this, you are now running a Dedicated Server, and you can test the model's animation matching with the default Left 4 Dead's survivor-specific animations.

Testing Animations In-Game
By default, Left 4 Dead will not gonna connect to the local dedicated server; we will need to tell the game to do so. You can do this by going to Left 4 Dead in the Steam library, clicking on the cogwheel, then selecting "Properties..."


The 192.168.1.83:27015 after +mm_dedicated_force_servers variable is a LAN IP address, meaning it will only work on my home internet; everyone has different routers and different internet, so the LAN IP address (192.168.1.83 in this case) differs. You can check what the dedicated server's IP address is by starting the game, enabling the developer console, then invoking it, typing: openserverbrowser, then clicking on the "LAN" tab, clicking on "Servers (1)", then checking "IP address". You will need to replace 192.168.1.83:27015 with what's shown under the "IP Address" table. For example, your dedicated server may run on 192.168.0.43:27015 or 192.168.0.43:27016 if you launched the server while your game is running.


Open up Left 4 Dead, select "Play Campaign", then choose "Play with Friends".


Once you're at the "All joinable games found" screen, click on "Create Lobby".

On the "Game Settings: Friends-Only Game" screen, make sure the server type is "Best Available Dedicated", then press "Create Lobby".

On the "Campaign Lobby" screen, press "Start The Game".


Once you're in-game, invoke the developer console, then type cl_showanimstate 1. This will reveal the animation state for the current player/survivor.
Congratulations
You have now learned how to port models from Left 4 Dead 2 to Left 4 Dead. Here is a screenshot of your achievement if everything is correctly set up. Don't worry if something doesn't work the first time.

As a thank you for your time for reading this, you can download the models used in this guide:
Click Me[drive.google.com]
2 Comments
vollerei  [author] 29 Aug @ 11:10am 
@MegUm1n4!K, ur welcome, keep in mind the animation fix is 99.5%, as there are still some animation bugs left 2 figure out (it's very minor and will not disrupt the gameplay)

this guide is made so that other people can port their model to Left 4 Dead, but it doesn't include a first-person model due to that will require extra work, and it's sum i haven't figured out yet.
MegUm1n4!K 28 Aug @ 6:57pm 
finally! i can compile a model for this game! thanks!:necroheart: