Custom Tank

This tutorial teaches you to create your own non-default-replacement tank skins and how to add them to your campaign.

Creating your Tank Model

Considering you know how to create/decompile/compile models, make your alternative Tank model. To make it an alternative, non-default-replacement Tank, set the model name to something else other then hulk (default) or hulk_dlc3 (The Sacrifice alternative). I'll call mine hulk_max01. You should probably use an alternative set of textures (I'll also consider you know how to do this), not replacing the default ones.

Compile your model using studiomdl. For some reason the models compiled by the L4D2 studiomdl are sometimes compiled in L4D1 folder, so if you can't find the models where they were supposed to be (common/left 4 dead 2/left4dead2/models/infected), search L4D1 folder (common/left 4 dead/left4dead/models/infected).

Create a models folder in your addon folder. Create a sub-folder called infected. Place the newly compiled files (.dx90.vtx, .mdl, .phy and .vvd).

If you get a consistency problem with your model, check if the model isn't exceeding mins or maxs. If this is the case, add the following line in the .qc file $bbox -16.0 -16.0 -13.0 16.0 16.0 75.0. This line will properly set the bounding box for the Tank.

Creating your Missions File

Now, to use your Tank model, not replacing the default skin, you must properly set your missions file.

Considering you know how to make a missions file, it should be set like this:

"modes"
{

@"coop"
@{

@@"1"
@@{

@@@"Map" "max03cp01_apartments"
@@@"DisplayName"
@@@"The Apartments"
@@@"Image" "maps/max03cp01"
@@@"TankVariant" "models/infected/hulk_max01.mdl"

@@}
@@"2"
@@{

@@@"Map" "max03cp02_sewers"
@@@"DisplayName"
@@@"The Sewers"
@@@"Image" "maps/max03cp02"
@@@"TankVariant" "models/infected/hulk_max01.mdl"

@@}
@@

@}

}

You simply have to add the line "TankVariant" "models/infected/<yourtankmodelname>.mdl" at the end of each chapter setup. This way, all Tanks on the chapter will use that skin. You can use a different skin for each map if you want. If you want to have the default Tank skin on a map, simply do not add the line to the that chapter setup.

As of now, there is no way to have two different Tank skins on the same chapter, but this could change in the future.

Creating your Addoninfo File

To make sure everything goes according to plan, on your addoninfo.txt file, set addonContent_BossInfected to 1.