Please or Register to create posts and topics.

Importing Custom Character Model for Portal 2

Page 1 of 2Next

Last semester I was part of a level design class where we worked with Portal 2 in creating a standalone campaign with full voice acting and lots of awesome maps, and I've created a player model for that campaign in ZBrush/3ds max. I can import standard static prop objects but nothing I've tried has worked correctly to import the model as the player model.

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.

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. :notwant:

Code: Select all
$modelname   "custom_modelshobohoboplayer.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_modelshobo"

$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. :blah: 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. :notwant:

Code: Select all
$modelname   "custom_modelshobohoboplayer.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_modelshobo"

$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. :blah: 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.

But setmodel won't work if you can't preload, and for some reason I can't preload.

here's what our scripts include:

Code: Select all
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

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:

Code: Select all
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

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:

Code: Select all
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.

Here is a video of the mod project, by the way. It will be available for download soon but my model will not be included with it, seems like. http://www.youtube.com/watch?v=yQ7bxwVbriY

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. :-|

is your texture for the model VertexLitGeneric in the .vmt? if so, then there will be an error when trying to use it in-game and it will be invisible in the browser.

My Maps:
[spoiler][SP] Alternate[/spoiler]

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?

Page 1 of 2Next