Importing Custom Character Model for Portal 2
I've tried methods which allow L4D2 character model swap-outs but it doesn't seem to work. The model is rigged to one identical to Chell's and should go off of her animations, and is also in line with her general polycount and scale, etc. I've tried changing up the qc file several times, and it's currently identical to the qc file you get when decompiling Chell's model. I'm not sure that it's the problem but it likely could be. We've tried using a VPK for the player asset, because we use a VPK already for voice acting (mostly) successfully.
I did a test run using an alternate model like the robots or a cube which are already in the game using GetPlayer().SetModel("models/props/metal_box.mdl"); etc and planned to script all areas to use this at startup but I wasn't able to get the model to import to SDK to preload in the area. There's no specific error either which makes it hard to figure out what I've done wrong.
Any suggestions would be appreciated. I think having a custom player model would help to seal the campaign's plot fully because it's set prior to Chell.
$modelname "custom_models\hobo\hoboplayer.mdl"
$model "Hobo" "player_model.dmx.smd" {
flexfile "mdldecompiler_expressions.vta" {
}
eyeball righteye head -1.292 71.700 3.157 eyeball_r 1.050 5.000 models/player/chell/chell_rev2_head 0.600
eyeball lefteye head 1.292 71.700 3.157 eyeball_l 1.050 -5.000 models/player/chell/chell_rev2_head 0.600
eyelid upper_right "mdldecompiler_expressions.vta" lowerer 4 -1.000000 neutral 0 0.000000 raiser 4 1.000000 split 0.1 eyeball righteye
eyelid lower_right "mdldecompiler_expressions.vta" lowerer 4 -1.000000 neutral 0 0.000000 raiser 4 1.000000 split 0.1 eyeball righteye
eyelid upper_left "mdldecompiler_expressions.vta" lowerer 4 -1.000000 neutral 0 0.000000 raiser 4 1.000000 split -0.1 eyeball lefteye
eyelid lower_left "mdldecompiler_expressions.vta" lowerer 4 -1.000000 neutral 0 0.000000 raiser 4 1.000000 split -0.1 eyeball lefteye
flexcontroller eyes eyes_updown "range" -45.000 45.000
flexcontroller eyes eyes_rightleft "range" -65.000 65.000
}
$scale 1.0
$body "hoboplayer" "hoboplayer.smd"
$staticprop
$surfaceprop "flesh"
$cdmaterials "custom_models\hobo"
$sequence idle "player_idle" loop fps 30
$collisionmodel "player_phy.smd" {
$concave
$mass 5.0
$inertia 1.00
$damping 0.00
$rotdamping 0.00
}
Once again I really appreciate any help, while I've already been graded for this course I still really want to get this asset in. I think it would really be awesome and I spent a lot of time on it.
Thanks in advance for any comments or suggestions...
taralqua wrote:
Here's the QC file I went with. I also tried importing him as a static prop with a very basic QC and that didn't work so I'm not really sure whether there's something wrong in addition to whatever might be wrong here.![]()
```
$modelname "custom_models\hobo\hoboplayer.mdl"
$model "Hobo" "player_model.dmx.smd" {
flexfile "mdldecompiler_expressions.vta" {
}
eyeball righteye head -1.292 71.700 3.157 eyeball_r 1.050 5.000 models/player/chell/chell_rev2_head 0.600
eyeball lefteye head 1.292 71.700 3.157 eyeball_l 1.050 -5.000 models/player/chell/chell_rev2_head 0.600
eyelid upper_right "mdldecompiler_expressions.vta" lowerer 4 -1.000000 neutral 0 0.000000 raiser 4 1.000000 split 0.1 eyeball righteye
eyelid lower_right "mdldecompiler_expressions.vta" lowerer 4 -1.000000 neutral 0 0.000000 raiser 4 1.000000 split 0.1 eyeball righteye
eyelid upper_left "mdldecompiler_expressions.vta" lowerer 4 -1.000000 neutral 0 0.000000 raiser 4 1.000000 split -0.1 eyeball lefteye
eyelid lower_left "mdldecompiler_expressions.vta" lowerer 4 -1.000000 neutral 0 0.000000 raiser 4 1.000000 split -0.1 eyeball lefteye
flexcontroller eyes eyes_updown "range" -45.000 45.000
flexcontroller eyes eyes_rightleft "range" -65.000 65.000
}
$scale 1.0
$body "hoboplayer" "hoboplayer.smd"
$staticprop
$surfaceprop "flesh"
$cdmaterials "custom_models\hobo"$sequence idle "player_idle" loop fps 30
$collisionmodel "player_phy.smd" {
$concave
$mass 5.0
$inertia 1.00
$damping 0.00
$rotdamping 0.00
}```
Once again I really appreciate any help, while I've already been graded for this course I still really want to get this asset in. I think it would really be awesome and I spent a lot of time on it.
Thanks in advance for any comments or suggestions...
Unfortunately, what you just did is unessesary.
You just put the mdl and other files in the same folder of where it was.
Put the VTF files in the designated place and
Make a CFG file or a point client command that says
setmodel path/model
You can't replace Chell because she's in the vpk so you can't override it at the moment.
here's what our scripts include:
GetPlayer().SetModel("models/custom_models/hobo/hoboplayer.mdl");
I was able to preload a different mesh for a static object missile silo, but not the character model I made. Setmodel works fine in our scripts to swap out for a test item already in the SDK, like a standard cube. Too bad our hobo player isn't a cube.

taralqua wrote:
But setmodel won't work if you can't preload, and for some reason I can't preload.here's what our scripts include:
GetPlayer().SetModel("models/custom_models/hobo/hoboplayer.mdl");I was able to preload a different mesh for a static object missile silo, but not the character model I made. Setmodel works fine in our scripts to swap out for a test item already in the SDK, like a standard cube. Too bad our hobo player isn't a cube.
Are they in the same paths as the one in L4D2?
taralqua wrote:
But setmodel won't work if you can't preload, and for some reason I can't preload.here's what our scripts include:
GetPlayer().SetModel("models/custom_models/hobo/hoboplayer.mdl");I was able to preload a different mesh for a static object missile silo, but not the character model I made. Setmodel works fine in our scripts to swap out for a test item already in the SDK, like a standard cube. Too bad our hobo player isn't a cube.
--image--
Maybe just add the model somewhere in the level, somewhere hidden, so you cannot see it, but it is still pre-loaded?
lpfreaky90 wrote:
taralqua wrote:But setmodel won't work if you can't preload, and for some reason I can't preload.
Maybe just add the model somewhere in the level, somewhere hidden, so you cannot see it, but it is still pre-loaded?
This was the plan, but unfortunately I can't even get it to show up in the viewer, like I can for the static prop we made. I'd pre-cache it if the viewer could even read it.
I'm really baffled with the player model I made, since it isn't even visible in the model viewer even though I followed the steps from the L4D2 tutorial I found to the letter (with paths changes as needed for it being Portal 2 instead of L4D2 but still mostly the same.) I may have to try to see if the player model works in L4D2 as a control study to see if the model itself is somehow messed up.
The only thing that differs from my player model and the custom made missile silo (which works) is that the model for the character is rigged with Chell's Portal 2 rig. They were otherwise compiled using the same plugins and methods. 
smash wrote:
I was curious to know if anyone has had any success with this? I know Taralqua has been trying to import a custom model into Portal 2 but nothing has worked so far. Has anyone derived a process that mirrors the Left4Dead or TF2 import method?
you have to currently precache it by putting it in a vpk.
and use it in a portal2_dlc3 folder.
I haven't made a non-static source game model before so I'm trying to go through and use these tutorials: Custom L4D2 character and mario's guide to ragdolling
I haven't been posting more on this issue because I don't really know what to ask. I'm certain someone who could make a working L4D2 model could make a working model for Portal 2 with obvious changes (like the first aid and bandage locations removed or whatever) so that's why I'm trying to learn that process.
(Edited for clarity, sorry.)
smash wrote:
Spongylover123- Is the precache method for static objects or does it definitely work for rigged character models as well?
needed for all models used on the player.