$collisiontext: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(cleanup)
Line 1: Line 1:
<div style="float:right;padding:0 1em;background:#FFF;">__TOC__</div>
'''[[$collisiontext]]''' defines a breakable model's [[custom gibs]]. (Generic gibs are defined by [[Prop Data#Gibs|$keyvalues > prop_data > breakable_model]]).
{{stub}}[[Category: QC Commands]]


The [[$collisiontext]] [[QC command]] is used to define a breakable model's [[custom gibs]]et (''generic'' gibs are defined by [[Prop Data#Gibs|$keyvalues - prop_data - breakable_model]]).
{{tip|Use [[$autocenter]] when compiling custom gibs to fix potential lighting oddities.}}


{{tip|Use [[$autocenter]] to ensure gibs spawn in the correct position relative to the breaking model.}}
{{todo|Is [[propdata]] required when using $collisiontext?}}


* {{todo| is [[propdata]] also required when using $collisiontext ?}}
== Example ==


== QC Syntax Example ==
  $collisiontext
  $collisiontext
  {  
  {  
  break { "model" "mycustomgib1" "health" "25" "fadetime" "0" }
  break { model mycustomgib1 health 25 fadetime 0 }
  break { "ragdoll" "mycustomgib2" "health" "10" "fadetime" "30" "debris" "1" "burst" "50" }
  break { ragdoll mycustomgib2 health 10 fadetime 30 debris 1 burst 50 }
  break { "model" "mycustomgib3" "health" "10" "fadetime" "30" "debris" "1" "fademindist" "20" "fademaxdist" "30" }
  break { model mycustomgib3 health 10 fadetime 30 fademindist 20 fademaxdist 30 }
  break { "model" "mycustomgib4" "health" "10" "fadetime" "20" "debris" "1" "offset" "-2.00 3.68 12.40" }
  break { model mycustomgib4 health 10 fadetime 20 offset -2 3.68 12.4 }
  }
  }


==Break Options==
== Options ==


; <code>model <path\name></code>
; <code>ragdoll <path\name></code>
: The (compiled) model to spawn.
; <code>offset <[[float]]|x y z></code>
: Offsets the current gib. Values are in [[unit]]s.
; <code>health <[[int]]></code>
: Overrides the model's own health value "This sometimes has to be placed in the [[$keyvalues]] line."
; <code>fadetime <int|seconds></code>
: Time before gibs start to fade away. They are removed once the fade is complete.
: {{todo|Is there any way to specify how long the fade should last?}}
; <code>fademindist <int|units></code>
; <code>fademaxdist <int|units></code>
: Distance from the camera at which to start and end temporary fading out of the gib.
; <code>debris <[[bool]]></code>
: Prevents the gib model from colliding with dynamic objects when made true. Strongly recommended for anything small.
; <code>burst <int></code>
: Adds force to the gib, pushing it outward when the parent model breaks.
: {{todo|What units are in use here?}}
; <code>placementbone <bone></code>
; <code>placementattachment <attachment></code>
: {{todo|Compared to [[$autocenter]]'s "placementOrigin" ?}}


===model ''<string>'' OR ragdoll ''<string>''===
== See also ==


* Location of *.mdl file to spawn. This option is mandatory. {{note| Model must be compiled with ragdoll physics to use "ragdoll".}}
* [[Prop Data#Gibs]]


'''Example:''' "model" "props_junk/wood_pallet001a_chunka" OR "ragdoll" "props_junk/wood_pallet001a_chunka"
[[Category: QC Commands]]
 
 
===offset ''<float float float>''===
 
* Offset model from its placementOrigin in Source spatial units with 3D co-ordinates (X Y Z).
 
'''Example:''' "offset" "8.50 -6.00 32.75"
 
 
===health ''<int>''===
 
* Override default base health values in [[propdata]]. This sometimes has to be placed in the [[$keyvalues]] line.
 
'''Example:''' "health" "100"
 
 
===fadetime ''<int>''===
 
* Time that spawned gibs start to fade and disappear. Values should be specified in seconds.
 
'''Example:''' "fadetime" "30"
 
 
===fademindist ''<int>''===
 
* Distance from player to gib to start fading from view. Gib will unfade when the player moves closer. {{note| This must be used in conjunction with '''fademaxdist''' to work and of lesser value.}}
 
'''Example:''' "fademindist" "20"
 
 
===fademaxdist ''<int>''===
 
* Distance from player to gib to fade completely from view. Gib will unfade when the player moves closer. {{note| This must be used in conjunction with '''fademindist''' to work and of greater value.}}
 
'''Example:''' "fademaxdist" "30"
 
 
===debris ''<boolean>''===
 
* Flag gib model as debris limiting its physical interaction with other gibs. This should be used on gibs that are small to prevent them from getting stuck with each other. 0 = Off (Default), 1 = On.
 
'''Example:''' "debris" "1"
 
 
===burst ''<int>''===
 
* Adds a burst force allowing the gib to be pushed further outward when the parent model breaks.
 
'''Example:''' "burst" "50"
 
 
===placementbone===
* {{todo|compared to [[$autocenter]]'s "placementOrigin" ?}}
 
 
===placementattachment===
* {{todo|compared to [[$autocenter]]'s "placementOrigin" ?}}

Revision as of 16:34, 16 January 2009

$collisiontext defines a breakable model's custom gibs. (Generic gibs are defined by $keyvalues > prop_data > breakable_model).

Tip.pngTip:Use $autocenter when compiling custom gibs to fix potential lighting oddities.
Todo: Is propdata required when using $collisiontext?

Example

$collisiontext
{ 
	break { model	mycustomgib1	health 25	fadetime 0 }
	break { ragdoll	mycustomgib2	health 10	fadetime 30	debris 1	burst 50 }
	break { model	mycustomgib3	health 10	fadetime 30	fademindist 20	fademaxdist 30 }
	break { model	mycustomgib4	health 10	fadetime 20	offset -2 3.68 12.4 }
}

Options

model <path\name>
ragdoll <path\name>
The (compiled) model to spawn.
offset <float|x y z>
Offsets the current gib. Values are in units.
health <int>
Overrides the model's own health value "This sometimes has to be placed in the $keyvalues line."
fadetime <int|seconds>
Time before gibs start to fade away. They are removed once the fade is complete.
Todo: Is there any way to specify how long the fade should last?
fademindist <int|units>
fademaxdist <int|units>
Distance from the camera at which to start and end temporary fading out of the gib.
debris <bool>
Prevents the gib model from colliding with dynamic objects when made true. Strongly recommended for anything small.
burst <int>
Adds force to the gib, pushing it outward when the parent model breaks.
Todo: What units are in use here?
placementbone <bone>
placementattachment <attachment>
Todo: Compared to $autocenter's "placementOrigin" ?

See also