Source compiling tutorial 2017[GMOD and SFM] (3ds max)

Updating my 4 year old compiling tutorial
What will I go over?

  • Source Compiling [SFM-GMOD]
  • Bodygroups [SFM-GMOD]
  • Skingroups [SFM-GMOD]
  • Importing materials [SFM-GMOD]
  • Ragdoll porting(Will not go into VTA and eye posing right now.) [GMOD]
  • Prop Porting
    ADDED $illumposition Tutorial 1/4/17

Setting up crowbar

You should have SFM, Source SDK and Source SDK base 2013 multiplayer installed for compiling.[/t]

Source Compiling

What will you need?
Crowbar Compiler

For this tutorial I will be porting something george_sears requested.
Let’s Get started, I’m going to keep it as simple as possible.

Step 1. Get your model Ready and apply the materials where they need to be, and rename the bones to valve or bip biped.
Step 2. If your model has bodygroups, export them separately.

The QC code for bodygroups will be in the compiling step

Step 3.

[Skip to step if your compiling for sfm]

Creating a Physics model - [GMOD]
hide anything but the head, spines, arms, hands, legs and feet bones.
I just reuse a phys model i have on hand and shape it to the model.
Now add a skin modifier to the phys model, Make sure your settings match the one in the picture. [Verts and select element]
You then weight the phys model.
Take time to check if your phys model is properly weighted
Step 4. Compiling for SFM or GMOD [Yes I know both QCs work regardless of being GMOD or SFM, but for the sake of comprehension I’m separating them.]
Select the SFM tab to compile for sfm, the gmod compiler works to but you will then have to move your model to the usermod folder in sfm, but it could also be used to compile stuff that wont compile with the sfm compiler[usually high poly stuff]


$modelname "mymodel.MDL"

$model "Base" "Base.smd"

$cdmaterials "models\mymodel\"

$surfaceprop "default"

$illumposition 0.000 4.169 0.000

$sequence ragdoll "Base" ACT_DIERAGDOLL 1 fps 30.00

use this tab in the game compiler option tab

$modelname "Rin\Tutorialgmod.MDL"

$model "Base" "Base.smd"

$bodygroup frontmag
studio "body1.smd"
studio "body2.smd"

$cdmaterials "models\Rin	utorial\"

$texturegroup skinfamilies
	{ "Dwarf_Majestic_Armor_00_dn"  }
	{ "Dwarf_Majestic_Armor_01_dn" }

$SurfaceProp "default"
$Contents "default"
$illumposition 0.000 -0.000 42.137

$sequence "ragdoll" "base.smd" {
	fps 30
	activity "ACT_DIERAGDOLL" 1

$CollisionJoints "phys.smd"
	$mass 25
	$inertia 10
	$damping 0
	$rotdamping 4
	$rootbone "ValveBiped.Bip01_Pelvis"


For bodygroups or skingroups add these into the qc

$bodygroup name
studio "bodygroup1.smd"
studio "bodygroup2.smd"

$texturegroup skinfamilies
	{ "Dwarf_Majestic_Armor_00_dn"  }
	{ "Dwarf_Majestic_Armor_01_dn" }

Its compiled! Now to add the textures and make materials
Now to import your textures, usually these are good settings.
You can use the batch importer to convert a handful of textures to VTF, its easy to set up.
Heres a VMT template
I wont go into materials but theres a lot of useful stuff in the source engine wiki,$phong

	"$baseTexture" "models\Rin	utorial\Dwarf_Majestic_Armor_01_dn"
                "$bumpmap"    "models\Rin	utorial\Dwarf_Majestic_Armor_02_no"

	"$phongexponent" "1"
	"$phongalbedotint" 1
	"$phong" "1"
	"$phongboost"	"1"
	"$phongfresnelranges"	"[1 1 1]"
	"$nocull" "1"


After your materials are placed in the right folder and VMTS are assigned check to make sure skingroups and bodygroups work[/vid]
Your pretty much done SFM wise.[excluding VTA, eye posing and probably something else]
If your porting for GMOD your still almost done, It’s time to make constraints [I wont be making a VTA or eye posing tutorial right now]
Go over to the physics tab in HLMV

Your mostly going to be using, Min, Max, Test, and X Y Z, and also the drop down menu for each bone to assign constraints to a specific bones axis’ [Do this by dragging the min and max sliders and use test to view it in HLMV, you can also use link to make min and max share the same value, highlight to highlight which part of the phys model your assigning constraints to.]
And your done! if need be just tweak constraints.[mine are terribad]

Source files for people to mess with/reference

happy new years

ADDED 4/10/17
Colored Specular in source, works for gmod and sfm

ADDED 5/1/17
Using wunderboys vta plugin

sample files:

ADDED 10/30/17

Brief tutorial, but gets straight to the point. I like it!

Aww yeah,i really need this.
Especially since almost all picture in mariokart thread is missing

{BOOKMARKED} For my group’s sake, I hope to master all this…

Added an illumposition guide



Above 2 qc parameters need to be added in order to make the model works properly in SFM.

No they don’t. Neither of them have to be present.

Isn’t $mostlyopaque needed to make AO function properly?

Only for models using any combination of the 4 forms of transparency with an opaque material as well.
For literally anything else no.

Follow-up question, and one I legit do not know the answer to.

Is there any practical downside to including those two controls?

I’ve yet to notice any, but that doesn’t mean anything.

Hey everyone Patrick G here and I Need help See I’m working on this online series for Youtube using SFM/MMD but I need someone who can add models I need on the Steam workshop and someone who can find models of the various creatures characters or mecha needed for my shows and Just as important I need someone who can make models of the various things I need and again they need to be Ported to the Steam workshop so my team animators can work with them PLEASE I BEG YOU IVE LOOKED ALL OVER THE INTERNET AND I DESPERATLY NEED THIS PLEASE WONT SOMEONE HELP ME


$mostlyopaque doesn’t really have a true downside unless you’re doing actual game development, which we aren’t.
If we were we would try to avoid using it whenever possible.

As to the later; personal preference. Actually I’m not sure if the latter does anything to animationsets in the sfm. Their ambient values are inherently being altered just by being spawned as an animation set.
It’s possible but I don’t know enough to give a sure answer.

Am I MUST have the SFM, Source SDK & Source SDK 2013? Or they are optional?

I think you need 2013 to compile with gmod

So far as I’m aware, Source SDK 2013 MP is a mandatory minimum for being able to compile for GMod.

Thx, but i have another question… Do i really need to have 3DS Max? Or i can use other alternative such as blender or other software? (Sry i’m newbie to this whole thing :/)

Yeah you can use Blender

Think you can also add a tutorial on how to make the textures look amazing? Nearly every great model ported has about 100MB for the textures.

are you talking improving the textures or materials-wise? because it’s textures, you’re practically doing a repaint job or something close to it. but if it’s materials-wise, that front’s harder. blueflytrap’s overwatch materials thread is a decent start, get a decent grip on a few fundamentals. most of doing materials is going for whatever looks best in your eyes usually, and it doesn’t ever have to 100% follow that thread. using parts of it will usually help.

Making an attempt to port a custom med-poly non-game models to SFM, got greeted with “error loading model” with the Model Viewer. Am I doing something wrong?

Edit: Got it fixed, but now the model looks like this:

Not only that, but I was sure the bones for the limbs would appear, but they don’t.