Portal 2 custom models

From Valve Developer Community
Jump to navigation Jump to search

About

I noticed that my SMD exporter exports in an much different way that studiomdl in the portal 2 folder doesn't reconize it. This is an reference guide to make it so that the studiomdl reconizes it. (this deals with props I have yet to see the difference in NPC .qc in portal 2 and the .qc for other games, wanna find out use Gibbeds VPK Extractor on the portal 2 .vpk files found in Steam\steamapps\common\portal 2\portal2 folder)

Refernce code

This is the .smd that the studiomdl in the portal 2 folder reconizes


version 1
nodes
 0 "static_prop" -1
end
skeleton
time 0
 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
end
triangles
combine_panel001.bmp
0 58.059105 -108.627701 38.488201 0.072002 0.023401 0.997130 0.289500 -0.998100
0 52.870804 -94.276199 38.526199 0.072002 0.023401 0.997130 0.316600 -0.998100
0 45.461502 -78.973999 38.702400 0.072002 0.023401 0.997130 0.355300 -0.998100
combine_panel001.bmp
0 73.021011 -99.157303 38.303902 -0.270688 -0.028099 0.962257 0.211300 -0.998100
0 74.424805 -114.241302 38.257702 -0.269592 0.002400 0.962972 0.203900 -0.998100
0 75.247810 -114.277496 38.488201 -0.275013 0.013601 0.961344 0.199600 -0.998100
combine_panel001.bmp
...
end


No nodes other then 0 "static_prop" -1 and (for props)


skeleton
time 0
 0 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
end

Also 0 in the first column NEVER CHANGES

Here is the .qc file with also some key notes

$cd "..."
$modelname "Combine_Room\combine_wire001.mdl"
$model "Body" "combine_wire001_reference.smd"
$lod 10
 {
  replacemodel "combine_wire001_reference" "lod1_combine_wire001_reference"
}
$lod 15
 {
  replacemodel "combine_wire001_reference" "lod2_combine_wire001_reference"
}
$lod 20
{
  replacemodel "combine_wire001_reference" "lod3_combine_wire001_reference" 
}
$lod 25
{
 replacemodel "combine_wire001_reference" "lod4_combine_wire001_reference"
}
$cdmaterials "models\combine_room/"
$hboxset "default"
$hbox 0 "static_prop" -77.137  -173.657  -40.269  77.137  173.657  40.269
// Model uses material "combine_panel001.vmt"
$surfaceprop "metal"
$illumposition 0.000 0.000 0.000
$sequence idle "idle" fps 30.00
$collisionmodel "phymodel.smd" 
{

$concave $mass 30.0 $inertia 1.00 $damping 0.00 $rotdamping 0.00

}


$lod and $hbox and $collisionmodel are unnessary so here is the bare bones just to get your model into hammer


$cd "..."
$modelname "Combine_Room\combine_wire001.mdl"
$model "Body" "combine_wire001_reference.smd"
$cdmaterials "models\combine_room/"
$hboxset "default"
$surfaceprop "metal"
$illumposition 0.000 0.000 0.000
$sequence idle "idle" fps 30.00


finally to get the model into hammer you need an .smd called idle.smd and this is it


version 1
nodes
  0 "static_prop" -1
end
skeleton
time 0
  0 0.000000 0.000000 0.000000 0.000000 -0.000000 0.000000
time 1
  0 0.000000 0.000000 0.000000 0.000000 -0.000000 0.000000
end


Hopefully this allows for more custom props in portal 2 mods please this is subject to frequent update so keep an eye out for changes

End Note

don't butcher this like you did with Portal 2 Custom Textures you know who you are and if you treated all new knowleage like what you did with Portal 2 Custom Textures this wiki will no longer be a tool to mod creators