Problem with custom models

honeymustard

L9: Fashionable Member
Oct 26, 2009
698
573
I've recompiled one of the rocks with a new texture, using the exact same settings as it had when decompiled. It shows up fine in Hammer and in the Model Viewer, but in game it doesn't show up. However, it does when I set it to prop_dynamic. I get these errors in the compile log:

Error! To use model "models/pl_boundary/rock003d.mdl"
with prop_static, it must be compiled with $staticprop!
Error loading studio model "models/pl_boundary/rock003d.mdl"!

However, as I said, I compiled the model using the previous settings, which do use $staticprop. The QC is as follows:

Code:
$modelname "pl_boundary\rock003d.mdl"
$model "Body" "rock003_reference.smd"
$lod 85
 {
  replacemodel "rock003_reference" "lod1_rock003_reference"
}
$cdmaterials "pl_boundary/"
$texturegroup skinfamilies
{
	{ "rock003d.vmt" }
}
$hboxset "default"
$hbox 0 "static_prop" -105.552  -201.264  -0.000  105.432  201.264  234.546
// Model uses material "rock003d.vmt"
$surfaceprop "dirt"
$illumposition -0.060 0.000 117.273
$sequence idle "idle" fps 30.00
$collisionmodel "phymodel.smd" {

	$concave
	$mass 80.0
	$inertia 1.00
	$damping 0.00
	$rotdamping 0.00
}
 

eyefork

L3: Member
Oct 27, 2008
130
186
You need to add the $staticprop command to your qc file.
Code:
$modelname "pl_boundary\rock003d.mdl"
$model "Body" "rock003_reference.smd"
$staticprop   // LIKE THIS
$lod 85
 {
  replacemodel "rock003_reference" "lod1_rock003_reference"
}
$cdmaterials "pl_boundary/"
$texturegroup skinfamilies
{
	{ "rock003d.vmt" }
}
$hboxset "default"
$hbox 0 "static_prop" -105.552  -201.264  -0.000  105.432  201.264  234.546
// Model uses material "rock003d.vmt"
$surfaceprop "dirt"
$illumposition -0.060 0.000 117.273
$sequence idle "idle" fps 30.00
$collisionmodel "phymodel.smd" {

	$concave
	$mass 80.0
	$inertia 1.00
	$damping 0.00
	$rotdamping 0.00
}
 
Feb 18, 2009
640
629
Your qc doesn't actually contain "$staticprop". I think you're looking at "$hbox 0 "static_prop"..." which is something completely different (in fact, I don't think you need it at all unless the model has bones, I certainly have never needed it) it is just pat out by the decompiler.

eyefork is ninja, but you need to explain to him the problem ;)

EDIT: the decompiler isn't actually all that great at getting the qc right. A number of times I've had to re-write the qc manually, leaving out any unnecessary code, to get it to work. I mean, it is a good thing to refer to, but don't rely on it being 100% right all the time.
 
Last edited: