Archive

Archive for October, 2010

Time to make hats.

October 9, 2010 Leave a comment

Yep, I said i was going to make this Took a bit, but i finally got it done.. How to make a hat!

As some may know i put a “what would you prefer” poll on how I should make the tutorial. I decided to make 2 versions.  a text version and a graphic version!

If anything doesnt work or is wrong please leave a comment below.

First the graphic version

LINKS!

How to export SMD:

http://developer.valvesoftware.com/wiki/Category:Modeling

GUI StudioMDL

http://www.wunderboy.org/apps/guistudiomdl2.php

VTFLib

http://nemesis.thewavelength.net/index.php?p=40

Notepad++

http://notepad-plus.sourceforge.net/

Source notepad++ definitions

http://developer.valvesoftware.com/wiki/Notepad%2B%2B_VDF_languages

Now the text version

How To make a hat.

I found it extremely strange when I went to make a hat for tf2 I couldn’t find any tutorials for it! Irregardless I pressed on and made my first hat. Using that experience I will now give a quick how-to get your wonderful hat model into tf2 and on the head of one of the classes.

First off…GET SOURCE SDK!

I’m sure all of you already have it but, for those of you who haven’t treaded into the source sdk waters yet. Your going to need it. More importantly the extras it brings.

Now to setup everything..

Heres what your going to need.

1)a way to export smd files from your favorite model maker. For this go here(http://developer.valvesoftware.com/wiki/Category:Modeling) In the upper right theres a list of the most popular model makers out there, click on yours and follow the instructions to set it up to export smd models.

2)a way to compile smd model files into source readable mdl files. The SDK has it, In a command line… However you can get a GUI version aptly called GUI StudioMDL(found here:http://www.wunderboy.org/apps/guistudiomdl2.php).

3)a way of converting textures into valve texture files. Once again there is a program for it. VTFLib(or VTFedit as I call it.) It can be found here (http://nemesis.thewavelength.net/index.php?p=40)

4)a Handy dandy Text editor. Windows Notepad will suffice however there are others are will help more. I suggest Notepad++ (http://notepad-plus.sourceforge.net/) the VDC even has a language pack that will recognize all the source code and color code it for your continence!(found here:http://developer.valvesoftware.com/wiki/Notepad%2B%2B_VDF_languages)

Now with that out of the way I’ll explain a few basics of what your doing. NOTE: This is me just being techy and explaining how the magical process works. If you want you can skip this and move on to “Compile procedure” This just helps if anything goes wrong you may have a better idea on what it was.

In order for source to read your model correctly you need three things. An MDL(the mesh of your model), a VTF(the texture of your model) and a VMT(The Texture info of your model)

Heres how it all goes into the hat.

[GRAPHIC chart from start to finish]

AS you can see in reality your texture and your model are not in the same file but in fact 2 separate files with additional files to support both.

Compile procedure

1)getting the shape

Now lets get down to it. First off I hope you haven’t made a hat yet. Why? Simple, just as you cant tailor a suit for someone you haven’t even meet. You cant make a hat for a model that you haven’t even seen out of game. And 9/10 your dimensions are all wrong. Lucky for you valve is a kind game developer and provided you the source models of all nine classes! You can find them in your steam folder under Steam\steamapps\[user name here]\sourcesdk_content\tf\modelsrc\player open the class’s folder you want open parts and select your method of import. If you have maya your already set! Otherwise you can import the model by using the SMD.

I suggest saving copies of these files and then modifying the copies!

Work around! Something I had to do to get it to work!(but you may not need to)

If you have an older version of Maya the models may not open. Maya has a tag inside the file that says what version of Maya saved the file. If you have an older one it will refuse to open it. Luckily since valve was kind enough to save them in .ma format we can modify the file to accept older versions! If you are running into this problem simply open the model file in a text editor and search for “2008”(the version valve used) replace all of the references on lines 1-13 with your version of maya. (before the “createNode” line) DO NOT REPLACE ALL REFRENCES OF 2008!!! there are likely some 2008 references somewhere in the sea of vertices below and replacing some may make your model screwed up. Save and it should open now in maya.

With the model of the character you can now make the hat directly on your character! So go ahead and make your model.(or feverishly fix the model you already made but it doesn’t fit.) You should make a texture for your model as well. I assume if you know how to make a model you know how to make a texture for your model.

Divergence

If you are planning on this being a replacement for a current hat then you can ignore this. However, If you want to submit your hat to valve then your going to need to make a physics model a physics model is what is used when calculating impacts with the ground and objects. It should be very simple and convex. Don’t worry about details or anything crazy. Think of it as wrapping your hat in shrink wrap and making a model of the wrap. (where concave spots are covered over.)

2)getting it Boned.

Now In order to tell source where this hat goes. It needs a bone, more specifically it needs a duplicate of the head bone. Usually named “bip_head” however some classes use a different name for the correct bone. Check before using! Create a duplicate of this bone out of the skeleton of the model. Keep everything else the same. Now you can hide the model for the class. You can now move your hat and the bone closer to the center point

From this point on, You will have to be careful with your model as the bone and the model must say the same distance apart In order for the hat to be placed correctly onto the model. Think before doing and when in doubt, undo.

3)get everything exported.

Now you are ready to send everything to source for the first trial. First Export your model into an SMD. You will need 2 files(3 if you made a physics model)

First, Center the pivot point and freeze transformations so XYZ of Translate Rotate and Scale all equal Zero. Do this to all your models(note any children bones may not set back to 0 in translate, this is fine).

Move the bone so its at the center pivot, Move your models with it!

Divergence

If you made a physics model you will need to export it now. Make sure its Center pivoted and frozen just like the other models. You need to also Soften the edges of the model. Export it as a physics model. Finally Hide the physics model when you are exporting the other 2.

Now, Export all(bone and all) as a SMD model. Then export it again as a animation. (not smd animated model!)

Next were going to convert the texture you made into a vtf(valve texture file) Open VTFEdit and import the file.

If you haven’t messed with them don’t touch the options. And press OK your texture should show up in the window. At this point you ready to save it. Feel Free to save it anywhere you want, (we will place everything where it supposed to go once everything is ready. ) Once saved It should have also had made a VMT(valve material Texture) file in the same spot you saved the vtf. If it didn’t turn on “auto create VMT file” In the options drop down and save it again.

Now To setup the information to tell source what it is we made. You will need to configure a few files. A QC file(that you need to make) and the VMT that was just made with your file. Open your handy dandy text editor and begin coding a QC file

this is a basic QC file:

$upaxis Y //you only need this if your modeler’s up axis is not Z(such as maya)

$scale 1 //this scales the model by 1 not really needed but I keep it in case I do later.

$model cowhat “cowhat.smd” {//name it should reference in hammer and the hammer reference model

}

$modelname “zero_rogue\hats\cowhat.mdl” //this is the output path

$cdmaterials “zero_rogue\hats” //location of the texture files

$body “cowhat” “cowhat.smd” //name of starting model

$sequence idle “cowhat_idle.smd” loop fps 1 //name of idle animation

Once finished save it in the same spot as you saved the SMD files.

Now to edit the VMT

“VertexlitGeneric”

{

“$basetexture” “Zero_Rogue/hats/cowhat”

}

Now before we begin to wrap everything up for the first test.

Open Gui Studio and load the QC file. Select Orange box then select tf2. Then hit the compile button.

The compiler output will start showing up a bunch of text. Wait till its done spewing out text. If it says complete, your done if not, read what it says and fix whats wrong.

And your done! Or you should be. The model is finished and in game. However It is likely your model will become misaligned when attached to the player model. So were going to check to see what the model looks like. Open the SDK, set it for tf2, and open the model viewer. Load whatever character model you want the hat on, then hit “Load Weapon…” this will load the hat as an attachment to the model.

The hat is misaligned!

Woops. Now to fix it. Go to your favorite model editor. Show the Class model. Rotate/move the class model so it looks like what it showed in the model viewer. Like this

Now rotate the hat so its correctly placed on the moved class model.

re-hide the class model and repeat the export process.

Once you finish the Gui Studio Refresh the model viewer and see the results.

Much better! Your model should now work correctly in tf2! But how do we do this? You cant just “make” the hat! Well we can do the next best thing. We can replace one! Replacing a hat is basically setting it up to tell source to use your hat model whenever its told to use another hat model.

This is very simple.

1)Open tf2 folder and go into models\player\items\

2)were going to replace the Ghastly Gibus you need to know where the model for the gibus is. (a helpful tool for finding this out is the GCFscape found here: http://nemesis.thewavelength.net/index.php?p=25) for the Gibis is located at: \models\player\items\[CLASS].

3)create the needed folders and COPY(do not move) your model to this spot in the directory. DO NOT COPY THE .phy file! This will lead to errors if you decide to use your hat in other servers.

4)Rename your hat [class]_domination.

And thats it now when you start tf2 host a local server and pick the class equipped with the gibus, the gibus will now look like your hat instead of the gibus. NOTE: The GUI icon and name for the gibus will not change only what it looks like on the character in game.

Congrats! You now have your very own hat in the game.

Please note to see your hat in other servers the server will have had to “white list” hats as movable content. Otherwise they will revert back to the default gibus.


That’s it took a while to make all of that and its most likely I have an error or two.(not the best speller..)

Categories: Uncategorized

well look at that!

October 2, 2010 Leave a comment

Hey I actually did something on time for once! Usually I get sidetracked with another project and leave it in cold storage. Anyways, I said i would get a chart together listing my maps I am currently working on. and Here it is!

(Click on it to make it bigger)

Feel free to spread the chart around. As usual the more response I get for a map the more encouraged I am to work on it. Also commenting on any post helps too. I’m always open to suggestions and often take them and incorporate them into my map.

Oh, and this test server? A good friend of mine was gracious enough to make a server for me and my friends to play and test out maps on.

the ip is 108.13.185.242:27015

add it to your favorites, If you see it on one of my maps then is highly likely I’m in it testing out a new iteration or just having fun on a map.

Categories: Uncategorized
%d bloggers like this: