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

Env sprite clientside: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(env_sprite_clientside also works in CS:GO)
No edit summary
 
(27 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{base point multi|env_sprite_clientside|game1=Portal 2|game2=Counter-Strike: Global Offensive}}
{{LanguageBar}}
{{this is a|point entity|notext=1|since=Alien Swarm|name=env_sprite_clientside}}{{also|{{gmod}}}}
{{CD|CSprite|nolink=1|file1=[https://github.com/ReactiveDrop/reactivedrop_public_src/blob/reactivedrop_beta/src/game/shared/Sprite.cpp#L33 Sprite.cpp]}}
It is an entity that controls the drawing of a sprite in the world, created clientside so cannot be parented to moving things and will use up no network bandwidth or CPU.


==Entity description==
{{note|This entity is the same as {{ent|env_sprite}} with only difference being that it's removed server-side upon spawning, reducing [[edict]] usage thereafter.}}
An entity that controls the drawing of a sprite in the world, created clientside so cannot be parented to moving things and will use up no network bandwidth or CPU. (Doesn’t use edicts)
{{warning|When '''loading a saved game''' it spawns only if at least one sprite using the same model also exists as server-side entity. This is because if no server-side version exists the sprite model is not precached anymore (see output of command <code>cl_precacheinfo modelprecache</code>) after loading the game and therefore the client-side entity is unable to spawn. Mind that this is not an issue outside loading saves because the server-side version that precaches this when map is started for the first time is this entity itself which removes itself shortly after.}}
{{warning|Remains as an edict if {{mono|targetname}} or {{mono|parentname}} is specified and warning <code>"LEVEL DESIGN ERROR: env_sprite_clientside has <targetname/parentname> '<value>' - use env_sprite instead"</code> is printed to console.}}


==Keyvalues==
{{note|All <code>Keyvalues</code> are same as {{ent|env_sprite}}}}
{{KV|Framerate|string|Rate at which the sprite should animate, if at all.}}
{{KV|Sprite Name|sprite|Material of the sprite to be drawn.}}
{{KV|Size of Glow Proxy Geometry.|float|Size of the glow to be rendered for visibility testing. Must be larger than the distance from the sprite center to empty space.  So if this glow is inside geometry (like a light bulb), set this value to be bigger than the bulb's radius. Any time a sphere of this radius would be visible (poking through any nearby geometry), the glow will be rendered.}}
{{KV|HDR color scale.|float|float value to multiply sprite color by when running in HDR mode.}}
{{KV Targetname}}
{{KV Parentname}}
{{KV RenderFields}}
{{KV DXLevelChoice}}


==Flags==
== See also ==
* 1 : Start on
* {{ent|env_sprite}}
* 2 : Play Once
* {{ent|env_sprite_oriented}}
 
* {{ent|env_fire}}
==Inputs==
* {{ent|env_steam}}
{{I Targetname}}
* {{ent|env_lightglow}}
{{I Parentname}}
* {{ent|env_lensflare}}
{{I RenderFields}}
 
==Outputs==
{{O Targetname}}
{{O RenderFields}}
 
===FGD Code===
<pre>@PointClass base(Targetname, Parentname, RenderFields,DXLevelChoice) size(-2 -2 -2, 2 2 2) sprite() color(20 140 20) = env_sprite_clientside :
"An entity that controls the drawing of a sprite in the world, created clientside so cannot be parented to moving things and will use up no network bandwidth or CPU."
[
framerate(string) : "Framerate" : "10.0" : "Rate at which the sprite should animate, if at all."
model(sprite) : "Sprite Name" : "sprites/glow01.spr" : "Material of the sprite to be drawn."
scale(string) : "Scale" : "" : "Scale multiplier of the sprite."
spawnflags(flags) =
[
1: "Start on" : 0
2: "Play Once" : 0
]
 
GlowProxySize(float) : "Size of Glow Proxy Geometry." : "2.0" : "Size of the glow to be rendered for visibility testing. Must be larger than the distance from the sprite center to empty space.  So if this glow is inside geometry (like a light bulb), set this value to be bigger than the bulb's radius. Any time a sphere of this radius would be visible (poking through any nearby geometry), the glow will be rendered."
 
HDRColorScale(float) : "HDR color scale." : "1.0" : "float value to multiply sprite color by when running in HDR mode."
]</pre>
 
==See also==
* [[env_sprite]]
* [[env_sprite_oriented]]
* [[env_fire]]
* [[env_steam]]
* [[env_lightglow]]

Latest revision as of 23:36, 1 June 2025

English (en)Translate (Translate)

env_sprite_clientside is a point entity available in all Source Source games since Alien Swarm Alien Swarm.(also in Garry's Mod)

C++ Class hierarchy
CSprite
CBaseEntity
C++ Sprite.cpp

It is an entity that controls the drawing of a sprite in the world, created clientside so cannot be parented to moving things and will use up no network bandwidth or CPU.

Note.pngNote:This entity is the same as env_sprite with only difference being that it's removed server-side upon spawning, reducing edict usage thereafter.
Warning.pngWarning:When loading a saved game it spawns only if at least one sprite using the same model also exists as server-side entity. This is because if no server-side version exists the sprite model is not precached anymore (see output of command cl_precacheinfo modelprecache) after loading the game and therefore the client-side entity is unable to spawn. Mind that this is not an issue outside loading saves because the server-side version that precaches this when map is started for the first time is this entity itself which removes itself shortly after.
Warning.pngWarning:Remains as an edict if targetname or parentname is specified and warning "LEVEL DESIGN ERROR: env_sprite_clientside has <targetname/parentname> '<value>' - use env_sprite instead" is printed to console.
Note.pngNote:All Keyvalues are same as env_sprite

See also