Cleanup is going to take awhile, so the site is back up but editing has been disabled.

V37 Modeling (Beta)

From HalfLife 2 Knowledge Base

Jump to: navigation, search

Contents

Intro

This tutorial is a compilation of multiple tutorials that talk about various aspects of creating a version 37 half-life model. Also it contains segments from other sources too, like valve and milkshape 3d (Recommended).

Preparation

Obtain a 3d modeler (ie 3Dstudio Max, Milkshape, XSI, etc.) and install it. Copy studiomdl.exe and all the .dll s from the %hl2dir%\bin to %hl2dir%\hl2 (it wont work in the bin dir).

Modeling

If you are porting from a previous model system version, ie HL1 models, then skip this section.

Build you model and make you sequences. When you make you models do not make the model with negative coordinates. This will create clipping of the model into the ground. Its probably because of the fact that HL2 is a physics based engine. Compile the .qc but not the model.

Converting/Porting

If you have made a custom model then you can skip this section.

Take your model that you want to convert and place it in a folder by its self. Now you need to decompile the model. There are a couple of programs out there that will let you do this, I used Milkshape 3d to do it. After you have decompiled the .mdl into its seperat sequences then you need to open up all of the sequences and Shit the whole model 0,37,0 on the xyz axis, this is to prevent clipping with the level ground.


Preparing Textures for compile

Before you can compile a model you need to convert the textures into the new vtf/vmt format. Open up the textures with a image editor of some sort like photoshop, and resave the picture as a 24bit targa (.tga) image.

Copy the .tga to:

For a player: %hl2dir%\hl2\materialsrc\models\player\[player model name]

For a weapon: %hl2dir%\hl2\materialsrc\models\weapons\[weapon model name]

For a misc model: %hl2dir%\hl2\materialsrc\models\[model name]

If the folder does not exist then create it.

Ok now goto dos or cmd and go to the %hl2dir%\bin folder Then type:

tga2vtf –shader VertexLitGeneric %drivehl2islocated%:\%hl2dir%\hl2\materialsrc\models\player\[playermodelname]\[texturename].tga If every thing went right then you should have a new vtf/vmt in %hl2dir%\hl2\materials\models\player\[player model name].

Preparing model for compile

Ok now you have to put all you .smds and .qc file in to the the same folder you did with the textures, but with out the materialsrc in the path name. so using the same model as above:

%hl2dir%\hl2\models\player\[player model name]

Now open the .qc file with a text editor. The .qc file is made for compilation into a HL1 model and not a HL2 model so we are going to do a lot of recoding, but nothing to hard. Here is an explaination of a basic HL2 .qc file:

$modelname %hl2dir%\hl2\models\player\[player model name]\[playermodelname.mdl]
$scale (size scaling)
$controller # <bone>
$body "Body" %hl2dir%\hl2\models\player\[playername]\[basemodel].smd 
$bodygroup [groupname]
{
[groupname] “[sequence.smd]”
}
//sequences (movement animations)
$sequence (sequence name) (sequence .smd) [smd name]  [event <#> <frame> [options]]  [fps <#>] [origin <X> <Y> <Z>] [rotate <angle>]
[scale <#>] [loop] [frame <start> <end>] [blend <axis> <start> <end>] [node <#>] [transition <start> <end>] [rtransition <start> 
<end>]
//hitboxes
$hbox <group #> <bone> <X> <Y> <Z> <X> <Y> <Z>
//hand attachments
$attachment 0 "Bip01 R Hand" x,y,z
$attachment 1 "Bip01 L Hand" x,y,z
//collision models
$collisionmodel "[basemodel.smd]" 
{  
$concave 
$mass [weight in kilos]
}

If your .qc file has more than 160 lines of code it wont compile.

Compiling

In dos/cmd goto %hl2dir%\hl2 and type in:

Studiomdl %drivehl2islocated%:\%hl2dir%\hl2\models\player\[playermodelname]\[model.qc]

If everything goes right you should have you model. If you have problems check the associated step to figure out what went wrong.

--Omega552003 04:16, 10 Nov 2004 (EST)

Personal tools