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

Altaco

L420: High Member
Jul 3, 2008
484
120
Incredible hawk. However, could you explain how the collision model works, since I only see a slight difference between the bad and the good collision model, and for some reason my collision models only work sometimes What are the rules for a perfect collision model?

When making the collision model, if you have only one convex shape, as in, there are no areas where it sort of dips into itself, you can leave it alone. However, if your model is concave, like this couch, and has surfaces inside of it you want to collide with, you must make your collision model out of separate convex pieces, it can't be one convex piece or you'll get the shrinkwrap effect. Here's a horrible ms paint example:

collisionmodelsqo2.jpg


separate objects are outlined by blue, the resulting collision model is in red.
 

joeholley

L1: Registered
Aug 26, 2008
11
0
Thanks a bunch for the tutorial, Hawk. Lots of awesome information in there. Although I'm using a pretty different workflow (mostly Max, VTFEdit, and a GUI model compiler) I'm able to get texture-mapped objects in the game.

Unfortunately, I'm now looking around for good embedding tutorials. Would love to see you finish this up!

Cheers.
 

Schmoe

L2: Junior Member
May 18, 2008
60
1
Embedding and Distribution
- I'll fill this last one out after a good night's rest when I'm not completely tired. It'll talk about how to embed your new object and textures into your map file with Pakrat for distribution. This will finish off the tutorial.

This is an important step since uploading custom models and textures to a server w/o using Pakrat/BSPZip will cause your model to not properly load with error messages such as:

Code:
SOLID_VPHYSICS static prop with no vphysics model! (...)

I received this error when I simply placed the model into the server's models directory (even when you have a local copy of the model).
 

katana

L1: Registered
May 25, 2009
9
1
I'm just going to add what everyone else has said...Thank you very much. As a long time Maya user, it was my intention to make a complete map from maya, seeing the workflow makes me realize I'll need to scale back the number of items and concentrate on individual 'points of interest'...Thanks again.
 

Jerkus

L1: Registered
Mar 3, 2009
1
0
Excellent tutorial.

I'm having an issue compiling however, I keep getting this:

Created command line: "C:\Program Files\Steam\steamapps\jerkfaice\sourcesdk\bin\orangebox\bin\studiomdl.exe" -game "c:\program files\steam\steamapps\jerkfaice\team fortress 2\tf" -nop4 -nox360 "C:\Program Files\Steam\steamapps\jerkfaice\team fortress 2\tf\models\player\items\pyro\pyro_hat.qc"

WARNING: AppFramework : Unable to load module p4lib.dll!
qdir: "c:\program files\steam\steamapps\jerkfaice\team fortress 2\tf\models\player\items\pyro\"
gamedir: "c:\program files\steam\steamapps\jerkfaice\team fortress 2\tf\"
g_path: "C:\Program Files\Steam\steamapps\jerkfaice\team fortress 2\tf\models\player\items\pyro\pyro_hat.qc"
Building binary model files...
Working on "pyro_hat.qc"
SMD MODEL C:\Program Files\Steam\steamapps\jerkfaice\team fortress 2\tf\models\player\items\pyro/pyro_hat_reference.dmx.smd
SMD MODEL C:\Program Files\Steam\steamapps\jerkfaice\team fortress 2\tf\models\player\items\pyro/idle.smd
SMD MODEL C:\Program Files\Steam\steamapps\jerkfaice\team fortress 2\tf\models\player\items\pyro/phymodel.smd
ERROR: cannot find bone bip_head for bbox
ERROR: Aborted Processing on 'player\items\pyro\pyro_hat.mdl'

I've double checked to make sure that the bone is in all of my files, but for some reason it still isn't working. I feel like I'm missing something really obvious here- what am I doing wrong?
 

Dr. ROCKZO

L8: Fancy Shmancy Member
Jul 25, 2009
580
159
I recently got mod tool 7.5 and there is not a single tut out there for modelling with it. Does anyone have any experience with it?..
 

3DRyan

L2: Junior Member
Aug 29, 2008
57
6
compiling help

Hey everyone, i'm back!

Thought I had the whole compiling thing down, but apparently not. Here's my compile log:

C:\Program Files\Steam\steamapps\ryansanderson\sourcesdk_content\hl2\modelsrc\ry
an>cd c:\Program Files\Steam\steamapps\ryansanderson\sourcesdk\bin\orangebox\bin
\

C:\Program Files\Steam\steamapps\ryansanderson\sourcesdk\bin\orangebox\bin>studi
omdl.exe -nop4 -game "c:\Program Files\Steam\steamapps\ryansanderson\team fortre
ss 2\tf" "c:\Program Files\Steam\steamapps\ryansanderson\sourcesdk_content\hl2\m
odelsrc\ryan\sign.qc"
all paths:c:\program files\steam\steamapps\ryansanderson\team fortress 2\tf\;c:\
program files\steam\steamapps\ryansanderson\sourcesdk\bin\orangebox\tf\;c:\progr
am files\steam\steamapps\ryansanderson\sourcesdk\bin\orangebox\hl2\;c:\program f
iles\steam\steamapps\ryansanderson\sourcesdk\bin\hl2\
qdir: "c:\program files\steam\steamapps\ryansanderson\sourcesdk_content\hl2\m
odelsrc\ryan\"
gamedir: "c:\Program Files\Steam\steamapps\ryansanderson\team fortress 2\tf\"
g_path: "c:\Program Files\Steam\steamapps\ryansanderson\sourcesdk_content\hl2\m
odelsrc\ryan\sign.qc"
Building binary model files...
Working on "sign.qc"
ERROR: c:\program files\steam\steamapps\ryansanderson\sourcesdk_content\hl2\mode
lsrc\ryan\sign.qc(1): - bad command /


The qc:

/*
----------------
sign QC
----------------
*/

sign.mdl
0 0 0 90
1.0
"Body" "sign.smd"

"carpet"
Z
"ryan/"

"idle" "sign.smd" fps 30

{
//Mass in kilograms
20.0

}


As you can tell, it keeps telling me that the first line is interfering somehow. I've tried just making the first line just "sign.mdl", but it gives the same message. Any takers?
 
Last edited:

Acumen

Annoyer
aa
Jun 11, 2009
704
628
i really don't know where you have that qc-setup from, but mine looks very different. it's been a long time for me, but did you maybe use old hl1 qc-file commands there ? just guessing, though.

anyways, quoting from the valve-wiki there:
"Here is a very simple QC file for a solid model without any animation or special properties (click on each command for details):"

$modelname "props_sdk\myfirstmodel.mdl"
$body mybody "myfirstmodel-ref.smd"
$staticprop
$surfaceprop combine_metal
$cdmaterials "models\props_sdk"

$sequence idle "myfirstmodel-idle.smd" loop fps 15

$collisionmodel "myfirstmodel-phys.smd" { $concave
 

3DRyan

L2: Junior Member
Aug 29, 2008
57
6
Hey, thanks for the response! Yeah, I tried what was on the wiki, and it just tells me that the first line is still causing the problem. Has anyone else had this?
 

DaMaylo

L1: Registered
Aug 16, 2009
5
0
syntax

hey, thanks for this. its pretty awesome! unfortunately it's not fool proof :p and being the fool that i am i managed to mess up somewhere. i made the batch file but i get a syntax error. ill post an image here:

batfile.jpg


hopefully someone recognizes my mistake and can help me fix it.
 

Acumen

Annoyer
aa
Jun 11, 2009
704
628
maybe some further instructions would help. what were you trying to do ? replace an existing model/compile custom model ?
how does the qc-file look.
also from my experience, i'd suggest guistudiomdl for compiling:
http://www.wunderboy.org/apps/guistudiomdl2.php

edit: 3dRyan, you still haven't answered to my offer in your other thread :p
 

DaMaylo

L1: Registered
Aug 16, 2009
5
0
alright! thanks Acumen! that gave me something to work with. my model compiled but doesn't work in the viewer yet... Ill work some stuff out and Ill be back with any questions if i have them. thanks again for the help.
 

Acumen

Annoyer
aa
Jun 11, 2009
704
628
it's really hard with all the files and folder directories. i remember when i tried this all out. i thought i had compiled tons of models for hl1 but still i had soo many mistakes. now i just take my first working qc-file all around and replace folder names accordingly.
if you manage to take that compiling hurdle, you feel quite satisfied if it works for the first time :D
 

DaMaylo

L1: Registered
Aug 16, 2009
5
0
hey, thanks again to Acumen for that link, there are some really awesome plug-ins on that website. so, i managed to get my model to compile and show up in Hammer, the problem is that the texture doesn't show up on the model. though it does show up just fine, colors and all, in the texture slot in hammer when i load the program, so i know the texture works as a vtm. but the model is a flat white color, not even black and purple checkers.... any suggestions? thanks guys!
 
Last edited:

DaMaylo

L1: Registered
Aug 16, 2009
5
0
so, i got the texture to work some how... idk exactly what i did, unfortunately, but wewt none the less.... my next problem is that when i compile my map the custom textures dont show up, i get the black and purple checkers of fail. anyone know what im doing wrong? sry for the noob questions but thanks for the help!
 

Acumen

Annoyer
aa
Jun 11, 2009
704
628
believe it or not, that was the same exact situation i was going through.
it's really unbelievable. first texture didn't work in model viewer, than not in hammer, than not ingame :D

did ou check the ingame console to check for errors ?
maybe you could just post up your entire model source files or atleast the qc and vmt files and paths you set up, so we might check on them if it's all right ?
 

DaMaylo

L1: Registered
Aug 16, 2009
5
0
Alright! Count another success! i finally got it to work! thanks a ton Acumen and Hawk for all the awesome help. It was a directory problem, i just didnt understand how tf looks for stuff. but its all good now! thanks again
 

Rexy

The Kwisatz Haderach
aa
Dec 22, 2008
1,798
2,533
It seems that a lot of people are having some difficulties compiling their models. Now I'm one for doing things the old fashioned way, but making things harder for you during compile is kind of like packing your materials without using pakrat...nothing beats simplicity and ease.

The same is true with compiling models...there's software out there that can save a lot of headache. I used a tutorial from Interlopers.net about compiling models with a free software called context and it really makes compiling models a breeze.

http://www.interlopers.net/tutorials/24774

EVERYONE wanting to compile their models should be using this, just as those who want to include other custom materials should use pakrat. It's just plain dumb not to.

EDIT:

Also, Acumen's link to the wunderboy app is also a good idea. In general I would suggest not using the command line to do it.
 
Last edited:

NiklasU

L1: Registered
Apr 19, 2009
34
1
... great tutorial, but I've still a question ... I'm also trying to make a low and a highres model but what I don't know is: What command line do I have to write in front of that
Code:
 66
{
     replacemodel "officecouch_1" "officecouch_2"
}
 33
{
     replacemodel "officecouch_1" "officecouch_3"
}

maybe it already stands in your tut but I can't find it anyway :(

maybe sb could help me pls