PDA

View Full Version : Problem with my first model, details inside.


Whitestuff
05-30-2007, 11:56 PM
Hi all. I'm new to modding HL2 and I'm trying out all aspects of modding as a hobby. I made a crate in the XSI mod tool, saved it as a scene and exported it (as best I understood) via the XSI Prop Creation Tutorial (http://developer.valvesoftware.com/wiki/XSI_Prop_Creation) on the Valve Source SDK Wiki. My problem initially was that I didn't scale properly and the model was way too big. It also defaulted to the purple and black checkerboard texture in Hammer. Thirdly, it was positioned on the floor, but it was actually sitting halfway in the floor. So, first I adjusted the scaling in the *.qc file which did in fact fix the model's size to what I wanted. But the texture was still screwed up and the model still sat 1/2 in the floor. At that point I went into XSI to fix the problem.

I moved the model up to the y axis 0 point which seemed to coincidentally coincide with the position it was showing up as in Hammer. Then I opened the texture viewer and adjusted my UV coordinates some more thinking that in my state of noobish-ness, somehow I screwed up texturing. **EDIT I figured out why my model at this point would not show up after I placed it in hammer. I used an improper command in the QC file that put it in a seperate directory... oops **

Directory Structure as it stands:
SMD file location: C:\MyMPMod\modelsrc\fragile_crate
-includes fragile_crate (model), fragile_crate_idle, and fragile_crate_phys
TGA file location: C:\MyMPMod\materialsrc\models\fragile_crate

When I compile via studiomdl.exe, the model files are placed in C:\Program Files\Steam\SteamApps\SourceMods\MyMPMod\models\fr agile_crate and the texture, after compiling through vtex.exe is placed in C:\Program Files\Steam\SteamApps\SourceMods\MyMPMod\materials \models\fragile_crate.

Now my scale is fixed and the position is fixed in hammer and the model actually shows up, but I still have the default purple texture and I don't know why. Please someone help with this. I have had this badass uber-crate in XSI for two days and the only thing I can get in game is a purple black crate. :'(

Here is my QC file contents:
// Output .MDL
$modelname fragile_crate/fragile_crate.mdl

// Directory of materials that the model uses
$cdmaterials materialsrc/models/fragile_crate
// Model properties

// model is a static prop
$staticprop

// Material properties
$surfaceprop "wood"

// Scale all units by a factor of 40
$scale 1.0

// Base or Reference .SMD
$body studio "./fragile_crate"

// sequences: all sequences are in $cd
$sequence idle "fragile_crate_idle" loop fps 15

// Physics data
$collisionmodel "fragile_crate_phys.smd" {
$Mass 40
$concave}

I have nothing in the C:\MyMPMod\materialsrc\models\fragile_crate\fragil e_crate.txt file at all. Is this where my texture problem lies?

Thanks all!

Marine
05-31-2007, 12:10 AM
Look in the console, it might say what material it cannot load if you are running developer mode :P

Whitestuff
05-31-2007, 05:01 PM
Ahh..... Thanks. I think I have found the problem. I have spaces in the texture name in the console... odd, I changed over to an underscore type name in XSI before I compiled, but I'll reskin the model completely with the underscored name to see if that will fix my problem.

Whitestuff
06-01-2007, 12:42 AM
NvM. No goodness yet.

I went into XSI and changed the skin totally to a new instance of my texture: fragile_crate.tga. I remapped the UV's to the new unique UV map. I saved the scene and exported the SMD files. I deleted the old MDL files before compiling and then proceeded to compile. I still have no texture on my model.

Here is my QC file:
$modelname fragile_crate/fragile_crate.mdl

// Directory of materials that the model uses
$cdmaterials materialsrc/models/fragile_crate
// Model properties

// model is a static prop
$staticprop

// Material properties
$surfaceprop "wood"

// Scale all units by a factor of X.X
$scale 1.0

// Base or Reference .SMD
$body studio "./fragile_crate"

// sequences: all sequences are in $cd
$sequence idle "fragile_crate_idle" loop fps 15

// Physics data
$collisionmodel "fragile_crate_phys.smd" {
$Mass 40
$concave}

Here is my fragile_crate.vmt file:
"VertexLitGeneric"
{
"$baseTexture" "models\fragile_crate"
"$surfaceprop" "Wood_Solid"
}

Here are my directories:
Model Source Folder: C:\MyMPMod\modelsrc\fragile_crate
Material Sourrce Folder: C:\MyMPMod\materialsrc\models\fragile_crate
Model Destination Folder: C:\Program Files\Steam\SteamApps\SourceMods\MyMPMod\models\fr agile_crate
Material Destination Folder: C:\Program Files\Steam\SteamApps\SourceMods\MyMPMod\materials \models\fragile_crate I also moved a copy of fragile_crate.tga to this folder as well, but no change.

And finally, here is the console error as it stand right now with the qc file and directory structure above:
fragile_crate/fragile_crate.mdl : material "materialsrc/models/fragile_crate/fragile_crate" not found

Anyone have any idea? I'm almost ready to start a whole new box just to see if I can get it to work.

Another question I have:
Once I map the UV's in XSI, do I have to save them or freeze them or otherwise tell XSI that YES I WOULD LIKE MY UV COORDINATES TO BE WHERE I PUT THEM FOR SURE ON EXPORT? I may have missed that step and I'll get it tattooed on my knuckles...

Whitestuff
06-06-2007, 08:19 PM
Simple solution. After watching the video tutorials @ www.iwannamap.com I have figured out that I need to be in the render mode in XSI for the texture to actually "stick" to the model. No where in the wiki is this mentioned. Perhaps it wasn't required when the article was written? Or maybe when the author says to go to Render>etc>etc, they meant "Render Mode" instead of the render menu....

Oh well I hope someone else can benefit from my goof up.