Env fog (GoldSrc): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Hi, the information pertaining fog in CS is wrong. Some of these are DS exclusive and do not affect 1.6 and standard CZero. Though, it seems like the spawn flags between 1.6/CZero and DS differ. Please refer to de_vostok_cz. Unknown to how CSX handles these commands.)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{tabsBar|main=env_fog}}
{{tabsBar|main=env_fog}}
{{CD|CClientFog|goldsrc=1|base=CBaseEntity|nolink=1|file1=[https://github.com/ValveSoftware/halflife/blob/master/dmc/dlls/cbase.h cbase.h]<br>[https://github.com/ValveSoftware/halflife/blob/master/dmc/dlls/triggers.cpp triggers.cpp]}}
{{CD|CClientFog|goldsrc=1|base=CBaseEntity|nolink=1|file1=[https://github.com/ValveSoftware/halflife/blob/master/dmc/dlls/cbase.h cbase.h]<br>[https://github.com/ValveSoftware/halflife/blob/master/dmc/dlls/triggers.cpp triggers.cpp]}}
{{this is a|logical entity|name=env_fog|game=Counter-Strike 1 series|game1=Deathmatch Classic}} This entity is used to cover the map in fog. Most Counter-Strike FGDs do not come with this entity listed, it has to be manually added in the FGD to be used in Hammer.
{{this is a|logical entity|name=env_fog|game=Counter-Strike 1 series|game1=Deathmatch Classic|game2=Spirit of Half-Life}} This entity is used to cover the map in fog. Most Counter-Strike FGDs do not come with this entity listed, it has to be manually added in the FGD to be used in Hammer.
 
{{note|While {{dod|2}} has fog, it does not have this entity; the fog is applied automatically {{how}}, and is disabled when the player has the minimap open.}}


== Key values ==
== Key values ==
{{hl1 kv targetname}}
:In {{sohl}}, fog can be toggled by targeting it.
{{KV|Fog Color (R G B)|intn=rendercolor|color255|This property allows you to set the color of the fog using an "R G B" value. For example, for blue fog you could use "0 0 255".}}
{{KV|Fog Color (R G B)|intn=rendercolor|color255|This property allows you to set the color of the fog using an "R G B" value. For example, for blue fog you could use "0 0 255".}}
{{KV|Start distance|intn=startdist|int| This value defines how far away from the player the fog will start. At this range, the fog is completely transparent.|only={{dmc}} }}
{{KV|Start distance|intn=startdist|int|only={{dmc}}{{sohl}} | This value defines how far away from the player the fog will start. At this range, the fog is completely transparent.}}
{{KV|End distance|intn=enddist|int|This value defines how far away from the player the fog will end. At this point, the fog becomes 100% opaque.|only={{dmc}} }}
{{KV|End distance|intn=enddist|int|only={{dmc}}{{sohl}} |This value defines how far away from the player the fog will end. At this point, the fog becomes 100% opaque. }}
{{KV|Start distance|intn=fogStartDistance|int|Distance where the fog begins to appear.|only={{czds}} }}
{{KV|Start distance|intn=fogStartDistance|int|only={{czds}}|Distance where the fog begins to appear. }}
{{KV|Stop distance|intn=fogStopDistance|int|Distance where the fog ends to appear.|only={{czds}} }}
{{KV|Stop distance|intn=fogStopDistance|int|only={{czds}}|Distance where the fog ends to appear. }}
{{KV|Fog density|intn=density|int|Density of the fog.|only={{cs}}{{cscz}} }}
{{KV|Fog density|intn=density|int|only={{cs}}{{cscz}} |Density of the fog.}}
{{KV|Fade in time|intn=fadein|integer|only={{sohl}}|}}
{{KV|Fade out time|intn=fadeout|integer|only={{sohl}}|}}
{{kV|<nowiki>Hold time (0 = permanent)</nowiki>|intn=holdtime|float|only={{sohl}}|}}


== Flags ==
== Flags ==
{{fl|1|Fog Affects Skybox|only={{czds}} }}{{confirm}}
{{fl|1|Fog Affects Skybox|only={{czds}} }}{{confirm}}
{{fl|1|Start On|only={{sohl}}|If this entity has a targetname, it will start off unless this spawnflag is used.}}
{{fl|32768|Is Fading|only={{sohl}}|nofgd=1|Handled via game code; do not set manually.}}

Latest revision as of 08:40, 2 December 2025

Edit Tabs
C++ Class hierarchy
CClientFog
CBaseEntity
C++ cbase.h
triggers.cpp

env_fog is a logical entity available in Counter-Strike 1 seriesCounter-Strike 1 seriesCounter-Strike 1 series Counter-Strike 1 series, Deathmatch Classic Deathmatch Classic, and Spirit of Half-Life Spirit of Half-Life. This entity is used to cover the map in fog. Most Counter-Strike FGDs do not come with this entity listed, it has to be manually added in the FGD to be used in Hammer.

Note.pngNote:While Day of Defeat Day of Defeat has fog, it does not have this entity; the fog is applied automatically [How?], and is disabled when the player has the minimap open.

Key values

Name (targetname) <string>
The targetname that other entities refer to this entity by, usually via the target, killtarget, and TriggerTarget KVs.
In Spirit of Half-Life, fog can be toggled by targeting it.
Fog Color (R G B) (rendercolor) <color255>
This property allows you to set the color of the fog using an "R G B" value. For example, for blue fog you could use "0 0 255".
Start distance (startdist) <integer> (only in Deathmatch ClassicSpirit of Half-Life)
This value defines how far away from the player the fog will start. At this range, the fog is completely transparent.
End distance (enddist) <integer> (only in Deathmatch ClassicSpirit of Half-Life)
This value defines how far away from the player the fog will end. At this point, the fog becomes 100% opaque.
Start distance (fogStartDistance) <integer> (only in Condition Zero Deleted Scenes)
Distance where the fog begins to appear.
Stop distance (fogStopDistance) <integer> (only in Condition Zero Deleted Scenes)
Distance where the fog ends to appear.
Fog density (density) <integer> (only in Counter-StrikeCounter-Strike: Condition Zero)
Density of the fog.
Fade in time (fadein) <integer> (only in Spirit of Half-Life)
Fade out time (fadeout) <integer> (only in Spirit of Half-Life)
Hold time (0 = permanent) (holdtime) <float> (only in Spirit of Half-Life)

Flags

Fog Affects Skybox : [1] (only in Condition Zero Deleted Scenes)[confirm]
Start On : [1] (only in Spirit of Half-Life)
If this entity has a targetname, it will start off unless this spawnflag is used.
Is Fading : [32768] (only in Spirit of Half-Life) !FGD
Handled via game code; do not set manually.