$controller: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
Line 18: Line 18:
  $cdmaterials "models/npcs/"
  $cdmaterials "models/npcs/"
  $model "Robot" "robot.smd"
  $model "Robot" "robot.smd"
  '''$controller 4 "jaw" X 0 20'''
  '''$controller mouth "jaw" X 0 20'''
  '''$controller 0 "tracker" LYR -1 1'''
  '''$controller 0 "tracker" LYR -1 1'''
  $sequence "idle" "idle.smd"
  $sequence "idle" "idle.smd"

Revision as of 11:45, 16 April 2012

Creates a channel to manually set a single axis position or angle on a bone. Not recommended for use, mostly these exist since Half-Life 1 used them.

Warning.pngWarning:You can't assign more than 6 controllers to a single bone.

Syntax

$controller <number> "<bone_name>" [L]<axis>[R] <start_angle> <end_angle>

where

<number>
The number of the controller (you may need multiple controllers). 0-3 for custom controller, 4 or "mouth" for jaw (GoldSrc only).
<bone_name>
the name of the bone to control.
<axis>
The axis can be either X, Y, or Z. You need to specify a new controller for each axis of rotation.
[L]
The prefix L on the axis specifies that this controller loops back around to the start when it ends (see example below).
[R]
The suffix R specifies the angles are in Wikipedia icon radians instead of degrees (see example below).
<start_angle>
the offset start angle of the rotation in degrees (or radians).
<end_angle>
the offset end angle of the rotation in degrees (or radians).

Example

$modelname "npcs/robot.mdl"
$cdmaterials "models/npcs/"
$model "Robot" "robot.smd"
$controller mouth "jaw" X 0 20
$controller 0 "tracker" LYR -1 1
$sequence "idle" "idle.smd"
Todo: confirm syntax of "tracker"