Cleanup is going to take awhile, so the site is back up but editing has been disabled.
Static Models
From HalfLife 2 Knowledge Base
Writen by Sean Mcbride (n30g3n31s) for the forsaken team modified for the guys at hl2world.com
A quick explination on how to get models from 3d studio max into hl2.
Yes I know there is another statics tutorial, but this one is for the totaly new user. If you don't know anything about the source engine you'll be able to follow this.
Until I have a mirror I'm going to reference to my thread for the zip file. If someone wants to mirror the file and edit the tutorial it would be much appreciated. :)
Collection of Template files: http://www.hl2world.com/bbs/viewtopic.php?t=19224 (you must be logged in to download this file.)
Contents |
Introduction
You'll need a SMD exporter, the ones that worked for hl1 work for hl2 also as far as statics go so grab one of those. I think this is the one I'm using. I found the link in a thread on mapcore.net.
http://www.w00th4x0r.com/smd/d-exporter-for-max6.zip - This works for 7 also.
Ok, to start you need to have a place to compile your models. You have 2 options.
1) Go to your steam game list and double click on Source SDK. After it downloads and the menu opens there should be a "Create a Mod" option right under "APPLICATIONS". Double click that and steam sets up everything for you. Just type in the paths you would like to use. For this tutorial I just used C:\ because I wanted the shortest path possible. The next edit box you can name whatever you like. In the paths i give this is *Your Mod Name*. That's it for the setup just extract the zip file that this tutorial comes in into your c:\HL2Mod\*Your Mod Name*\ . After its all said and done and you compile everything you can just copy the files you create into any models and materials directory. They work as long as you keep the file structure and names the same.
2) Modify all the paths I give to match your paths in your mod. It'll be a chore so your probably better off working with the first option.
Listing of Replacement Strings
In Tutorial:
*Your Mod Name*
*Model Name*
In Files:
_ModName_
_ModelName_
_UserName_
_TextureName_
Directory Structures
DONT IGNORE THIS SECTION!
You must use these paths to use the supplied batch files.
Static SMDs: C:\HL2Mod\*Your Mod Name*\modelsrc\static\*Model Name*\
Static TGAs: C:\HL2Mod\*Your Mod Name*\materialsrc\models\static\*Model Name*\
While compiling they save to...
Static MDLs: C:\HL2Mod\*Your Mod Name*\models\static\*Model Name*\
Static VTFs: C:\HL2Mod\*Your Mod Name*\materials\models\static\*Model Name*\
You MUST create the destination directories otherwise you will get a "write protection error" message!
Exporting your model from max
Refer to the image below for scales and a few useful bits of information.
1) Apply Material id's, in edit poly or edit mesh modes, to the sections of the model you want to have a specific texture. (You MUST do this even with 1 texture).
2) Make a multi/sub-object material in the material editor and apply it to your object. (You MUST do this even with 1 texture).
3) Set the number of textures you have in the multi-sub object and apply it to your model.
4) Load the textures in TGA format into your multi/sub-object in TGA from anywhere.
5) Make 1 bone by clicking on the very center (0,0,0) and then right clicking. It'll create 2 joints (1 bone). (Check screen shot)
6) Apply a physique modifier to your model and attach your simple rig as the node.
7) Click the plus next to Physique in the modifier list and select vertex.
8) Select all of the verts and click assign to link. Then click the green plus symbol, set "Blending between links" to "No Blending", and click on your bottom bone at 0,0,0. All the verts should turn green.
9) File->Export and select Valve SMD. Save your model (check directory structure up top) as a reference using your exporter and call it *Model Name*_Ref. Then export the same model again as a skeletal animation and call it *Model Name*_Still.
Compiling your Model
1) Go to modelsrc\static\ and rename _ModelName_ to your models name.
2) Take the supplied QC file in the same directory you just renamed and name the QC file the same.
2) Take the supplied QC file and rename _ModelName_ to the models name and _ModName_ to your mod name.
3) Take the batch file supplied (located in modelsrc) and rename "Compile _ModelName_" to "Compile *Your models name*"
- If you installed with the regular steam path*
4) Edit the batch file and change "_UserName_" to your steam user name.
- if you didn't*
4) Edit the batch file and change the path to where your studiomdl.exe is.
5) Edit the batch file and change "_ModelName_" to your models name and "_ModName_" to your mod name.
6) In *Your Mod Name*\Models make sure all the directories that you have in your Forsaken\Modelsrc are in *Your Mod Name*\Models too. The compiler doesn't make the directories. It will fail if the same directory names aren't mirrored here.
7) Run the batch file and make sure you've read the Directory Structures section or you will get a write protection error.
Compiling your Texture
1) Go to *Your Mod Name*\materialsrc\models\static\ and rename _ModelName_ to your models name and put your TGA files there.
- NOTE*** You must put your MODEL textures in the materialsrc\models\static\*Model Name* directory NOT materialsrc\static\*Model Name*. Source doesn't know where they are Otherwise.
2) Go to *Your Mod Name*\materialsrc\ and edit the supplied file "Compile _ModelName_ Textures.bat" with the correct _ModelName_, _UserName_, _TextureName_, and _ModName_.
- NOTE*** your texture names must be the same as when they were in max. Otherwise Source thinks they were named what they were in max.
3) Just like with the model compile process, be sure and create a "mirror" of your directories. Just create the same directories in your "materials\models" folder.
4) Run the batch file!
5) Go to your *Your Mod Name*\materials\models\static\*Model Name* directory and there should be 2 files. A VTF and a VMT. Open the VMT with a text editor.
6) Right After the "$baseTexture" Line create a new line and add
"$model" 1
7) Your done!
I hope this was helpful. I'll catch you guys in the forums!
-n30g3n3s1s


