Cables on Models: Difference between revisions
Jump to navigation
Jump to search
Note:If used on props, the prop entity must be set as prop_dynamic for the cables to work.
Solokiller (talk | contribs) m (spelling fixes) |
TomEdwards (talk | contribs) mNo edit summary |
||
Line 13: | Line 13: | ||
The code to create the cables must be placed within the [[$keyvalues]] block in another block titled '''Cables'''. Every time you want to create a single cable you must create a block titled '''"Cable"''' | The code to create the cables must be placed within the [[$keyvalues]] block in another block titled '''Cables'''. Every time you want to create a single cable you must create a block titled '''"Cable"''' | ||
;StartAttachment <attachment name> | |||
:The [[$attachment]] point the cable starts from. | :The [[$attachment]] point the cable starts from. | ||
;EndAttachment <attachment name> | |||
:The [[$attachment]] point the cable ends to. | :The [[$attachment]] point the cable ends to. | ||
;Width <float> | |||
:Defines the width of the cable. | :Defines the width of the cable. | ||
;Material <VMT file location> | |||
:The VMT (material) to use. Cable materials are located in "materials/cables". | :The VMT (material) to use. Cable materials are located in "materials/cables". | ||
;NumSegments <int> | |||
:The amount of segments in the cable. More segments make the cable more 'smooth'. Should be increased if the cable bends a lot. | :The amount of segments in the cable. More segments make the cable more 'smooth'. Should be increased if the cable bends a lot. | ||
;Length <int> | |||
:The length of cable between the two attachment points. If the length is shorter than the distance between the two points then the cable will remain permanently straight. | :The length of cable between the two attachment points. If the length is shorter than the distance between the two points then the cable will remain permanently straight. | ||
Revision as of 15:29, 18 October 2009
Cables can be placed onto models simply by placing the correct code into the QC file. The cables work in the same fashion as the ones created using the move_rope and keyframe_rope entities, only that they're more limited in that they can't be broken or made solid. A good example of this is the model of Dog from HL2.

Adding cables to a model
Cables are added to a model first by defining $attachment points.
$attachment "point1" "staticprop" 0.00 0.00 9.50 rotate 0.00 0.00 0.00 $attachment "point2" "staticprop" -128.00 0.00 9.50 rotate 0.00 0.00 0.00 $attachment "point3" "staticprop" 0.00 0.00 25.50 rotate 0.00 0.00 0.00
The code to create the cables must be placed within the $keyvalues block in another block titled Cables. Every time you want to create a single cable you must create a block titled "Cable"
- StartAttachment <attachment name>
- The $attachment point the cable starts from.
- EndAttachment <attachment name>
- The $attachment point the cable ends to.
- Width <float>
- Defines the width of the cable.
- Material <VMT file location>
- The VMT (material) to use. Cable materials are located in "materials/cables".
- NumSegments <int>
- The amount of segments in the cable. More segments make the cable more 'smooth'. Should be increased if the cable bends a lot.
- Length <int>
- The length of cable between the two attachment points. If the length is shorter than the distance between the two points then the cable will remain permanently straight.
Example
In this example, two cables are create between the three attachment points.
$keyvalues { Cables { "Cable" { "StartAttachment" "point1" "EndAttachment" "point2" "Width" "0.6" "Material" "cable\cable" "NumSegments" "4" "Length" "200" } "Cable" { "StartAttachment" "point2" "EndAttachment" "point3" "Width" "0.6" "Material" "cable\cable" "NumSegments" "6" "Length" "250" } } }