On the Blender Source Tools steam group page, click the Download the Blender Source Tools link at the right. Do NOT unzip this file.
Select File > User Preferences... menu item
Click the Addons button in the bar at the top
Click the Install From File... button at the bottom
Find and select the downloaded zip file
Click the Install From File... button near the upper right
Click the User button in the Categories at the left (to filter the list to user-made addons
Tick the check-box for Import-Export: Blender Source Tools. Wait a moment for activation to complete.
Click Save User Settings button at the bottom
So before we all jump into the exciting world of L4D2 modding we will all need some resources to get things rolling.
First ingredient will be a starter kit.
The Starter Kits can be found within
L4D2 Authoring Tools > Example Content
or inside the following folder
*\Steam\SteamApps\common\Left 4 Dead 2\sdk_content
After opening the Zip file, navigate to: Starter Kits > Melee Now select a folder of the melee weapon of your choice and copy it to the desktop.
Now on to the second step, the decompiling of the Reference SMD files
Head on to your L4D2 directory
Steam\SteamApps\common\Left 4 Dead 2\
Open the folder called
Steam\SteamApps\common\Left 4 Dead 2\left4dead2
Locate pak01_dir.vpk and open it with GCFScape
Now navigate inside GCFScape to the folder
Models > weapons > melee
Copy the V_ and W_ files of the weapon you chose in the starter kits.
So for me I will be needing:
Paste the files into the starter kit's models\weapons\melee Folder you have on the desktop.
Now with this extracted content in your grasp, drag the MDL files (one at a time) to Crowbar.
From here name the sub-folder whatever you like
I suggest naming the folders
VIEW for the v_.MDL
WORLD for the w_.MDL
Then click the Decompile MDL File button
Open the VIEW and WORLD folders
Copy the _Reference.SMD to the Compiling Files Folder
Delete VIEW and WORLD folders and files used to create them. You should be left with only the Compiling Files Folder.
Your "Compiling Files" folder should look something like the image to the right.
And lastly, let's top it off with a touch of modifications to the Addoninfo.TXT file
To obtain this file please go back to the TOOLS NEEDED step of this tutorial and try again. If you're here already prepared, have a cupcake and feel good about your focusing abilities.
You will need to have the Addoninfo.txt in the base of the starter kit folder. So for me I will have this
AddonTitle "MOD's NAME"
AddonDescription "A mod that does something"
AddonAuthor "YOUR NAME or USERNAME"
AddonAuthorSteamID "YOUR STEAM USERNAME"
AddonURL0 "MOD'S WEBSITE OR AUTHOR'S PROFILE"
Because I'm doing a custom melee model for the machete I will be adding a 1 to AddonContent_WeaponModel. The result of the Addoninfo.txt should look like what's below
AddonTitle "Machete Mod"
AddonDescription "A mod that replaces the machete model"
Obtaining a Custom Model
At this point you can use a custom-made model or grab one from a web page in corners of the internet somewhere. I assume you have familiarized yourself with the basic concepts of 3D modeling, so for the sake of this tutorial we’re not going to cross that bridge.
Where you get the model doesn’t really matter ultimately as long as you have permission and not making profit on others' work…basically any format your 3D program can import is just dandy.
So for now, I’ll just go with the first site to keep things simple. Looking around, I see some nifty weapons from Injustice: A God Among Us; they all have OBJ files and have very nice normal and specularity maps. All that equals WIN.
You'll have a nifty couple of popup windows. Just hit yes to the replacing of the original file. Now on the HL2 SMD Exporter you will need to make sure the "Reference" option is checked before exporting
It time to test that memory of yours.
Oɴᴛᴏ ᴛᴏ ᴛʜᴇ Vɪᴇᴡ ᴍᴏᴅᴇʟ!!!
Like the world model start by importing the Reference.smd for the view model.
"This is helpful for gun rigs and survivor models"
In this case it seems that the whole mesh is weighted to ValveBiped.weapon_bone
Let's check to see if the Mace has adopted the new weights proper.
Everything seems to be in order and behaving properly, but lets say it wasn't.
In comes the Good trusty Weight Tool. You'll need to select the bone first then highlight the desired vertices you wish for that bone to control
For the purpose of this tutorial we need all the vertices need to be set to 1 on the ValveBiped.weapon_bone.
And here we are back at full circle replacing the reference model we started out using for all of this.
Ah yes the memories we have made.
■ Importing Mace
■ Importing Reference.smd
■ Lining and scaling up the Mace's Mesh to the Reference Mesh
■ Adding a Skin Wrap to the Mace
■ Adding weights from Reference to Mace
■ Converting it to a Skin
■ Deleting the Skin Wrap and reference
■ And finally saving the project and exporting the mace over the Reference.smd
good times, good times. :)
So before we begin, just a fair warning if you plan on asking questions.
I started teaching myself blender during the making of this tutorial, so please direct questions to the following Steam Group.
From here you'll need to replace the following with the paths of the W_reference.smd
$body is used to add a reference mesh to a model. Without at least one $body the model will be invisible (exception: models with facial animation use $model instead).
So in simpler terms. This will be the model you'll be seeing in game.
Most commonly static props have 1 sequence named "$sequence Idle", so FYI for future use.
All models must have at least one $sequence. If you don't actually want any movement, it's easiest to re-use your reference SMD.
This command is to tell the game what the boundaries are of the model. Some people tend to call this the Hitbox model for characters models. For this tutorial we can do a few shortcuts and simply use the reference model as the collision mesh. But later down the road it tends to be more professional and better on the rendering of the game engine to have a low-res model in place of the collision model.
For those that aren't following, the results should be something like this
So ya..."that's a ♥♥♥♥♥♥♥♥ of code for a begginer" you may be thinking. However at this current point all we're worried about is replacing the Reference.
$body "Body" "dmx\Machete_ref.dmx"
$body "Body" "v_machete_reference.smd"
You see it wasn't all that bad. Just remember a v_model is just a reference with alot of animation information in it.
Now currently the texture paths for this machete mod are at it's default location $cdmaterials models\weapons\melee\
This means a series of folders will need to be made in the Machete project folder on your desktop in this structure "Materials/models/weapons/melee"
$cdmaterials defines the folders in which the game will search for the model's materials (subfolders are not searched). Each path is relative to <game>\materials\.
Now you are welcome to alter this path to your choosing but to avoid confusion I will leave it at it's default.
Drag each QC onto Crowbar
(only drag one at a time)
First off click the following button ^--not this one, but rather the one in the program
Proceed by choosing Left 4 Dead 2 as the game Next adjust the l4d2 directories to find gameinfo.txt and studiomdl.exe
For me I have my game on my D:\ DRIVE.
This step is pretty straight forward
If all the moons and stars align, you should be granted with the holy message
Navigate to the following folder
\Steam\SteamApps\common\Left 4 Dead 2\left4dead2\models\Weapons\melee
You should be seeing a series of files with the name of the weapon you're replacing.
Simply move these files into the project folder. If your attention span is firing you should be noticing the folder structure you grabbed these files from is a lot like the folder you will be putting these files into.
Open base texture in VTFedit
A quick note. The standard and usually the best Format to have is DXT5 It supports transparency and has a lower file size with hardly any distortion
If you model has no transparency(Alpha) on the base model feel to use the DXT1 Format
Save in Materials/models/melee under same name of it's original file.
So in my case I will be naming my TGA image into a VTF with the exact name
Open Normal map in gimp ....I hope I'm not needed to explain this step
Drag specularity map in a layer over normal map
In most case Specularity maps are grey-scaled version of the base texture with spots highlighted to tell the game how much brightness and shiny each part of the texture need to be when light hits it. the whiter the brighter
Export as vtf (NOT SAVE....just EXPORT)
And sense we're making a texture with multiple layers you'll need this to be set on DXT5
You will need to have the bump option on.
Set "Use Layer as Alpha Channel:" to the specularity map.
Everything else is optional, but usually my favorite setup is what's on the image to the left
If you exported everything right and reopen the vtf in GIMP you should see a setup with a normal texture with a mask layer over it.
Open base texture back up in vtfedit
In the menu bar Click "Create VMT File"
In the Textures tab you should have the base texture set.
Click the "..." on the Bump Map 1 and find the bump map texture
Now click on in the Options Tab
Change Shader to "VertexlitGeneric"
If this isn't selected chances are you will have an invisible texture ingame
Well Here we are with all materials at hand and ready to test.
You could just copy the materials and models folders to the "Left 4 Dead 2/left4dead" folder, but luckily for us we have the power of the mighty VPK file format.
To do this you will need to get a hold of the VPK.exe within
*\Steam\SteamApps\common\Left 4 Dead 2\bin
I suggest making a shortcut to this program on your desktop.
Now comes the magic.....Are you ready Mr Krabs!?!?! drag the the project folder onto the vpk.exe
HOT SHIITAKE!!!! We Have the power He-man
Place that bad boy into the following folder
*\Steam\SteamApps\common\Left 4 Dead 2\left4dead2\addons
So here we are at last my pupil. My how we have grown and got through this all. All that seems to be now is tidying up and sending you off. *manly tears*
So allow me to give you a few Protips.
Rename project folder something like "Machete - Hawkgirl's Mace"
This is just for easy organizing and helps if you ever need to make another VPk and feel to lazy to rename every Vpk after it's creation"
Delete or Move "Compiling Files" Folder
This is just to help save all that precious cloud space and nobody likes to download files they don't need.