[TUTORIAL] Complete Guide to Adding Custom Objects to your TF2 Map

oxy

L5: Dapper Member
Nov 27, 2007
208
30
Ok.. so I tried to create a simple cube for my collision SMD. Made it in Maya did a simple UV projection. Then exported it as .obj. I brought that into ModTool. Applied the same texture. And then exported as SMD.

Same error.

Ugh.. and to think am I a pretty smart guy. Valve could deff make this easier.
 

Termaximus

L5: Dapper Member
Jan 11, 2008
229
32
Nice Work. Quick texture questions.

First off, nice tutorial Hawk. I must say though that it has made me realize I do not want to fool with custom objects for my map cp_2skyscraper as it appears to have a steep learning curve and I have already neglected my TF2 play time learning how to map.

I do have a slightly unrelated question. You had mentioned that textures for objects must be power of two and the same for width and height (that is 256 x 256, 128 x 128, etc). I wanted to see if this applies for reg textures. I have been doing some basic photoshoping for textures for my map and have seemingly succesfully used dimensions of 256 x 128, 512 x 256, etc for textures that are not square in nature (for paintings, posters, etc). This seems to work when I compile and test map. Is their something I am missing and that could cause others problems when I release beta 3?
 

YM

LVL100 YM
aa
Dec 5, 2007
7,135
6,056
I do have a slightly unrelated question. You had mentioned that textures for objects must be power of two and the same for width and height (that is 256 x 256, 128 x 128, etc). I wanted to see if this applies for reg textures. I have been doing some basic photoshoping for textures for my map and have seemingly succesfully used dimensions of 256 x 128, 512 x 256, etc for textures that are not square in nature (for paintings, posters, etc). This seems to work when I compile and test map. Is their something I am missing and that could cause others problems when I release beta 3?
Are you using pakrat to embed the files into the BSP (any custom content has to be inside the BSP file for other players to get it)
 

Hawk

L7: Fancy Member
Dec 3, 2007
419
213
Ok.. so I tried to create a simple cube for my collision SMD. Made it in Maya did a simple UV projection. Then exported it as .obj. I brought that into ModTool. Applied the same texture. And then exported as SMD.

Same error.

Ugh.. and to think am I a pretty smart guy. Valve could deff make this easier.

Well, I had a good look at the problems you're running into, and I'm baffled as well. It looks kind of like you have double geometry in that ball picture. And I know the color lines mean something, but I don't know what. I'm honestly not too great with XSI, which is why I do the bulk of my modeling in Maya.

However, one of my buddies at work specializes in XSI and I may be able to ask him what's going on.

One of the real problems with taking files between packages is that certain information can linger like ghosts, undected but causing errors. Certain things like deleting the history or script-driven rebuilds can help, but it's all a tricky matter.

Let me see what I can find out, then I'll get back to you.
 

Hawk

L7: Fancy Member
Dec 3, 2007
419
213
I do have a slightly unrelated question. You had mentioned that textures for objects must be power of two and the same for width and height (that is 256 x 256, 128 x 128, etc). I wanted to see if this applies for reg textures. I have been doing some basic photoshoping for textures for my map and have seemingly succesfully used dimensions of 256 x 128, 512 x 256, etc for textures that are not square in nature (for paintings, posters, etc). This seems to work when I compile and test map. Is their something I am missing and that could cause others problems when I release beta 3?

To my knowledge, those somewhat irregular textures should work. I think the Source engine just chops a 512x256 image into two 256x256 images and uses them just as efficiently. And I've seen textures among the Valve textures that are similarly proportioned. You just have to stick with those magical numbers: 128, 256, 512, 1024, etc.
 

oxy

L5: Dapper Member
Nov 27, 2007
208
30
Hawk. Thanks a bunch. If you would like the files I am working on. I have followed your tutorial a few times. I am able to get my reference/high poly to compile so worse come to worse I will just build my collision with brushes.
The only thing that has me worried is how rigging and animation my ambulance doors is going to go. :001_huh:
 

Hawk

L7: Fancy Member
Dec 3, 2007
419
213
Okay, oxy... I talked to my friend at work and he showed me that those discolored lines on your mesh mean that the vertices on that line are not welded. Try welding them and see what that does for you. If all else fails, zip things up for me and I'll see if I can get it working.

It's becoming more evident that the problem lies in the construction of the mesh itself.
 

Jive Turkey

L3: Member
Jan 22, 2008
120
32
Just wanted to report a success here. Your tutorial took a lot of the guesswork out of this so I thank you. I'm making a few models for a friend's map and I'll probably eventually be posting them in that oft-neglected content section of this site for anyone who wants more generic stuff with which to tart up their maps. If I can do it anyone can so I hope we get more content to play with and tutorials like this might aid that. Thanks again.

PS. If you're having trouble with "unable to load module" type errors, as I was, then start Source SDK and click "Refresh SDK Content." That should fix it, although I still get an error about p4lib.dll. My models seem to compile fine anyway.
 

oxy

L5: Dapper Member
Nov 27, 2007
208
30
Thanks for all your help.

I have finished modeling and texturing the ambulance. See this thread http://forums.tf2maps.net/showthread.php?t=1005&page=7

I have also rigged and animated it to the best of my ability.
After compiling it (still without the collision model) the door and headlights disappear. When I imported it they were separate objects. Is there something special I have to to in order for them to be exported correctly?

..oxy..
 

Buddikaman

L3: Member
Dec 31, 2007
107
11
I wanted to thank you for writing this tutorial, it has helped me greatly in figuring out how to import my custom stuff into the game, thanks!

-Buddikaman-
 

Hawk

L7: Fancy Member
Dec 3, 2007
419
213
You're welcome!

I really should just finish the thing off and write up the part about Pakrat. I've just been so distracted with working on my map.
 
Dec 25, 2007
566
439
I too found this thread invaluable, after Buddika pointed me in its direction. I spent a couple of hours trying to figure out how to make a concave physmodel in XSI, and the answer was right here all along!

props!
 

Spike

L10: Glamorous Member
Feb 13, 2008
716
82
great tutorial, but I'm having troubles with the collisions.

Can you tell me how I'm supposed to make the collision model of this palm? (just the trunk)

palmcollisiondl5.jpg
 

Hawk

L7: Fancy Member
Dec 3, 2007
419
213
great tutorial, but I'm having troubles with the collisions.

Can you tell me how I'm supposed to make the collision model of this palm? (just the trunk)

You know, I'd just make a single simple cube that tilts up in the direction of the trunk so that it encases it. Something like that doesn't need complicated collision, nor would anybody even notice if it did.
 

timberghost_paintball

L2: Junior Member
Dec 19, 2007
77
200
First off great tutorial.

I figured out how to get my model compiled but I get a purple/black error texture.
here is a screen grab of the texture info app.
textureerror.jpg

the strange thing in the image seems to be the .vmt instead of .vmf in the file. I'm not sure if this is an error or how to change it.

the other strange thing is that the uv's are perfect in maya and softimage mod tool when textured with a .tiff but when a identical .vtf is applied in s.m.t. the textures are slightly off from left to right on the image. I deleted history before going to s.m.t. and the obj does work with tiff just strange with vtf. I'm not sure if this has to do with the error texture.


here is the text from the .qc file
/*
----------------
teledome QC
----------------
*/

$modelname teledome.mdl
$origin 0 0 0 90
$scale 1.0
$body "Body" "teledome.smd"
$staticprop
$surfaceprop "metalpanel"
$upaxis Z
$cdmaterials "teledome/"

$sequence "idle" "teledome.smd" fps 30

$collisionmodel "teledome_coll.smd"
{
//Mass in kilograms
$mass 20.0
$concave
}


So I'm not sure were to go from here, any help would be great
 
Last edited:

Hawk

L7: Fancy Member
Dec 3, 2007
419
213
Hmmm... I can't tell what the problem is just yet, but I'll give this a deeper look really soon (hopefully tonight). Maybe I can figure out what the problem is.
 

timberghost_paintball

L2: Junior Member
Dec 19, 2007
77
200
I figured it out. The texture shader was saved as a .vmf not a .vmt which is what the texture info app said it was looking for. additionally the wierd uv thing in the softimage mod tool is fine in modelviewer so I guess that was just a s.m.t. bug. The other thing I changed was the formating of the .vmt name to match the texture info app's name by changing "teledome.vmf" to teledome color.vmt" I think this was caused by me changing the texture name after I had assigned it to the model in s.m.t. while the new name worked it didn't jive with the model.

Anyways, many thanks for the help and the tutorial. You might want to double check your tutorial though, in it you call the script that accompanies the textures a ".VMF" and from my experience and the other resources I checked I think it might be ".vmt" then again I may be confused but either way it's working so thankyou.
 

Hawk

L7: Fancy Member
Dec 3, 2007
419
213
I'm glad you got that figured out. It's nice to hear another TF2 map will have some fun custom objects.

And you're totally right about the VMF/VMT deal. I must have mixed up the extension with a Hammer map's extension as I typed this. Thanks for telling me about it. I've gone through and corrected the problem.
 

3DRyan

L2: Junior Member
Aug 29, 2008
57
6
A little bit of confusion....

You say that one unit in hammer equals one in maya. And that 16 units in hammer and maya equals one foot. So, I take 16x6 to get the approximate size of a human. All seems well, but I compare it to a model that I previously put into hammer that turned out being WAY too small, and it's about the same size. Very tiny compared to the size of a human model. I reset to default settings in maya which is centimeters for units. Am I doing something wrong here?

BTW: Awesome tut! First one on the net that actually makes sense and is accurate as can be. Thanks to you, I can actually *GASP use custom models! Thanks so much!
 
Last edited: