$surfaceprop: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
"$surfaceprop" "surface property"
{{stub}}
* Applies a particular [[Material Surface Property]] to the entire model.  
The [[$surfaceprop]] command is used to apply a set of physic-interaction attributes to a Model (as a [[QC command]]) or a Brush Material (as a [[VMT command]]).  
* The surface property affects a number of parameters for the model:  
* The basic principle is the same in both cases; the $surfaceprop may affect :  
: its physics properties (weight, etc),  
:* the object's density for physics calculations such as [[$automass]],
: what sounds it makes when it collides,  
:* what sounds it makes when it collides,  
: what particles it emits when you shoot it, etc.
:* what particles it emits when shot,
: what gibs it throws up when it breaks
:* what decals it acquires when shot, etc
* To add or change [[Material Surface Property]] types, edit the file <code>hl2\scripts\surfaceproperties.txt</code>.
:* what gibs it throws up if it breaks.
 
* [[HLMV]] can be used to generate blocks of .QC file that sets the surface properties correctly.  
* [[HLMV]] can be used to generate blocks of .QC file that sets the surface properties correctly.  
* If no $surfaceprop is defined, the "default" surfaceprop (which is something like concrete) is used.
==Example Syntax==
$surfaceprop "<surfaceproperty_name>"
where
; <surfaceproperty_name>
: is a ''brush'' surface property defined in the <code>/scripts/surfaceproperties.txt</code> file (see [[Material Surface Property]]),
: or a ''model'' surface property defined in the <code>/scripts/surfaceproperties_hl2.txt</code> file.


[[Category:QC Commands]]
[[Category:QC Commands]]
[[Category:List of Shader Parameters]]
[[Category:List of Shader Parameters]]
[[Category:VMT Common]]
[[Category:VMT Common]]

Revision as of 19:57, 30 March 2008

Stub

This article or section is a stub. You can help by expanding it.

The $surfaceprop command is used to apply a set of physic-interaction attributes to a Model (as a QC command) or a Brush Material (as a VMT command).

  • The basic principle is the same in both cases; the $surfaceprop may affect :
  • the object's density for physics calculations such as $automass,
  • what sounds it makes when it collides,
  • what particles it emits when shot,
  • what decals it acquires when shot, etc
  • what gibs it throws up if it breaks.
  • HLMV can be used to generate blocks of .QC file that sets the surface properties correctly.
  • If no $surfaceprop is defined, the "default" surfaceprop (which is something like concrete) is used.

Example Syntax

$surfaceprop "<surfaceproperty_name>"

where

<surfaceproperty_name>
is a brush surface property defined in the /scripts/surfaceproperties.txt file (see Material Surface Property),
or a model surface property defined in the /scripts/surfaceproperties_hl2.txt file.