Skins

From Mod Wiki
Revision as of 15:49, 16 November 2007 by MoP (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Skins allow you to quickly and easily remap textures on a model. Since the textures on a model are defined in the actual model file, using a skin is the only way to dynamically change a model texture.

Skins are most often used for hiding parts of a model, but they can also be used to have a one model with two different textures. For example, the imps in hell use the same model as the imps in the rest of the game, but the have a slightly more hellish look. This was done by specifying a different skin in the entity definition.

Take this skin for example:

skin skins/models/weapons/3rox {
	models/weapons/rocketlauncher/rshell1 textures/common/nodraw
	models/weapons/rocketlauncher/rshell2 textures/common/nodraw
}

This is used on the rocketlauncher when you have 3 rockets. It hides rocket shell number 1 and 2 by changing them to the 'nodraw' texture. This makes it look like you only have 3 rockets in your rocket launcher.

The syntax is really easy. It is a list of key/val pairs where the key is the old texture (specified in the model) and the val is the new texture to use.

You may have noticed that the material name cannot have spaces in it.