Left 4 Dead 2

Left 4 Dead 2

39 évaluations
Separating custom from original content for easy modding
De мяFunreal
There's an easy way to separate custom content from original game content. Great for when you make multiple maps at once, or just want to keep your modded files away from original files so you can easliy delete everything.
   
Récompenser
Ajouter aux favoris
Favoris
Retirer des favoris
Introduction
This guide will teach you how you can savely separate your own content for mods or maps from the original game files. It even allows you to temporarily disable those custom files to see if your packed vpk file really contains everything the workshop subscribers need.

When you make mods or maps for a source engine game that has custom content in it you must somehow add it to the game files. Most people just put the files into the main game folder along with all other files from the game, which is a bad idea.
Because sooner or later you will make another piece of content and forget that you added content that is not native to the game and you will end up releasing a mod or map that has missing content.

Or the other problem you could run into is that you are aware that you have custom content and you want to get rid of the files, but you don't want to go through all the game files to search for those custom files and delete them individually.
Creating the custom content folders
The first thing you need to do is go to your basic game folder where you can see the DLC folders.
Once you are there, you can simply create a folder with a name of your choice. It is best to name a folder "mods" for general mod files while campaign and map folders should be specifically named after each map and campaign. That way content from one map cannot be mixed with that of another.

in the screenshot below i highlighted my custom folders in blue.
Making the game use the folder.
Once you have added the folders themselves you must also edit the gameinfo.txt file so that the game will see the folders and load files from it.
Garry's mod uses Mount.cfg to load date instead.

The gameinfo.txt file can be found in the subfolder of the basic game folder.
Steam\SteamApps\common\left 4 dead 2\left4dead2

Open the gameinfo.txt and add your own folders to the list.
All folders before the "update" folder have higher priority over the original game files, but the game will not prefer loose files in those folders over the pak01_dir.vpk files of any of the other folders.
But you could make your own pak01_dir.vpk files in your new folders listed above the "update" entry. This will make the game prefer those files over anything, besides installed addons.

In the screenshot below is an example of my gameinfo.txt with custom folders highlighted.
The lines that begin with // will be ignored, so that the game will not read files from that folder.
.

Once you are done with your mod or map, or just want to work on another map so you need to disable your current custom content, you can either edit the gameinfo.txt to comment out an entry by adding // at the front of the lines like i did, or rename the content folder.
Making Gmod use the folder.
Garry's Mod does not use the gameinfo.txt for mounting, it uses "Mount.cfg instead"

Gmod's Mount.cfg is in
garrysmod\cfg
Just add your folders like this.


Making crowbar compile to Gmod still requires the gameinfo in that custom content folder though.
Making Crowbar use the folder
I myself like to keep my compiled models and all the stuff that belongs to them in a "mods" folder that I can clear out every once in a while. But you need to do one more thing so that Crowbar will compile models for that folder.

First you need to have a gameinfo.txt in that "mods" folder. But you do not need to update that gameinfo.txt when you add or remove folders. Crowbar just needs that file to be present.
You can simply copy the one you modified earlier into this folder.
.

Then you need to add a new game entry to crowbar so that is will compile to your mods folder, instead of your main game folder where the original files are.
The "gameinfo.txt" field in crowbars "Set Up Games" tab is used to determine where your content will be moved after compiling. Select your new "mods" folder for the gameinfo.txt location and you are done. Save your settings and use that game when you compile models for L4D2. Or any other source engine game you would like.
17 commentaires
мяFunreal  [créateur] 30 nov. à 6h07 
No, Hl2 still uses this setup here. But you'll need to edit every gameinfo for all the parts of the game.
Majka 30 nov. à 6h00 
Will HL2 be the same as for Gmod?
мяFunreal  [créateur] 3 mai à 4h22 
Audio caches only need to be rebuilt if you edit audio in a way that would warrant it in the first place. Like making sounds with different lengths. that requires a soundcache.

But simply having this folder is not enough to require new soundcaches.
DimTheEnderman 2 mai à 16h36 
Will I have to rebuild the audio cache if I am changing audio files using this method?
мяFunreal  [créateur] 2 mai à 16h18 
Yep. You're essentially just adding another dlc folder, except it isn't a real dlc.
so all the paths inside must remain.
DimTheEnderman 2 mai à 16h14 
Ok and with the "mods" folder do I make the subfolders the same way I would a regular vpk addon? Like in my case im trying to change tank_metal.wav, do I still do it like "mods/sound/music/tank/tank_metal.wav"?
мяFunreal  [créateur] 2 mai à 16h01 
l4d2 only ready the main gameinfo in "left 4 dead 2/left4dead2"
DimTheEnderman 2 mai à 14h17 
Do I edit the gameinfo file fo the specific DLC folder I want to change or do I only edit the main one?
DimTheEnderman 2 mai à 14h03 
Damn it Valve, why must you make such simple things so difficult
мяFunreal  [créateur] 8 janv. à 15h04 
download th eL4D2 authoring tools from the steam library.