Replacing HL2DM player models with XSI Mod Tool

From Valve Developer Community
Jump to: navigation, search

This tutorial shows how to make a replace player model for HL2DM from XSI Mod Tool.

This assumes that you have downloaded/installed XSI Mod Tool, and installed Valve Source add-on. You can get them from the download section of softimage.com.

Replace the reference model in XSI Mod Tool

  1. Open sourcesdk_content\hl2mp\modelsrc\humans_sdk\Male\Group03m\scenes\Male_05_reference.scn
  2. Import your model to the scene (file>merge or file>import).
    Note.pngNote:You can import .xsi, .3ds, .x to ModTool.
  3. Scale your model to the original mesh.
  4. Freeze all transform and Freeze on your model.
  5. Choose the original mesh (male_05) and select ValveSource>Weightmap export... and save the weight map setting of the original mesh.
  6. Delete the original mesh.
  7. Select your model, then ValveSource>Weightmap import and load the file you saved in 5.
    Note.pngNote:These processes transfer the existing weight map setting from the original to your model. If this weight transfer doesn't work (like only feet weight transfered), it's possibly because you forgot to freeze all transform of your model.
    Alternatively, you can select your model, then Envelope>Set Envelope and pick ValveBiped>Envelope_Deformer from explorer and right click to start the weight from scratch.
  8. Now your model is enveloped and good to go(at least for now).
  9. 'ValveSource>Export SMD and export as Model (.SMD) to sourcesdk_content\hl2mp\modelsrc\humans_sdk\Male\Group03 directory.

Edit .qc file and compile

  1. Now edit the .qc file... Open sourcesdk_content\hl2mp\modelsrc\humans_sdk\Male\Group03\Male_05.qc
    • Replace "male_05_reference.smd" with the smd file name you saved.
    • Change "$modelname sdk\Humans\Group03\Male_05.mdl" to "$modelname Humans\Group03\Male_05.mdl"
    • Edit $cdmaterials to where you put your model materials,
    • Delete eyeball, eyelid, mouth, flexfile settings(because this model doesn't have them yet), and delete the line $include "../../facerules_xsi.qci" and $lod settings(again, you haven't made one yet)
    Now your .qc file will look like this (in this case your SMD file name is "player_i.smd"):
    /* 
    ============================================================================== 
    
    male05, Group03 
    
    ============================================================================== 
    */ 
    
    
    $modelname Humans\Group03\Male_05.mdl 
    $cdmaterials models\player\ 
    
    //start eye/face data 
    $eyeposition 0 0 70 
    
    // head controllers 
    $attachment "eyes" "ValveBiped.Bip01_Head1" -0.0454 -3.2682 67.3843 absolute 
    $attachment "mouth" "ValveBiped.Bip01_Head1" 0.80 -5.50 0.10 rotate 0 -80 -90 
    $attachment "chest" "ValveBiped.Bip01_Spine2" 5.00 4.00 0.00 rotate 0 90 90 
    
    $model male_05 "player_i.smd"{ 
    
    
    $include "../../bodyrules_xsi.qci" 
    } 
    //end eye/face data 
    
    $surfaceprop "flesh" 
    $bbox -13 -13 0 13 13 72 
    $mostlyopaque 
    $include "../../standardhierarchy.qci" 
    $include "../../standardikchains.qci" 
    $alwayscollapse "Male_01" 
    $alwayscollapse "XSISceneRoot" 
    $proceduralbones "../../male.vrd" 
    $include "../commonbones.qci" 
    
    $includemodel humans/male_shared.mdl 
    $includemodel humans/male_ss.mdl 
    $includemodel humans/male_gestures.mdl 
    $includemodel humans/male_postures.mdl 
    
    
    $pushd "../" 
    $include "../hitbox.qci" 
    $include "../ragdoll.qci" 
    $popd 
    
    Note.pngNote:$includemodel commands in the .qc file point to shared animations. This is also useful when replacing other character models.
  2. Compile the model using the qc file. (Compile your materials, too)

  3. You've replaced the Male_05.mdl with your model. Preview it in HLMV, then load it in HL2DM. Have fun!

From here...