Garry's Mod

Garry's Mod

44 ratings
Bob's Guide : How to port l4d2 models into Gmod easily!
By 乃ㄖ乃爪卂匚 Ü
• A useful guide for players & creators who wants to port L4D2 models to Gmod but sadly there's no guide on internet.. so i decided to make it for y'all.!
I learned alot stuffs for this guide.. like months..! And ported alot of models.! •

★No L4D2 Required! ★
~ Spent a week for this guide! Like and awards would be really appreciated! ~
• Hope this helpful for you!•
3
   
Award
Favorite
Favorited
Unfavorite
**Note and things to know**
⚠ Read & follow all the instructions carefully or it won't work! ⚠
➤ 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.. Guide will becomes easier as you do this for alot of times.!

══════════════════════════════════════════
**Required tools & items**
★ First, You'll need these tools and templates.! ★

══════════════════════════════════════════

★ You'll need two diffrent versions of blender (for physic mesh & proportion)

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://steamproxy.net/groups/CrowbarTool

══════════════════════════════════════════

Notepad++ : To edit Qc. & Lua.
Link : https://notepad-plus-plus.org/downloads/

══════════════════════════════════════════

Template : Essential for most steps
★ (Contains Qc. Physic mesh & Source tool 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
★ Useful for models with high verts and faster compiling.! ★

Link : https://drive.google.com/file/d/1nRyUViwiGUkb81viztA4gIaWu1lK3ezs/view

══════════════════════════════════════════

Proportion Trick : One of most important scripts.
➤Link : https://github.com/sksh70/proportion_trick_script

Make sure to download all of them! ⚠

══════════════════════════════════════════
**Preparing & Setting up**
★ Setting up "Crowbar,Blender & Some stuffs"★

Step 1: Open Crowbar.

Step 2: Go to "Set up games".

Step 3: You'll see like this.

══════════════════════════════════════════


to
══════════════════════════════════════════

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.

⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

⏚ Engine : Source

⏚ Executable (exe.) : Your gmod exe.
☞ C:\Steam\steamapps\common\GarrysMod\hl2.exe

⏚ Gameinfo.txt : Gmod's info file.
☞ C:\Steam\steamapps\common\GarrysMod\garrysmod\gameinfo.txt

⏚ Complier / Viewer / Mapping & Packer : Essential tools for crowbar
☞ 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 bin folder.
☞ C:\Steam\steamapps\common\GarrysMod\bin\
ℹ []

Step 4: Now, We're done replacing the model complier with custom one.

══════════════════════════════════════════



══════════════════════════════════════════

★ And,The last one for blender source's tool plugin to upload smd. and model files ★

• First We'll go with latest blender.

⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

⚠ Update : If you have blender blender 4.21 LTS which is latest version. You may be to follow these steps to import plugin. ⚠
➤ : Open the latest blender 4.21 LTS.
➤ : Click "Edit" and then "Preference".
➤ : Click "add-on" and click the arrow from right upper corner and click "Install from disk" and the browse inside template folder and install Blender source tools 3.3" plugin.
Skip to importing 2.79 if you're using 4.21 LTS.]

══════════════════════════════════════════



══════════════════════════════════════════

⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯⋯

⚠ For older blender than blender 4. ⚠

Step 1: Extract the template zip. that i linked before.

Step 2: Open both blenders which is new version you got.

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!)

💡: Also go to "Edit" and click "Save startup file" so you won't need to import the plugin again!.

★Now, We're done set up.! ★
**Getting started**
★ Now, We're gonna start porting the model. But we need to find the model you want to port. So, Let's go to the L4D2 workshop and find a model you want to port.★

Step 1. Go to L4D2 Workshop.

Step 2. Find a model you want to port. (Please don't be r18 models..)

Step 3. I'll be using this model as the tutorial.

════════════════════════════════════════════

https://steamproxy.net/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: Before doing anything next , You'll have to create four folders because this guide will use those folders..

➤ Extracted
➤ Decomplied
➤ Proportion
➤ Complied

⚠ Highly recommended ⚠



════════════════════════════════════════════

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 for U.



════════════════════════════════════════════

★ 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**
★We're getting into deeper. And this steps needed to be follow carefully or you'll get a bad result! ★

So,We're gonna edit the qc. from the model files we got from decompling..

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.
★ Paste into your model's qc under $ikautoplaylock.. ★

════════════════════════════════════════════



────────────────────────────────────────────



════════════════════════════════════════════

★After that, Press file and then click save. Easy right?
Now,We're done editing the qc. and animations..★
**Qc. editing II**
Y'all told me that arms not holding hl2 weapons correctly.. Well, It's finally here.!

Step 1 : Open the qc. with "Notepad++" again.

Step 2 : Firstly, Scroll down and find the "$attachment" lines. "Replace" those lines with line shown below.

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿

$attachment "eyes" "ValveBiped.Bip01_Head1" 2.63 -4.13 0.04 rotate 0 -80.1 -90
$attachment "mouth" "ValveBiped.Bip01_Head1" -0.2 -5.8 0 rotate 0 -80 -90
$attachment "chest" "ValveBiped.Bip01_Spine2" 4 4 0 rotate 0 95 90
$attachment "forward" "ValveBiped.forward" 0 0 0 rotate 0 0 0
$attachment "anim_attachment_RH" "ValveBiped.Anim_Attachment_RH" 0 0 0 rotate -90 -90 0
$attachment "anim_attachment_LH" "ValveBiped.Anim_Attachment_LH" 0 0 0 rotate -90 -90 0

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿

Step 3 : Scroll down. There'll be "$definebones" lines. "Remove" the lines shown below.

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿

$definebone "ValveBiped.attachment_bandage_legL"
$definebone "ValveBiped.attachment_bandage_legR"
$definebone "ValveBiped.weapon_bone"
$definebone "ValveBiped.weapon_bone_Clip"
$definebone "ValveBiped.weapon_bone_Clip_Bullets"
$definebone "ValveBiped.weapon_bolt"
$definebone "ValveBiped.weapon_bone_extra"
$definebone "ValveBiped.weapon_bolt_opposite"
$definebone "ValveBiped.weapon_charger"
$definebone "ValveBiped.attachment_armR_T"
$definebone "ValveBiped.Bip01_L_Finger02"
$definebone "ValveBiped.weapon_bone_Clip2"
$definebone "ValveBiped.weapon_bone_Clip2_Bullets"
$definebone "ValveBiped.weapon_bolt_l"
$definebone "ValveBiped.L_weapon_bone"
$definebone "ValveBiped.attachment_bandage_armL"
$definebone "ValveBiped.attachment_armL_T"

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿

Step 4 : You're done with fixing but i forgot to mention one part. Scroll down, Find the $includemodel line. When you found. You can replace " f " with " m " if your character is a "male".
But you can leave it if your character is a "female". also for "female" with "male".
Example shown below. You can copy-paste it!.

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿

$includemodel "f_anm.mdl"
$includemodel "f_anm.mdl"
$includemodel "f_gst.mdl"
$includemodel "f_pst.mdl"
$includemodel "f_shd.mdl"
$includemodel "f_ss.mdl"
$includemodel "humans/female_shared.mdl"
$includemodel "humans/female_ss.mdl"
$includemodel "humans/female_gestures.mdl"
$includemodel "humans/female_postures.mdl"

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿

$includemodel "m_anm.mdl"
$includemodel "m_anm.mdl"
$includemodel "m_gst.mdl"
$includemodel "m_pst.mdl"
$includemodel "m_shd.mdl"
$includemodel "m_ss.mdl"
$includemodel "humans/male_shared.mdl"
$includemodel "humans/male_ss.mdl"
$includemodel "humans/male_gestures.mdl"
$includemodel "humans/male_postures.mdl"

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿

That's all, Your arm not holding hl2 weapons will be fixed.!

**Proportion (Necesssery!)**
★ Now, We'll be doing proportion trick for model. But one thing, Follow all steps carefully or you'll completely destroy your model.. so please follow carefully. (Thanks.).. Also doing proportion trick in l4d2 models are easier than porting a random models from internet. idk why.. ★

════════════════════════════════════════════

Updated steps : I forgot that you need to import the script first, First open the proportion folder and open the "proportion_trick_2.7_new.blend". And click "Save startup file" again so you won't need to import again.❖



────────────────────────────────────────────

Now, You may start to proportion steps..

Step 1: Open the old blender which is 2.79. It looks old but useful!.
❖ Some might be asking, why you use 2.79 to do proportion trick , doing proportion in 2.79 is more simple and easy to do than new blenders..❖



════════════════════════════════════════════

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 ⏚

════════════════════════════════════════════



This one.!

────────────────────────────────────────────

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 it's not selected, click the stickman figure to select the sketelon. ⏚

════════════════════════════════════════════



────────────────────────────────────────────



════════════════════════════════════════════

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**
★This step is hard for beginners and you have to careful also! Just follow every steps carefully and it'll goes well.. ★
❖ Additional note : Some model may contains it own physic smd. If there's one inside you can skip this section :D.. ❖

★ Now, We'll be heading to new blender.★

Step 1: Open the new blender which's new 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. To do that, Click "pm_physic_skeleton" and press "Delete/Del" from your keyboard. Also delete "collection" as we don't need it.

════════════════════════════════════════════




────────────────────────────────────────────



────────────────────────────────────────────



════════════════════════════════════════════

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 you like with "Make new armature".

❖ Why we doesn't uses the parts inside "proportion"? because we only need anims, Not body parts. If we uses those parts, model's face will be stretchy. ❖

Step 6: When done, Import other parts with "Append to target".

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 ⏚
LMB : Select verts or parts
RMB : Move around
Middle mouse button : Spin around
A : Select everything
Shift + Mouse swipe : Select each verts with muti selectable
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 : "⏚ Shift+LMB" 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 & select linked all 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 the physic mesh ❖

────────────────────────────────────────────



❖ 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 parts 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.

════════════════════════════════════════════



────────────────────────────────────────────



════════════════════════════════════════════

★ 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. ★
**C_arms (Optional)**
★ Alot of model gets a thumb issue, This section will fix it.★

We'll have to download the "Template file" again, Because i updated it with additional files.
So.. Update your template if you're still in progress.!

Step 1 : First of all, Go inside the "Extracted" model files and find the "v_arms" mdl. Open it with "Crowbar" and decomplie it into a folder.

Step 2 : Open "New blender". Import the arm smd. with "Make new armature". You'll see your arm after imported. Again, Go inside template folder and import the "ARMS.smd" from my template with "Make new armature".

Step 3 : Now, We'll select our model arm's skeleton and arm. Move the position till it fit with template's arm position. Not perfectly fit, Only position.
⚠ You must select the arm and skeleton both! ⚠

════════════════════════════════════════════

Moving down.


Fitted position (Arm length doesn't matter, it's fine if arm fit with template's position.)


════════════════════════════════════════════

Step 4 : We'll try to fit it perfectly by using "Pose mode". Select your model's arm and press "Ctrl + Tab". It'll change into "Pose mode". Select the "Hand" bone or "Forearm" and use "Move" tool to make your arm longer. Try to fit with template arm's length and bones, If your model's bones position and template's bone positions are a little far. Select the model's arm and bones and try moving the position until it fine to continue.

════════════════════════════════════════════

Need a little move.


Moved and fitted. (Doens't need to be perfectly fit.). I mostly focus on thumb and middle finger.


════════════════════════════════════════════

⚠ Better fitting = Less errors... so try your best! ⚠
Step 5 : After fitting the arm's position with template's arm. (Both sides). You have to select your model's arm. Go inside "Modifiers" tab (Blue wrench). and apply the "Armature" modifier.

════════════════════════════════════════════



════════════════════════════════════════════

Step 6 : Select your model's bones, Go back to "Pose mode" again, Select all of bones by clicking "A". Click "Pose" from upper section and "Apply" and then click "Apply selected pose as rest pose".
And then click "Apply pose as rest pose" while all of bones selected.

════════════════════════════════════════════



════════════════════════════════════════════

Step 7 : After all, Select your model arm in "Object mode" and go inside "Modifiers" tab. Click "Add modifier" and choose "Deform" and click "Armature".

════════════════════════════════════════════



════════════════════════════════════════════

Step 8 : Click the blank with "Object". Select the template arm's skeleton.Hide your model arm's skeleton and template arm.

Step 9 : Ok, We'll select the model's arm and then template arm's bone. (Don't get confused , And follow the step carefully in order..). Press "Ctrl + P" and click "with Automatic weights".
It'll weight the arm automatically. But you can weight it your own if you want.!

════════════════════════════════════════════



════════════════════════════════════════════

Step 10 : After all, You can export the arm with SMD into "C arms" folder inside template folder.
You'll have to edit the qc. by replacing some parameters.

════════════════════════════════════════════

★ To write qc for compling arms. You'll have to put the parameter in their places.. ★

**Replace**
➜ "Arm.mdl" to your desired arm mdl name. *You can change any name*
➜ "arm.smd" with your arm smd. name. etc. kazuma_arms.smd *You have to put exact smd name*
➜ "Material path" with your model's material path *check your model's qc file and copy the path $cdmaterials and paste it there. etc. l4d2/kazuma/ *

**Define bones**
➜ Open the qc with crowbar and then click "Definebones" and click "Definebones".
It'll defines the bones. You'll get "definebones.qci", Open it with Notepad++.. Copy everything inside and paste in "//Definedbones".

════════════════════════════════════════════

Step 11 : After editing , Click "Ctrl + S" from your keyboard. Open qc with crowbar and uncheck "Definebones" if you haven't. Click "Comple". Choose export path to your complied model's folder.

Step 12 : Copy the arm's files. Put them inside your model's folder. Re-edit the lua with your arm's mdl if you came here to fix the thumb issue.

That's all.!
**Compling & Lua.** (Final step!)
★ Finally,We're at final steps.Everything will goes well as you follows the steps carefully! ★

We'll complie the model now and see if any errors.

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!.

════════════════════════════════════════════



⚠ Please take a visit to **Troubleshooting** if any errors shows up! ⚠

════════════════════════════════════════════

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*


════════════════════════════════════════════

★ Update ★
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**
Now, We'll test our model if it's worked or not.

1.Rename the "root" to any name you want. Etc. "Kazuma PM & NPC".

2. Copy the folder to your gmod addon folder location.

⏚ : 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://steamproxy.net/sharedfiles/filedetails/?id=104603291

4. Create any game. (Now, wait till it loaded.. also rip if you have 1000+ addons).

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*



⚠ If your c_arms are error texture, Please visit the **Troubleshooting** section. ⚠

════════════════════════════════════════════

Now, We're done! Congratulations!! If you have some problems. Move to next section for troubleshooting the common problems.
**Troubleshooting**
Well, You've got a problem. Ain't you?

════════════════════════════════════════════

**Common problems**
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.

Can't open file "*survivor_anims* : make sure to copy the anims folder into main model's folder.

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.

Error model arms II : rename arms with your desired name and put them inside the "survivirs" folder and update the lua with updated c_arms path.

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.

T-pose ragdoll II : If you're bored to do everything back, just copy a "phy." from a working ragdoll model and replace the phy. of your ported model. Make sure to rename correctly and replaced!.

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. same as T-pose ragdoll II solution.

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**
Credits as always.
Me - Writing guide & assets from template.
Crackal0 - Custom model complier
Deadwater2 - Tutorials for proportion trick and other stuffs.

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.

════════════════════════════════════════════
**Updates**
v.1.1 : Updated the model complier link & Proportion trick link bcuz' i gave the wrong link.

════════════════════════════════════════════

v2 : Reworked the whole guide and some fixes.
- Added more key binding on "basic controls"
- fixed mistaken words
- updated steps
- better view for screenshots
- more stylish
- more easier ig.

That's all i think, i spent 1.5 hrs on this update.. also thanks for 4 stars rating!!

════════════════════════════════════════════

v2.1 : Fixed a bugged texts inside "Physic mesh" section.. Sorry about that.

════════════════════════════════════════════

V2.2 : Added new section "Qc editing II" for fixing arm not holding hl2 weapons correctly!.

════════════════════════════════════════════

=New guide released!=

https://steamproxy.net/sharedfiles/filedetails/?id=3344203435

════════════════════════════════════════════

50 Comments
Chiffon 8 Nov @ 5:45am 
Many thanks for your timely response. You and your tutorial are amazing!:steamhappy:
乃ㄖ乃爪卂匚 Ü  [author] 8 Nov @ 5:39am 
@Chiffron I solved it and created a section for it.. thanks for using my guide.
Chiffon 6 Nov @ 11:39pm 
Thanks for the awesome tutorial, It works wonders. Yet I encountered a annoying problem that I couldn't figure out by myself. That is, the thumbs of the viewmodel would twist in abnormal ways. Is there any insight you could provide addressing this problem?
乃ㄖ乃爪卂匚 Ü  [author] 26 Oct @ 10:11pm 
@zapka looks like steam wiped the custom complier.. try replacing the complier again..
zapka 26 Oct @ 11:38am 
got error "bad command $maxverts" any solutions?
乃ㄖ乃爪卂匚 Ü  [author] 25 Oct @ 9:03am 
Guide updated! new section "Qc editing II" to fix arms not holding hl2 weapons correctly!!.
乃ㄖ乃爪卂匚 Ü  [author] 25 Oct @ 1:47am 
Thanks.. I’ll try to find solution asap..
/n 24 Oct @ 11:43pm 
oo, sounds simple enough, thanks!
also, good luck with the hands problem—
乃ㄖ乃爪卂匚 Ü  [author] 24 Oct @ 7:53pm 
@/n Yes. You can, To do bodygroups.. You have to go inside blender. Import your model.. and select your whole model and go inside “Edit mode” by pressing “Tab”. while selected. When you’re in, Select the vertices of part you want to be a bodygroup and press “Ctrl + L” on your keyboard and it’ll select the part. Then press “P” and choose seperate by “Selection”.
It’ll seperate the part from main model. Name it anything you want and when you export the model. You’ll get a extra smd. which is your custom bodygroup. Edit the qc by adding another $bodygroup line. Complie it and you’re good to go.

If this is too long or hard to understand , I’ll update the guide today with new section.
/n 24 Oct @ 1:52pm 
Ayy, nice guide! I wonder if i could add more bodygroups than Face effects which lot of VRC Have, any ideas?