Compiling a model problem Created 18 years ago2006-06-08 19:12:30 UTC by Xyos212 Xyos212

Created 18 years ago2006-06-08 19:12:30 UTC by Xyos212 Xyos212

Posted 18 years ago2006-06-08 19:12:30 UTC Post #184337
Ive been following BJ's modeling tutorial here, and Ive ran into an error. The part where I drag my .QC file to studiomodel.exe is the problem. Instead of information on the model being displayed, the DOS window flashes up for a second, no information, and does not compile the model. Can anyone help me?
Posted 18 years ago2006-06-08 19:20:18 UTC Post #184338
Postin' yer .qc file content could be o' use here. ;)
Posted 18 years ago2006-06-08 19:29:34 UTC Post #184341
This is a prop static BTW.

Here is the qc file:

$modelname Bench/Bench.mdl
$cdmaterials models/Bench
$staticprop
$scale 1.0
$body studio "Bench_ref.smd"
$sequence idle "Bench_idle.smd" fps 1
$collisionmodel "Bench_phys.smd" {
$Mass 20
}

I dont know if this is useful, but when I exported to SMD, all I did was type the name of the file in the box. (Bench.smd) it saved the SMD in the XSI folder. SHould I actually put the directory in that box? (I did that, but XSI froze)
Posted 18 years ago2006-06-09 00:33:56 UTC Post #184353
Dragging doesn't work unless you setup an environment variable, which, I am clueless on exactly it is. Make sure to move the .smd to a folder within the steam folders (like mymod/modelsrc)

However, if you open a command prompt to the /sourcesdk/bin folder, and type: studiomdl c:/*path to .qc file*/name.qc

Should work fine.
Posted 18 years ago2006-06-09 09:05:51 UTC Post #184389
The window flashing for just a second is because studiomdl found a problem and is outputting a short message to that effect.

I recommend exporting the smd to the sdk folder, not XSI.

You do need to set up an environmental variable and must have the directories setup correctly.

Take a look at the Source modeling setup tutorial and be absolutely certain you have the directories setup correctly. Pay close attention as some of the folders are in the HL2 game directory and some are in the sourcesdk directory and their names are slightly different.

studiomdl will not make folders for you, btw.
Posted 18 years ago2006-06-09 10:08:07 UTC Post #184398
I set the VPROJECT table up, and took a look at the files I had. I had a "Bench.smd", but it would not compile correctly. So I changed it to Bench_ref.smd. It compiled, but I ended up with some weird shapes that was not the Bench I made.

I think my problem now is exporting SMD files from XSI. XSI saves the file as a .scene, or .exp file. I try to export that as SMD, and I get some weird model I didnt make.

Here is a screenie: http://img400.imageshack.us/img400/3237/arrows1ad.jpg

The blue arrow indicates the compiled SMD opened back up. That is not my bench model.

The red arrow is the Export SMD option. Here when I choose the directory for my bench.exp to be exported to SMD it freezes. When I type Bench.exp in it, it compiles and I get that weird object.

Am I not correctly saving this, because when saving .scene and .exp are the only options.

Is something wrong with my Valve add-on for XSI?

I know the saving process is the problem. Can anyone help?

Oh and thanks for the help with the directories :)
Posted 18 years ago2006-06-09 14:38:36 UTC Post #184435
Ahh, I figured it out. I did the saving incorrectly, and did not properly UV map and save. I figured this out through iwannamap's video tutorials. Good stuff, good stuff :)
Posted 18 years ago2006-06-09 19:11:24 UTC Post #184448
I would suggest that you use the default environment variables and environment projects (sourcesdk_content/game name) instead of using your own setup. This greatly reduces the chance for problems to occur due to directory structuring and such, and leaves you the opportunity to isolate problems to the QC file and model itself.

Also I suggest running studiomdl from the commandline - Changing directory with a
cd "%sourcesdk%bin
command and then executing it with the command
studiomdl "C:location of QC file"
. This allows the window to remain open once the program terminates allowing you to view any output it gives you (this includes errors and other problems to take note of.)
RabidMonkey RabidMonkeymapmapmapfapmap
Posted 18 years ago2006-06-09 20:57:05 UTC Post #184467
Thanks Rabid. and BTW, I didnt figure out the problem :( I did however get closer to compiling the model. It compiled, but the model has a big cube in the middle for some reason, along with a random cylinder floating in the air. Also I didnt get the texture directory correct.

Here is my new .qc file:

$modelname "Bench/Bench.mdl"
$scale 7.0
$staticprop
$body "Body" Bench.smd
$surfaceprop "metal"
$cdmaterials "modelsweightwrap"
$collisionmodel "Bench" {
$concave
}
$sequence idle "Bench.smd" fps 15 ACT_IDLE 1

Here is the line I believe is the problem: $cdmaterials "modelsweightwrap"

"weightwrap is the name of my UV map VTF file.

should this be: models/weightwrap? My directory goes modelsBenchweightwrap.

EDIT: Rabid, the command cd "%sourcesdk%bin does not work...

Oh, and here is a screenie of what is supposed to be a weight set, but has a cube in it for some reason.....

http://img85.imageshack.us/img85/7205/weights8zh.jpg
Posted 18 years ago2006-06-09 21:55:19 UTC Post #184471
Your $cdmaterials parameter should point to the directory where the texture is stored. Don't use the name of the texture itself. That's specified in the smd.

Again, take a look at the setup tutorial. The directory setup is important.
Posted 18 years ago2006-06-10 13:59:05 UTC Post #184571
%sourcesdk% should be an environment variable for the SDK setup if you didn't modify the existing variables. Try removing the percentage sign from the end and see if that works. Sometimes you have to do:
cd "%sourcesdk%
cd bin
Instead of one giant command. Try a couple of things.

No clue about the cube ;P - Make sure your materials are applied properly in XSI and also make sure that all hidden objects are deleted, unless you use export selected (hidden items get exported as well) - Was that your size reference or something?
RabidMonkey RabidMonkeymapmapmapfapmap
Posted 18 years ago2006-06-10 15:33:12 UTC Post #184584
IM a little closer. I accidently had LightmappedGeneric instead of the "Vertex bla bla" in the VMT. At least my weight set is textured. BUT, I still have a pink and black checkered box over my model with a random cylinder on top of it for some reason.

Is this because I made no collision model? I let the compiler make one. Collision must be saved as .phys with Valvesource exporter correct?

Ill try a simple model, UV map it, then compile and see if that ends up with the dreaded pink and black checkered Box with a random cylinder.....
Posted 18 years ago2006-06-10 19:03:21 UTC Post #184612
I tried the sourcesdk enviornment project in command.com and it does not work. I tried everything. I already have sourcesdk as an enviornment project. What am I doing wrong? I really need to see the errors in the log!
Posted 18 years ago2006-06-10 20:01:29 UTC Post #184627
Ha I got it to work! Silly me I accidently left 2 cylinders and a cube (small parts of the model) un-merged and not with the UV map! God the smallest mistake cost me so much frustration!!!

Now I can finally go on to making a wicked awsome static prop!

BTW does anyone have any good links for advanced UV mapping techniques?
Posted 18 years ago2006-06-10 20:51:36 UTC Post #184631
Posted 18 years ago2006-06-10 21:23:02 UTC Post #184634
Nice, thanks BJ :)
You must be logged in to post a response.