Body Groups: Difference between revisions
Jump to navigation
Jump to search
JeepBarnett (talk | contribs) No edit summary |
JeepBarnett (talk | contribs) mNo edit summary |
||
Line 3: | Line 3: | ||
''Body Groups'' are sub meshes of a model that can have changable states. Server code can change the state a model's body groups. | ''Body Groups'' are sub meshes of a model that can have changable states. Server code can change the state a model's body groups. | ||
To define | To define a body groups, you need to add a lines in the .qc file. | ||
$bodygroup (name) | $bodygroup (name) |
Revision as of 19:26, 15 November 2005
Body Groups
Body Groups are sub meshes of a model that can have changable states. Server code can change the state a model's body groups.
To define a body groups, you need to add a lines in the .qc file.
$bodygroup (name) { studio (modelname) ["studio" modelname] [blank] }
For example (a single .mdl could be used for characters with and without glasses):
$bodygroup studio { studio "dude.smd" } $bodygroup eyewear { studio "glasses.smd" blank }
This example has two body groups numbered 0 and 1. Group 0 uses a single mesh and group 1 can be a visible glasses model (state 0) or invisible (state 1).
To change a body group's state simply call CBaseAnimating::SetBodygroup( int iGroup, int iValue ) in server code. For example, this would randomly give 1 out of 5 characters glasses:
if ( RandInt( 1, 5 ) == 1 ) SetBodyGroup( 1, 1 ); else SetBodyGroup( 1, 0 );