Welcome, gamers and creators! In this guide, we will be exploring how to easily port L4D2 models into Gmod. You may have noticed that there is no existing guide for this process on the internet, so I have taken it upon myself to create one for you all. The best part? No L4D2 is required! I have spent a week compiling all the necessary information for this guide, so let’s get started.
**Note and things to know**
So, This guide may be hard to follow or do for some starters but just to know that it’s easier than you thinks.. I tried my best to make the guide easy as possible so don’t worry. sit back & relax π
One more thing, DO NOT UPLOAD THE MODEL YOU PORTED TO GMOD WORKSHOP OPR I’LL @#%! YOU.! (I mean you’ll get hated.. Get it? only for personal use.)
**Required tools & items**
You’ll need two diffrent versions of blender (one for proportion & one for physic mesh)
Blender : Essential for most steps
Link : https://www.blender.org/ (Download the latest version).
Blender 2.79 : Essential for proportion trick
Link : https://www.blender.org/download/releases/2-79/
GCFScape : To extract vpk. files
Link : https://nemstools.github.io/pages/GCFScape-Download.html
Crowbar : For complie & decomplie
Link : https://steamcommunity.com/groups/CrowbarTool
Notepad++ : To edit Qc. & Lua. (Contains advanced features and easy to use for editing)
Link : https://notepad-plus-plus.org/downloads/
Template : Essential for most steps (Contains Qc. Physic mesh & Plugins)
Link : https://drive.google.com/file/d/1fc3SannS-sG032sbfw-5T0nmAIw-owTh/view?usp=sharing
Model Complier Replacement : For heavy models with a lot of vertices (Very useful!)
Link : https://drive.google.com/file/d/1fc3SannS-sG032sbfw-5T0nmAIw-owTh/view?usp=sharing
Make sure to download all of them!!!
**Preparing & Setting up**
Step 2: Go to “Set up games”.
Step 3: You’ll see like this
Step 4: Choose the game “Garry’s Mod” or add a new game and change the name to “Garry’s Mod”.
Step 5: Go ahead and set the require paths for specific items.
Step 5.1: Engine : Source
Step 5.2: Executable (exe.) Your gmod exe.
E:\ or C:)Steam\steamapps\common\GarrysMod\hl2.exe
Step 5.3: gameinfo.txt
E:\ or C:\Steam\steamapps\common\GarrysMod\garrysmod\gameinfo.txt
Step 5.4: Complier / Viewer / Mapping & Packer
[]
E:\ or C:\Steam\steamapps\common\GarrysMod\bin\
Step 6: Go to “Complie” tab.
Step 7: Choose “Garry’s Mod” on game that has the model complier.
Step 8: Now, We’re done for crowbar.
Now, We’ll be replacing the complier with custom one for heavy models with alot of vertices ’cause most of l4d2 models from workshop used alot of vertices but you don’t have to if you don’t want.
Step 1: Go to the “depend pack.7z”
Step 2: Extract it.
Step 3: Go into the folder, Copy all of the files & put them into :
E:\ or C:\Steam\steamapps\common\GarrysMod\bin\
[]
Step 4: Now, We’re done replacing the model complier with custom one.
[It’s cra0kalo’s Model complier btw.]
And,The last one for blender source’s tool plugin to upload smd. and model files.
First We’ll go with latest blender.
Step 1: Extract the template zip. that i linked before.
Step 2: Open both blenders which is latest version and 2.79.
Step 3: Go to “Edit” from upper left corner.
Step 4: And Click “Preferences”
Step 5: Click “Add-on” and click “Install..”
Step 6: Browse inside the template find and you’ll see two plugin zips.
(3.3 for latest version blender)
{2_10.2 for old blender which is 2.79)
Step 7: Choose “3.3” and press install add-on.
Step 8: Search “Source” and check the box “Blender source tool”
For the 2.79 blender, There’ll be slightly diffrent steps.
Step 1: Click “File”.
Step 2: Click “User preference” and head to “Add-ons”
Step 3: Click “Install Add-on from file” and browse into the template folder and choose 2_10.2 zip.
Step 4: Search “Source” from search and check the “Blender source tool” if not checked.
(make sure to check or plugins may not work!)
Now, We’re done set up.!
**Getting started**
Step 2. Find a model you want to port.
Step 3. I’ll be using this model as the tutorial.
https://steamcommunity.com/sharedfiles/filedetails/?id=3025441251
(YAKUZA!!!)
Step 4: Go to “steamworkshopdownloader.io.”
Step 5: Paste the link and download the addon.
So, you’ll get a vpk.file as you can see in the image.
Step 6: Open GCFScape that you downloaded before.
Step 7: Drag the vpk. file to GCFScape.
Step 8: And right click “root” and click “extract”.
Step 9: Extract into somewhere u like to. \/
(I’d recommand you to create three folder named “Extracted” , “Decomplied”,”Proportion” & “Complied”.)
(Do this because’, The whole guide will use these folders π )
Step 10: Go to the “Extracted” Folder & You’ll see “root” folder that you extracted before.
Step 11: Go into the folder and go into Models/Survivors/.
Step 12: You’ll see some model files.
Step 13: Open “Crowbar”.
Step 14: Go to “Decomplie” tab and you’ll see “mdl. input:”.
Step 15: Click browse & find the model mdl. file that is located in “Extracted” Folder.
Step 16: And then Output it to “Decomplied” folder that you made before.
Step 17: Click “Decomplie”.
Example /\
Now, We’ll go into “Decomplied” Folder and you’ll see some smd. & other stuffs..
And now we’ll be heading into qc. editing
**Qc editing**
Step 1: Go into the model files we got from decompling..
Step 2: Right-Click the qc. file.
Step 3: Open with “Notepad++ .
Step 4: First, You have to rename the character name as you want. To do that,You’ll need to edit the “$modelname” line.
Example
Step 5: After editing, You have to scroll down and find a line named “$mostlyopaque”
Step 6: And you have to type “$maxverts 9999999” under the “$mostlyopaque” line. because it’s a good place to add a new $ type lines..
(You might be asking why do i need to add it?, I’ll explain, Some of workshop model will exceed the vertices limit, {Example as High-Vert Anime models mostly..} so vertices is limited by source engine and your model will be stretched out if you managed to complie it. Using the complier i gave will completely remove it. also this is the right place for modders that having model parts stretchy problem. That’s all.)
Step 7: and then scroll down until you find “$hboxset” line and change “L4D2” to “default”.
(Idk why i do this but i believe you’ll need to)
Step 8: Now, We’ll (Still..) scroll down until you finds these lines.
Step 9: Remove “$poseparameter” lines.. (sometimes random lines may appear on some models so remove them as well.)
Step 10: After that, remove $ikrule “ikclip” line..
Step 11: and then, you have to remove everyline under “$$ikautoplaylock”.
(Don’t worry, I put correct qc. lines inside the template and we’ll use it later.)
It’ll looks like this after done
Step 12: And now , we’ll have to go inside the template file.
Step 13: Extract it and go inside of folder named “qc” and open it with “Notepad++”.
Step 14: Copy everything inside and paste under the “$ikautoplaylock” line. (into your model’s qc)
After that, Press file and then click save. (Easy right?)
Now,We’re done editing the qc. and animations..
**Proportion (Necesssery!)**
This one
Step 2: And, We’ll import the model by clicking “File” , “Import” and choose “Source engine smd. vta. etc.”
Step 3: Choose “Make new armature” from “Bone blend mode”.
Step 4: Choose your model’s head.smd or any part you want to start from..
(Some models may only contains one smd. file and you only have to import it)
Step 5: When done, You have to import all other body parts. Which are cloths , Pants etc. (or other smd. files) but this time you have to change “Bone append mode” setting. “Make new armature” to “Append to target”.. if you don’t, your model’s bones may duplicated or complicated! :C.
(If it happened. Press Ctrl+Z to undo so you don’t have to redo everything :D)
Do this.
Step 6: After that, You have to click the orange stickman from right side which is named “yourmodelpart_skeleton” (yourmodelpart can be the name of the part you imported first)
Step 7: Now, Double-Click the skeleton name and rename it to “gg” (Only small letters).
Step 8: And then,click “Run script” while selected. (if not selected, press the stickman again to select)
Step 9: and skeleton armature will appear.. now you have to click “pose” from down-left corner and “apply” and then “Apply pose as rest pose”.
Step 10: Then, Press “A” to select the bones and press space and type “clear pose constraints”.
Step 11: And click “clear pose constraints”.
Step 12: And then click “pose mode” and change to “object mode”.
Step 13: Now, We have to change layer. To do that we have to click the little circles from down-section. (Click the circle from left side).
Step 14: Then, Press “A” for two-times to deselect & reselect. And you have to select “proportion trick 2” from up-section.
Step 15: And run the script by clicking “Run script”.
Step 16: Now, Press “A” and then press “Ctrl + L” and click “Modifiers”.
Step 17: Lastly, Press “A” and then “Ctrl + A”, Click “Location”. (Also check “Rolation” & “Scale” from left-down side.
Step 18: Now, We’ll export our model and proportion anims. To do that, Go to the “scene” tab.
Choose the “export path” to “Proportion” folder that you made before.
(If you don’t know where’s scene tab, just check the image below).
Step 19: Click “Export” and choose “scene export”. (Must do “Scene export” or you won’t get any proportion animation files.
Now, We’re done with proportion trick :D!.
**Physic mesh**
Additional note : Some model may contains it own physic smd. If there’s one inside you can skip this section :D..
Step 1: Open the new blender which’s latest version.
Step 2: And we’ll import the physic mesh first. To do that, Click “File” and then “Import” and click “Source engine”. (Just a reminder : If “Source engine option doesn’t appear, You have to check the source-export tool addon if it’s on or not).
Step 3: Browse inside to the template folder and go inside the “Physic mesh” folder and import the “pm_physic.smd”. (In new blender, You don’t have to do bone append mode to “Make new armature”, New blender does automatically but you can do if you want to be sure).
Step 4: When imported, We have to delete the bones from the physic mesh. (i took it from a model that’s why we need to delete first). To do that, Click “pm_physic_skeleton” and press “Delete/Del” from your keyboard. (Also delete “collection” if you want).
Step 5: Now, We’ll import our model parts. We’ll import our model’s head first or other body part if you like. Go inside “Decomplied” folder and import one model part.
(Why we doesn’t uses the parts inside “proportion”? because we only need anims, Not body parts).
Step 6: When done, Import other parts.
Step 7: Now,We have to match the physic mesh with our model. As you can see in the image, The model is too big for physic mesh.
Step 8: Press “Shift + Z” to change to “Wireframe” mode so we can see clearly.
Step 9: Now click “pm_physics” from right side panel to select the physic mesh only and press “Tab” to change to “Edit mode”. Or you can do the way shown on image below.
Step 10: Now,We have to resize the physic mesh until it fits but first you need to know the basic keys and shortcuts.
Basic controls
Ctrl + A : Select everything
Mouse swipe : Box select to select parts
Ctrl + L : Select the linked verts (Combo : Select with mouse and press to select linked verts)
Use these tools as well. (Move, Scale , Rolate etc.)
Step 11: We’ll start from arms. Swipe-select the arm and press “Ctrl + L” to select the linked verts.
(While swiping, You don’t need to select the whole arm, just select some small verts and press “Ctrl + L” and it’ll goes fine.) Also, Make sure to select only arm parts.
Step 12: We’ll move up to the model’s arm position. Use Move tool while selected or (press “G” to move and click to confirm.)
(When done, Use “Scale” or “Transform” tool if arm physic mesh is too short from model’s arms)
Usage : Swipe the blocks while using tool to scale.
Step 13: After that, We’ll do the body part and make the mesh fit.
(Use the move tool and scale tool!)
(Moving the body upper to fit)
(Transforming some parts to fit)
(Perfectly fitted!)
Step 14: When done, Press “Tab” to change back to “Object mode” and we’ll delete the body parts because we don’t need them anymore as we used it for reference.
(Select from right-side panel)
Step 15: After that, We have to apply the model skeleton for physic mesh. To do that,Select “pm_physics” from right side panel and then go to “Modifier” tab. and click “Object” and select the “yourmodelpart_skeleton”.
(You must do this or your physic mesh will not work!)
Step 16: Press “A” to select everything (bones and physic mesh) and then we’ll go to “scene” tab and click “Source engine export” and then select “SMD” and select the path to the “Decomplied” folder you created before and do “Scene export” to make sure.
(Just a reminder : You must select everything and export or you’ll get nothing).
Now,We’re done with physic mesh. This seems hard but it’ll be easy as you do this for alot of time or port other models.
**Compling & Lua.** (Final step!)
Step 1: First,Go inside the “Proportion” folder and copy the “anims” folder into the “Decomplied” folder.
Step 2: Now,Open the qc. file with crowbar.
Step 3: Choose your output path to “Complied” folder and click complie!.
(Check errors if yes, Please check the **Troubleshooting** section)
Step 4: When done, Copy the models we got from the “Complied” folder.
Step 5: Then, Go to “Extracted” folder and go inside the models/survivors/. And delete the original model files and paste the model files we got.
Step 6: Now,Go back until you finds models & materials located. Create a folder named “lua” and then create a folder named “autorun” inside the “lua” folder.
Step 7: Create a txt. document inside and name it whatever you want and change “.txt to .lua”.
Step 8: open the lua. with “Notepad++” and we’ll have to write some codes.
(Go inside the template folder and go into the “pm lua” and you’ll see a example lua. copy everything inside and paste into your lua.)
To write lua for work. You’ll have to replace some codes.
**Replace**
# *Category* to your desired category name. *You can change any*
# *Name* to your desired model name. etc. Kazuma. *You can change any name*
# *modelname* with your mdl. name. etc. Kazuma.mdl *You have to put exact mdl. name from your model folder, Wrong mdl. name will not work so check it’s matched or not*
# *arm* with your model arm mdl. name. *check your model folder’s weapon/arms/ folder,Wrong mdl name will not work just like modelmdl name.*
*Modelmdl location*
*C_arms location*
**Customize**
# Health = “450” *Change 450 to any amount you want*
# Numgrenades = “4” *Change 4 to any amount you want*
*Here a comparison of uncompleted lua & completed lua*
*Uncompleted*
*Completed*
Edit : I made a mistake at c_arm location. Location is supposed to be
“models/weapons/arms/*arms*mdl.” no “survivors” included in arm path. You’ll see a example at completed one.
Now, Save the lua. ( Ctrl + S).
We’re done porting a model from l4d2 workshop from gmod workshop!.
**Testing**
2. Copy the folder to your gmod addon folder location.
Quick guide : Go to steam, Right-Click gmod and manage, then browse local files.
And then go inside Garrysmod/garrysmod/addons and paste there.
3. Launch Gmod. and make sure you have this addon to spawn (Ragdoll) as our model is folder addon. But Npc will be at “NPC” Tab of your spawnmenu.
https://steamcommunity.com/sharedfiles/filedetails/?id=104603291
4. Create any game.
5. Now, We’ll spawn ragdoll first to see if there’s any physic errors like stretchy ragdolls.
You’ll see your addon at “Addon – Legacy”.
*Ragdoll is fine* kinda funny tho.
6. Now, Test the Npc. (Both friendly & hostile)
*NPC is fine too!*
7. Now, Try changing your PM to your ported model to see model is fine in PM and arms.
*PM is fine also*
*As well as arms*
Now, We’re done! Congratulations!! If you have some problems. Move to next section for troubleshooting the common problems.
**Troubleshooting**
Access_Violation error in crowbar : Make sure model complier is replaced with custom one and make sure you have “$maxverts 9999999” inside of your model qc.
Stretchy model parts on model : same as upper solution.
Error model : Make sure you linked the model mdl name correctly. Mostly will be models/survivors/model.mdl.
Error model arms : Make sure you linked the arms mdl name correctly as well.
T-Pose ragdoll : You forgot the most important step at physic mesh. You have to link model’s skeleton with physic mesh. Check the physic mesh section for solution.
Lua corrections : use “/” instead or “\” in lua code if you copied from path shown in file explorer.
**Rare problems**
Stretchy ragdolls : You’ll have to copy a .phy from a model you want and rename it to your model’s phy.
Destroyed qc. & smd : It’s a very rare problem that happens in some models. It only generates 1. Smd 2. Smd etc. It’s crowbar’s fault so we can’t fix or try use a model complier from l4d2 to generate smd.
Incompatible model version : Overwrite it with mdl ver. “53” or “55”. If it’s not work with “57”.
Purple or pink colour texture on model : You have to edit the vtf. files and remove “lightwarp” lines from every vtf. files.
Now, that’s all of the problems i encountered in my whole l4d2 port career. Hope you fixed your problem and “Enjoy”!.
**Credits**
Me – Writing guide & assets from template.
Crackal0 – Custom model complier
Deadwater – Tutorials for proportion trick.
If you’re brave enough to upload to workshop.. make sure to give a credit to me.
That’s all folks. Like & comment down if you encountered any problems I haven’t encountered.
Also…
βββββββββββββββββ
ββββββββββββββββββ
ββββββββββββββββββββββ
ββββββββββββ¬βββββββββββ
You can pet him if you want or feed him some points if you wish :D.!
Bye.
And that wraps up our share on Garry’s Mod: Bob’s Guide : How to port l4d2 models into Gmod easily!. If you have any additional insights or tips to contribute, don’t hesitate to drop a comment below. For a more in-depth read, you can refer to the original article here by δΉγδΉηͺεε Γ, who deserves all the credit. Happy gaming!