This is not a tutorial of such, more of a reference and is only an introduction to the QC file, these commands are the basic ones needed for you to start compiling you models into static props and physics props. I will not be talking about the modelling side of things in this tutorial.
The QC file is what turns your model into what you want giving it animations, submodels, physics properties amongst loads of other things. It is a file with the extension .qc and can be edited in notepad, wordpad or most other txt editing programs.
Here are the basic commands:
$modelname <save path><filename>.mdl
This defines where in your models directory to save the models and the filename for it. After you have compiled the model you can move it and rename it if you need to.
$cdmaterials models/<materialpath>
This tells the engine where to look for the models materials, do not put the materials name here, just the directory.
$body studio "./<smdfile>.smd"
This is the base model.
$scale <scale>
Here you can change the size of you model without going back and editing every single file. 1 being the actual size, 2 being twice the size and 0.5 being half the size, but you can use any number.
$staticprop
Use this command if you are making a static prop other wise leave it out.
$model <SubModelName> "<smdfile>"
This defines what model to use as a sub object and gives it a name.
$texturegroup skinfamilies
{
{ "[Your material name]" "skin0" }
{ "[Your material name]" "skin1" }
{ "[Your material name]" "skin2" }
}
Use this if you have more than one skin for your model, if you need more lines just add more { "[Your material name]" "<skinname>" }. Also you do not need to put the file extension.
$sequence <AnimName> "<smdfile>" fps <fps>
This is the where you define the models animations. You still need an animation if there's an animation or not so just put the model name here.
$collisionmodel "<collision_model>.smd" { <Extra Commands> }
This is the model used for collisions, if you have a simple model you could just use that for the collision model where as if it is a complex model with loads of polys it is best if you use a simpler model for collisions.
For the extra commands some of the basic ones are :
$Mass <mass>
This lets you set the objects mass in kilograms
$automass
This will automatically works out the mass of the object using density/thickness of the material applied to it and the size of the collision model itself.
$concave
This tells studiomdl to assume the collision model is concave (i.e. a set of convex chunks). Normally, studiomdl assumes the model is a single convex.
To make a physics prop you need to have these in your qc file.
$keyvalues { "prop_data" { "base" "glass.small" } }
This tells the model which type of physics object it is, the values are listed in scripts/propdata.txt which you have to extract using gcfscape.
Example layout of a basic .qc file:
The QC file should be saved in the same directory as the smd model. The simplest way to compile you model is to drop the QC file onto studiomdl.exe (located in the sourcesdkbin directory). Where the compiled model is created depends on your QC file and the save path in $modelname; for example, if you had your QC file in sourcesdk_contenthl2modelsrc with $modelname my_custom_models/yourmodel.mdl your model will come out half-life2hl2modelsmy_custom_models.
With these basic commands you should be able to compile you basic models into a static prop or a physics prop. If something goes wrong check you have set everything up correctly, and if the problem continues post it in the forums.
The QC file is what turns your model into what you want giving it animations, submodels, physics properties amongst loads of other things. It is a file with the extension .qc and can be edited in notepad, wordpad or most other txt editing programs.
Here are the basic commands:
$modelname <save path><filename>.mdl
This defines where in your models directory to save the models and the filename for it. After you have compiled the model you can move it and rename it if you need to.
$cdmaterials models/<materialpath>
This tells the engine where to look for the models materials, do not put the materials name here, just the directory.
$body studio "./<smdfile>.smd"
This is the base model.
$scale <scale>
Here you can change the size of you model without going back and editing every single file. 1 being the actual size, 2 being twice the size and 0.5 being half the size, but you can use any number.
$staticprop
Use this command if you are making a static prop other wise leave it out.
$model <SubModelName> "<smdfile>"
This defines what model to use as a sub object and gives it a name.
$texturegroup skinfamilies
{
{ "[Your material name]" "skin0" }
{ "[Your material name]" "skin1" }
{ "[Your material name]" "skin2" }
}
Use this if you have more than one skin for your model, if you need more lines just add more { "[Your material name]" "<skinname>" }. Also you do not need to put the file extension.
$sequence <AnimName> "<smdfile>" fps <fps>
This is the where you define the models animations. You still need an animation if there's an animation or not so just put the model name here.
$collisionmodel "<collision_model>.smd" { <Extra Commands> }
This is the model used for collisions, if you have a simple model you could just use that for the collision model where as if it is a complex model with loads of polys it is best if you use a simpler model for collisions.
For the extra commands some of the basic ones are :
$Mass <mass>
This lets you set the objects mass in kilograms
$automass
This will automatically works out the mass of the object using density/thickness of the material applied to it and the size of the collision model itself.
$concave
This tells studiomdl to assume the collision model is concave (i.e. a set of convex chunks). Normally, studiomdl assumes the model is a single convex.
To make a physics prop you need to have these in your qc file.
$keyvalues { "prop_data" { "base" "glass.small" } }
This tells the model which type of physics object it is, the values are listed in scripts/propdata.txt which you have to extract using gcfscape.
Example layout of a basic .qc file:
$modelname my_custom_models/(your model).mdl
$cdmaterials models
$staticprop //comment out for physic props
$scale 1.0
$body studio "./(your model)"
$sequence idle "(your model)" loop fps 15
$collisionmodel "(your model).smd"
{
$Mass 100
$concave
}
The QC file should be saved in the same directory as the smd model. The simplest way to compile you model is to drop the QC file onto studiomdl.exe (located in the sourcesdkbin directory). Where the compiled model is created depends on your QC file and the save path in $modelname; for example, if you had your QC file in sourcesdk_contenthl2modelsrc with $modelname my_custom_models/yourmodel.mdl your model will come out half-life2hl2modelsmy_custom_models.
With these basic commands you should be able to compile you basic models into a static prop or a physics prop. If something goes wrong check you have set everything up correctly, and if the problem continues post it in the forums.