This article's documentation is for anything that uses the Source engine. Click here for more information.

$contents: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Fixed link and grammar.)
(→‎Example: try to fix grammar)
 
(16 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The [[QC command]] [[$contents]] specifies a list of the content_types to use for [[CollisionProperty|SolidMask]] tests during non-hitbox traces.  
{{this is a|QC command|name=$contents}} It specifies a list of the [[Contents flags|contents types]] to use for [[CollisionProperty|SolidMask]] tests during non-hitbox traces.  
* This feature was specifically added to allow us to make things like fences out of props instead of brush models.  
* This feature was specifically added to allow us to make things like fences out of props instead of brush models.  
* See also [[$jointcontents]].
* See also {{ent|$jointcontents}}.


== Example ==
== Example ==
  $contents "monster" "grate"
  $contents "monster" "grate"


* Available content_types are:
Available contents types are:
; <code>grate</code>: Makes it a grate.
; {{code|grate}}
: (Grates are not solid to bullets or [[line of sight]], but solid to everything else.)
: Makes it a grate.
; <code>monster</code>: Marks it as an NPC.
: Grates are not solid to bullets or [[line of sight]], but solid to everything else.  
; <code>notsolid</code>: Makes it not solid to anything.
: {{bug|Does not function correctly in {{tf2}}{{css}}{{csgo}}; see {{ent|%CompilePassBullets}} for specifics.}}
; <code>solid</code>: Makes it solid.
: {{bug|tested={{hl2}},{{portal}}|[[npc_barnacle|Barnacle]]s' tongues will ignore props with this parameter, but will not be able to pull objects, will grab and drop them immediately (with {{ent|player}} they will do this endless until player go away). In {{bms|1}}, this can break barnacles.}}
: Solid is the default value, so this parameter is usually used only for the [[$jointcontents]] command, to make a solid child of a non-solid parent.
; {{code|monster}}
; <code>ladder</code>: Makes it a ladder.
: Marks it as a [[monster]], better known in Source as an [[NPC]].
:{{confirm|Is there any reason to do this? This flag is usually applied via game code.}}
; {{code|notsolid}}
: Makes it not solid to anything.
: Nonsolid cannot be combined with any other contents flags.
; {{code|solid}}
: Makes it solid.
: Solid is the default value, so this parameter is usually used only for the {{ent|$jointcontents}} command, to make a solid child of a non-solid parent.
; {{code|ladder}}
: Makes it a ladder.
: Whether a prop ladder is actually climbable is dependent upon the game; see [[Working Ladders]].
; {{code|debris}} {{only|[[NekoMDL]]}}
: Marks it as debris.
: Debris is solid to brushes, hitscan weapons, and non-debris physics objects, but is nonsolid to everything else, including players.
 
Additional contents from {{file|[[Contents flags|bspflags]]|h}} can be set via {{srcskineditor|4.1}}, although results may vary. For example, set the contents to {{code|67108864}} (debris) to make it block bullets without blocking players.


== See also ==
== See also ==
* [[CollisionProperty]]
* [[CollisionProperty]]


[[Category:QC Commands|contents]]__NOTOC__
__NOTOC__

Latest revision as of 09:37, 17 July 2025

$contents is a QC command available in all Source Source games. It specifies a list of the contents types to use for SolidMask tests during non-hitbox traces.

  • This feature was specifically added to allow us to make things like fences out of props instead of brush models.
  • See also $jointcontents.

Example

$contents "monster" "grate"

Available contents types are:

grate
Makes it a grate.
Grates are not solid to bullets or line of sight, but solid to everything else.
Icon-Bug.pngBug:Does not function correctly in Team Fortress 2Counter-Strike: SourceCounter-Strike: Global Offensive; see %CompilePassBullets for specifics.  [todo tested in ?]
Icon-Bug.pngBug:Barnacles' tongues will ignore props with this parameter, but will not be able to pull objects, will grab and drop them immediately (with player they will do this endless until player go away). In Black Mesa, this can break barnacles.  (tested in: Half-Life 2,Portal)
monster
Marks it as a monster, better known in Source as an NPC.
Confirm:Is there any reason to do this? This flag is usually applied via game code.
notsolid
Makes it not solid to anything.
Nonsolid cannot be combined with any other contents flags.
solid
Makes it solid.
Solid is the default value, so this parameter is usually used only for the $jointcontents command, to make a solid child of a non-solid parent.
ladder
Makes it a ladder.
Whether a prop ladder is actually climbable is dependent upon the game; see Working Ladders.
debris (only in NekoMDL)
Marks it as debris.
Debris is solid to brushes, hitscan weapons, and non-debris physics objects, but is nonsolid to everything else, including players.

Additional contents from 🖿bspflags.h can be set via Source Model Skin Editor Source Model Skin Editor, although results may vary. For example, set the contents to 67108864 (debris) to make it block bullets without blocking players.

See also