$controller: Difference between revisions
Jump to navigation
Jump to search
Warning:You can't assign more than 6 controllers to a single bone.
Crazybubba64 (talk | contribs) (Significant re-write of the page. New example code with inline comments. Completely re-worked explanation of the syntax so it is compatible with modern studiomdl.) |
|||
Line 1: | Line 1: | ||
Creates a channel to manually set a single axis position or angle on a bone. Not recommended for use, | Creates a channel to manually set a single axis position or angle on a bone through game code. Not recommended for use, as this functionality was succeeded by [[$poseparameter]] and [[$sequence]]. | ||
{{Warning|You can't assign more than 6 controllers to a single bone.}} | {{Warning|You can't assign more than 6 controllers to a single bone.}} | ||
== Syntax == | == Syntax == | ||
$controller <number> "<bone_name>" [L]<axis>[R] <start> <end> | |||
where | where | ||
; <number> : The number of the controller (you may need multiple controllers). 0-3 for custom controller, 4 or "mouth" for jaw (GoldSrc only). | ; <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> : | ; <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' specifies that the controller is to loop the bone movement from the <end> to the <start>. {{Warning|GoldSrc only.}} | ||
; <axis> : The axis can be either X, Y, or Z. You need to specify a new controller for each axis of movement/rotation. | |||
; [R] : The suffix R specifies the | ; [R] : The suffix 'R' specifies that the bone is to be rotated from <start> {{wiki|degrees}} to <end> {{wiki|degrees}}. Not including 'R' simply moves the bone along the <axis> from <start> world [[unit]]s to <end> world [[unit]]s. | ||
; < | ; <start> : Starting value of the controller. | ||
; < | ; <end> : End value of the controller. | ||
== Example == | |||
$modelname " | $modelname "WScanner_Single.mdl" | ||
$cdmaterials "models/ | $model "WScanner" "WScanner_Single_Waste_Scanner_Reference.smd" | ||
$ | $cdmaterials "models\obsolete\waste_scanner\" | ||
'''$controller | //This controller rotates the root bone from 0 to 360 degrees. | ||
'''$controller | '''$controller 0 "Dummy (Root)" ZR 0 360''' | ||
//Controller 1 has two entries to allow for the bone to travel 17 units in the X(-Z) direction. | |||
//$controller lines can only have one direction specified, so this allows for blending the movement. | |||
//move the antenna base bone from 0 to 17 units in the X direction. | |||
'''$controller 1 "Antenna Base" X 0 17''' | |||
//move the antenna base bone from 0 to -17 units in the Z direction. | |||
'''$controller 1 "Antenna Base" Z 0 -17''' | |||
[[Category:QC Commands|controller]] | [[Category:QC Commands|controller]] |
Revision as of 18:03, 22 October 2017
Creates a channel to manually set a single axis position or angle on a bone through game code. Not recommended for use, as this functionality was succeeded by $poseparameter and $sequence.

Syntax
$controller <number> "<bone_name>" [L]<axis>[R] <start> <end>
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.
- <L>
- The prefix 'L' specifies that the controller is to loop the bone movement from the <end> to the <start>.
Warning:GoldSrc only.
- <axis>
- The axis can be either X, Y, or Z. You need to specify a new controller for each axis of movement/rotation.
- [R]
- The suffix 'R' specifies that the bone is to be rotated from <start>
degrees to <end>
degrees. Not including 'R' simply moves the bone along the <axis> from <start> world units to <end> world units.
- <start>
- Starting value of the controller.
- <end>
- End value of the controller.
Example
$modelname "WScanner_Single.mdl" $model "WScanner" "WScanner_Single_Waste_Scanner_Reference.smd" $cdmaterials "models\obsolete\waste_scanner\" //This controller rotates the root bone from 0 to 360 degrees. $controller 0 "Dummy (Root)" ZR 0 360 //Controller 1 has two entries to allow for the bone to travel 17 units in the X(-Z) direction. //$controller lines can only have one direction specified, so this allows for blending the movement. //move the antenna base bone from 0 to 17 units in the X direction. $controller 1 "Antenna Base" X 0 17 //move the antenna base bone from 0 to -17 units in the Z direction. $controller 1 "Antenna Base" Z 0 -17