DigitalEro Offline

Help with skingroups

Sun, 01 Dec 2013 08:01:42

Mikey

Hello. I need some help with making skingroups. I've got this site https://developer.valvesoftware.com/wiki/$texturegroup but I don't understand what to do exactly. First I decompiled the model and got .qc file. And what next? I tried adding $texturegroup under the $model line in .qc . Shit, I don't know how. My additional skin must has VMT format? Can someone tell me with a sample model, please? It will work with Bodygroup Changer tool?
Sun, 01 Dec 2013 11:46:27

Ganonmaster

Skingroups or texturegroups are basically alternate materials/textures for your model. Example: the samara model I released has three different skins. Two wet skins, one regular. Here's a cut down version of the QC file:
$modelname	"mass_effect/samara.mdl"
$mostlyopaque

$model Samara "Samara.smd" {
//flexes go here, etc.
}

$texturegroup "skin_specular"
{
	{"samara_body"}
	{"samara_body_wet" }
	{"samara_body_wet_other"}
}
The texture group is named skin_specular. samara_body.vmt is the name of the default material file. samara_body_wet.vmt is the name of a different material file which contains different values. Sometimes, a model has more than one material file by default. For example, there's one texture for the body, one for the head. In that case, the syntax goes like this:
$modelname	"mass_effect/samara.mdl"
$mostlyopaque

$model Samara "Samara.smd" {
//flexes go here, etc.
}


$texturegroup "skin_specular"
{
	{"samara_body" "head"}
	{"samara_body_wet" "head_wet"}
	{"samara_body_wet_other" "head_wet_other"}
}
It's really simply stuff.
Sun, 01 Dec 2013 20:27:37

Mikey

Many thanks! That's really kind of You. Using the opportunity, can You tell me how can I make a wet skin? I know it's not hard to do. Is it just edit of the .VMT file? Phong? And just one more little thing not related with skin groups. I believe that such experienced guy like You knows the answer. The green ring. The effect. How turn it into a prop? For example I just extracted Towel_rack from L4D Props_interiors. Someone once said I need to add a physics file to the model. I dunno how? Can You help with this too?
Sun, 01 Dec 2013 21:33:08

Ganonmaster

"Mikey" said ...
Many thanks! That's really kind of You. Using the opportunity, can You tell me how can I make a wet skin? I know it's not hard to do. Is it just edit of the .VMT file? Phong?
Yes, Phong. Try playing with the values until you get the results you want.
"Mikey" said ...
The green ring. The effect. How turn it into a prop? For example I just extracted Towel_rack from L4D Props_interiors. Someone once said I need to add a physics file to the model. I dunno how?
The person who said that was right, you have to make a collision mesh. When the game calculates collisions with a model, it has to do a lot of calculations to see where which polygon touches the ground and move the model accordingly. When you are dealing with models that have a lot of polygons, this is an expensive process and will slow down the game significantly. So, what usually happens is that for every model, you create a collision model that sort of matches the shape of the object but with a lot less polygons. For example in the image below. You see the regular model with its material applied has a lot of polygons and detail, and the collision model (red outline) is a simple box. In practice, once you have exported your model's main smd file like the towel rack you mentioned, you have to make a collision model that kind of matches the outline of that model. Export that as a second smd file. Then include it in your QC as follows:
$collisionmodel "name_of_your_collision_model.smd"
{
	$mass 350.0
	//mode options go here
}
The $mass parameter is the weight of your object in kilograms. General information can be found here, and other parameters for the $collisionmodel command you can find here. Note that $collisionmodel only works with static props. If you want to create a ragdoll, you need to rig multiple objects to your ragdoll's skeleton and use $collisionjoints in your QC.
Mon, 02 Dec 2013 20:36:45

Mikey

Beautiful!
"Ganonmaster" said ...
you have to make a collision model that kind of matches the outline of that model. Export that as a second smd file.
Sorry for bothering You again. :/ But here's another question: how can I make that collision model? Which program? Modelling one or maybe just a compiler somehow?
Mon, 02 Dec 2013 21:13:07

Ganonmaster

"Mikey" said ...
Beautiful!
"Ganonmaster" said ...
you have to make a collision model that kind of matches the outline of that model. Export that as a second smd file.
Sorry for bothering You again. :/ But here's another question: how can I make that collision model? Which program? Modelling one or maybe just a compiler somehow?
A modelling program like 3ds Max or Blender. [list=1:1431ki8s][*:1431ki8s]Export your regular model from 3ds Max as an SMD file[/*:m:1431ki8s] [*:1431ki8s]Make a QC file for the model and add the SMD file[/*:m:1431ki8s] [*:1431ki8s]Make a collision model in 3ds Max and export as a seperate SMD file[/*:m:1431ki8s] [*:1431ki8s]Add the collision SMD to the QC file using the $collisionmodel command I posted above[/*:m:1431ki8s][/list:o:1431ki8s]
Sun, 05 Jan 2014 16:05:56

Mikey

Sorry for such a late answer! You're great but I can't get it anyway. I just don't know how to make a collision model. I'm too dumb to do this :/ I can't even find the Attach function in 3DS Max. I exported the model in SMD, made the QC file and added that SMD to it. And now I'm too stupid to do the rest. So if You can, please help me. I swear I will make a big tutorial for all green people like me. Where's the Attach function? How do I have to combine parts using this function? And how do I have to apply my model's material to the collision mesh with at least a basic UWV map?
Sun, 05 Jan 2014 16:56:32

Ganonmaster

Example Model: Collision model
"Mikey" said ...
Where's the Attach function? How do I have to combine parts using this function?
Make sure the parts are converted to an Editable Mesh or Editable Poly. Either is fine. You can right click the object, go to "convert to" and choose Editable mesh. Then, select your Editable mesh and attach using the attach or attach list button in the modifiers tab: After that you need to add a skin modifier, add all the bones, and set the skin weights for each part. Once that's done, select the collision mesh and all the bones and export. That's your collision mesh.
"Mikey" said ...
And how do I have to apply my model's material to the collision mesh with at least a basic UWV map?
You don't. The collision model won't be visible in game, so it doesn't need any UVW map or material for that matter.
Mon, 06 Jan 2014 14:01:36

Mikey

:( Skin modifier? Bones? Weight? :( I've chosen Vertex (is it good?) and I've got some blue spots on the model in Top, Left, Front and perspective views. Then hit this Attach Function. And what exactly? I have to drag these blue spots trying to draw a collision mesh?