Cleanup is going to take awhile, so the site is back up but editing has been disabled.
Static and Physics Models with HL2 Compile Toolkit
From HalfLife 2 Knowledge Base
by Some0ne
This tutorial is about how to get static or physics models ingame and not how to actually make models. There are plenty of tutorials around on how to model and there are also several ones on this site for making collision models.
Contents |
This tutorial is not for any particular modeling programme and it just describes what you have to do in general terms and so you should be able to use it for any modeling programme. However, the modeling programme used must have a SMD Exporter. If the programme you used to model it does not, then you probably can export/import it to another which does.
Setting up and Exporting the Model
Start by opening your reference model in your 3D modelling programme. Make sure you have a UVMap and a material(texture) on the model.
Firstly, you need to create a joint(bone) and place it anywhere on your model. Assign all your model's vertices(points) to this joint and export this file to a reference SMD file. Its best to give it a descriptive name such as "sample_ref.smd".
Now, with the same model still open in your 3D app, delete all the model's polygons and its materials, but leave the joint. Merge your collision(physics) model with this file - depending on what programme your using, you may have to open the model up seperately and copy it in.
When i say "merge" i basically mean get your collision model into the other model file with the joint in it.
Make a material for this model with a name like "phys_skin" and give it a texture. The safest way to ensure this will work later is to give the material an image texture file - it doesnt matter what it is, you could give it the same file you used for your reference model.
Assign all your collision model's vertices to the joint you created at the start, it should still be there if you havent done anything wrong. Finally, export this model to a reference SMD if your using Milkshape or 3DS Max or all modelling apps except XSI(as far as im aware) in which case choose to make a physics SMD file.
For the rest of this tutorial you will need this programme, HL2 Compile Toolkit. I advise reading the 'how to use.txt', but you dont have to to follow this tutorial.
Creating the QC File
So far there is no difference between making a static and a physics model. But the change comes when making the QC file. However most of the options are the same except physics models have a few more.
Launch "HL2 Compile Toolkit.exe". If you have never run the programme before, the default settings in the opening window are an example and you must change them.
In the first text box enter your 'Steam\SteamApps\username' directory, choose the game the model is to be compiled for from the combo box, type in the name of your model in the next text box, and click the option 'Prop Model'.
Hit OK and in the next window select 'Create QC File' and click Next. Choose which type of model it is for and click Next again. It is in here that you will set up model's QC and how it will "behave" in game. But ofcourse, if its a static prop then it will not "behave" because it cant move.
Enter the name of your reference model in the 'Reference Model Name' text box and do likewise for your collision model. Specify a scale for your model. You'll probably want to leave this at 1 but its an easy way to scale your model up/down if its too small/large. You can also use the 'Real Scale' feature to set the the scale to change the model to "real world scale" in hl2 - if it has been modeled at "real world scale". this is app-dependant, meaning that it will work for models made in certain modelling programmes. Im not sure but i think it works in most apart from XSI.
Choose a surface poperty from the 'Surface Prop' combo box which suits your model's material best. This setting is linked to the "$surfaceprop" setting available in VMT files. If your making a physics QC then enter a value for mass or select 'Automass', which impliments the "$automass" command. This makes the model's mass automatically calculated by the compiler. And choose a 'Prop Data' setting. This setting determines some ways in how the model will "react" to the game's physics. It will also make it breakable if you choose a value like "wood".
All that's left to do for the QC file is add a sequence. To do this click the 'Edit Sequences' button. In here click Add. Enter the name of your reference model SMD file into the 'Filaname' box, type "idle" in the 'Event' text box and input a value of 1 for FPS. Click OK and click Close.
To save the settings for the QC click Save in the bottom-right corner. Once you've saved this hit OK and save the QC with the name of your model and put it with your other model files.
Here's my finished QC file for my physics prop "sample":
Compiling the Model
Make a folder in "hl2_compile_toolkit_dir\model_compiling_files" with the name of your model. Put all the necessary files into this folder, thats the 2 SMD files, any TGA texture files and the QC file.
Go back to HL2 Compile Toolkit and choose the 'Run Compile Script' option. In here select Compile Textures, Compile Model, Copy to Game and Open VMT Files if you want to edit your VMTs. Hit OK and if you want want to edit your VMTs then click Yes to the message which appears.
Wait for the compiling to finish, then load Model Viewer from Sourcesdk and view the model which can be found under "models\mymodels". To see your collision model tick the 'Physics Model' check box and a red wireframe of your collision model will appear.
and that's all there is to it.
if you have any questions, comments, need help or want to contact me for any reason then you can email me at: some0ne606@yahoo.co.uk
Also, if you have any problems or anything with HL2 Compile Toolkit then contact me aswell



