Brush entity: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{LanguageBar}}
{{LanguageBar}}
{{seealso|[[:Category:Brush entities]]}}
A '''Brush Entity''' is an [[entity]] type in the {{gldsrc|4}} and {{source|4}} engines, created by ''tying'' an entity to a [[bmodel|model made out of BSP geometry]] ([[brush]]es) in the map, giving the brush a specific effect or ability defined by the entity ''tied'' to it. (The default shortcut is {{Key|Ctrl}} + {{Key|T}} after selecting a brush)


A '''Brush Entity''' is an [[entity]] type in the {{gldsrc|4}} and {{source|4}} engines, created by ''tying'' an entity to a BSP geometry [[brush]] in the map, giving the brush a specific effect or ability defined by the entity ''tied'' to it. (The default shortcut is {{Key|Ctrl}} + {{Key|T}} after selecting a brush)
== Purpose and Uses ==
Brush entities are used for entities that require an area or ''trigger zone'' to be touched, hit, or used in order to perform a specific task.


== Purpose and Uses ==
Another use of brush entities is to create a physical object that can move, such as an elevator, or a door (can be made by many brushes selected together and tied as a whole to a brush entity, forming a brush model).  
Brush entities are used for entities that require an area or ''trigger zone'' to be touched, hit, or used in order to perform a specific task. Another use of brush entities is to create a physical object that can move, such as an elevator, or a door (can be made by many brushes selected together and tied as a whole to a brush entity, forming a brush model). A great example of a brush entity that implements both of these designs is a {{Ent|func_button}}, which requires a brush to specify the area the player must press, touch, or shoot to activate the button; the button can be made using any shape of brush, or even a group of brushes, and can be textured to give the appearance of a real button. Brush entities such as the func_button have special features that affect the physical brush they're tied to, such as moving the brush in a general direction when activited, giving the effect of the button being pushed in and then popping back out. Another example of a brush entity is a {{Ent|trigger_multiple}} which can fire some outputs once the player walks into its area of effect (the volume of which is defined by the volume of the original brush used to make the trigger).
 
A great example of a brush entity that implements both of these designs is a {{Ent|func_button}}, which requires a brush to specify the area the player must press, touch, or shoot to activate the button; the button can be made using any shape of brush, or even a group of brushes, and can be textured to give the appearance of a real button.
 
Brush entities such as the func_button have special features that affect the physical brush they're tied to, such as moving the brush in a general direction when activited, giving the effect of the button being pushed in and then popping back out.
 
Another example of a brush entity is a {{Ent|trigger_multiple}} which can fire some outputs once the player walks into its area of effect (the volume of which is defined by the volume of the original brush used to make the trigger).
 
{{tip|Many brush entities work when spawned dynamically via commands/vscript and setting keyvalue <code>solid 2</code> and desired <code>mins</code>/<code>maxs</code> after the entity has been spawned. This is useful when needing to create non-visual brush entities without recompiling the map. It's also possible to reuse [[bmodel]] of other brush entities used in the given map.
<dd>{{example|Making {{ent|trigger_multiple}} by console commands which will break any prop_physics that touch it
<pre>ent_create trigger_multiple targetname test spawnflags 1032 OnStartTouch "!activator,Break";
ent_fire test addoutput "solid 2";
ent_fire test addoutput "maxs 100 100 100";
ent_text test; ent_bbox test;
</pre>}}</dd>
(not all games' ent_create command supports more parameters beyond classname in which case they need to be set via ent_fire addoutput)
}}
 
== General types ==
=== Trigger brush entities ===
These are invisible during normal play and fire outputs or affect entities when they touch the trigger's brush. They are subclasses of [[CBaseTrigger]] and their visibility can be toggled using {{cmd|showtriggers_toggle}} if their brush used a visible texture like toolstrigger.
* [[trigger_multiple]]
* [[trigger_push]]
* [[trigger_playermovement]]
 
=== Nav controlling brush entities ===
These aid in controlling or creating the [[navmesh]] and are also invisible.
* [[func_nav_blocker]]
* [[func_nav_prefer]]
* [[func_nav_attribute_region]]


== Keyvalues / Inputs affecting rendering of brush entities ==
=== Visual brush entities ===
=== Keyvalues ===
Brush entities whose brush is intended to be seen by the player and may add some special functionality to it.
{{KV visiblebrush}}
* [[func_detail]]
* [[func_brush]]
* [[func_illusionary]]
* [[func_door]]
* [[func_movelinear]]


=== Inputs ===
=== Other ===
{{IO|Alpha|param=int 0-255|Sets the entity's transparency to a number from 0 (invisible) to 255 (fully visible). Requires the entity to have its '''[[Render Mode]] (rendermode)''' set to a number other than <code>0</code>.}}
* [[func_ladder]]
{{IO|AlternativeSorting|param=bool|Swaps the rendering order of the entity. Used to attempt to fix sorting problems when rendering, for example an object rendering in front of translucent materials.}}
* [[func_detail_blocker]]
{{IO|Color|param=color255|Sets an RGB color for the entity.}}
* [[fog_volume]]
{{IO|EnableDraw|since=P2|Removes {{ent|EF_NODRAW}} from the entity.}}
{{IO|DisableDraw|since=P2|Applies {{ent|EF_NODRAW}} to the entity. Note that this is different from {{ent|rendermode|10}}.}}
{{IO|EnableReceivingFlashlight|since=P2|Makes it so that the entity is lit by {{ent|env_projectedtexture}}s.}}
{{IO|DisableReceivingFlashlight|since=P2|Prevents the entity from being lit by {{ent|env_projectedtexture}}s. The shadow made by the texture will still cast.}}
{{I Reflection}}
{{I Shadow}}


== See also ==
== See also ==
* [[CBaseEntity|Keyvalues / Inputs / Outputs available to all entities]]
* {{source}} [[/Rendering related keyvalues and inputs|Rendering related keyvalues and inputs available to all brush entities]]
* {{source}} [[Generic Keyvalues, Inputs and Outputs]] available to all entities
* {{GoldSrc}} [[/Rendering related keyvalues (GoldSrc)]]
* [[:Category:Brush Entities]]
* [[:Category:Brush Entities]]
<onlyinclude><includeonly>{{:Brush entity/overview}}</includeonly>[[Category:Entities by type]]</onlyinclude>
* [[Point entity]]
* {{src2}} [[Mesh entity]] - successor to brush entity
 
[[Category:Entities by type]]

Latest revision as of 09:17, 8 September 2025

English (en)Español (es)Português (pt)Русский (ru)中文 (zh)Translate (Translate)

A Brush Entity is an entity type in the GoldSrc GoldSrc and Source Source engines, created by tying an entity to a model made out of BSP geometry (brushes) in the map, giving the brush a specific effect or ability defined by the entity tied to it. (The default shortcut is Ctrl + T after selecting a brush)

Purpose and Uses

Brush entities are used for entities that require an area or trigger zone to be touched, hit, or used in order to perform a specific task.

Another use of brush entities is to create a physical object that can move, such as an elevator, or a door (can be made by many brushes selected together and tied as a whole to a brush entity, forming a brush model).

A great example of a brush entity that implements both of these designs is a func_button, which requires a brush to specify the area the player must press, touch, or shoot to activate the button; the button can be made using any shape of brush, or even a group of brushes, and can be textured to give the appearance of a real button.

Brush entities such as the func_button have special features that affect the physical brush they're tied to, such as moving the brush in a general direction when activited, giving the effect of the button being pushed in and then popping back out.

Another example of a brush entity is a trigger_multiple which can fire some outputs once the player walks into its area of effect (the volume of which is defined by the volume of the original brush used to make the trigger).

Tip.pngTip:Many brush entities work when spawned dynamically via commands/vscript and setting keyvalue solid 2 and desired mins/maxs after the entity has been spawned. This is useful when needing to create non-visual brush entities without recompiling the map. It's also possible to reuse bmodel of other brush entities used in the given map.
PlacementTip.pngExample:Making trigger_multiple by console commands which will break any prop_physics that touch it
ent_create trigger_multiple targetname test spawnflags 1032 OnStartTouch "!activator,Break";
ent_fire test addoutput "solid 2";
ent_fire test addoutput "maxs 100 100 100";
ent_text test; ent_bbox test;

(not all games' ent_create command supports more parameters beyond classname in which case they need to be set via ent_fire addoutput)

General types

Trigger brush entities

These are invisible during normal play and fire outputs or affect entities when they touch the trigger's brush. They are subclasses of CBaseTrigger and their visibility can be toggled using showtriggers_toggle if their brush used a visible texture like toolstrigger.

Nav controlling brush entities

These aid in controlling or creating the navmesh and are also invisible.

Visual brush entities

Brush entities whose brush is intended to be seen by the player and may add some special functionality to it.

Other

See also