CSprite

From Source Entities
(Redirected from Env sprite)
Jump to navigation Jump to search

Code classes:

CSprite is a base class for sprites. Sprites are textures that are capable of turning to face the player. They're good for untouchable things like smoke and lighting effects.

Classnames:

  • env_sprite
  • env_sprite_clientside (available in all games since Asw.png) - A different implementation which is handled completely by the client system, and not the server. If used whenever possible, the amount of data networked to players can get reduced significantly. The entity does still take up an edict, for one tick after spawning. The downside is that these sprites cannot receive inputs or be parented.
  • env_glow (Not in FGD) - Old name from GoldSrc. No reason to use it.

Bug: In L4d.png, when choosing a sprite from the sprite browser, the name it passes on does not contain the required .spr/.vmt file extension. Hammer will be able to display it, but the extension needs to be typed in by hand for the engine to be able to find the sprite in-game.

Flags[edit | edit source]

  • 1: Start on
  • 2: Play Once (Only animate once.)

Keyvalues[edit | edit source]

Sprite Name (model) <sprite>
The material to draw.
Scale (scale) <float>
Scale multiplier of the sprite. Maximum 64. Bug: Hammer's will show the sprite at 0.25 scale if there's no value entered here, but the engine will then show it as 1.0.
Fix: Simply add a default value in your FGD.
Framerate (framerate) <float>
Rate at which the sprite should animate, if at all.
frame (Not in FGD) (frame) <float>
If the sprite is animated, the frame it's on. Cannot be set here; can only be changed with AddOutput, and requires Framerate to be above 0 to do so.
HDR color scale (HDRColorScale) <float>
No effect.
Size of Glow Proxy Geometry (GlowProxySize) <float>
Size of the glow as needed for visibility testing. Any time a sphere of this radius would be visible (even if partially obscured by nearby geometry), the sprite will be rendered. Maximum 64.
Render Mode (rendermode) <choices>
A special rendering mode to use on this entity.
Render Amount/Transparency (renderamt) <integer>
Transparency amount, requires a Render Mode (rendermode) other than Normal. 0 is invisible, 255 is fully visible.
Render Color (R G B) (rendercolor) <color255>
Color channel filter to add to this entity's texture(s). Bug: P2.pngCsgo-small.pngBroken for brush entities.
Render FX (renderfx) <choices>
Preset appearance effects. Partially supported in Asw.png, completely non-functional in P2.pngCsgo-small.png. Bug: Sometimes functions incorrectly if changed with AddOutput, but is the only way to change effects other than making multiple versions of the object.
Minimum DX Level (mindxlevel) to Maximum DX Level (maxdxlevel) <choices> (only available in games before Left 4 Dead)
Very outdated settings. Their functionality seems to no longer be fully intact. Nearly all players will be at the highest setting anyway because DirectX 8 has been obsolete since 2002. This is still in the FGD for Alien Swarm, but it doesn't use it.
Minimum CPU Level (mincpulevel) to Maximum CPU Level (maxcpulevel) <choices> (available in all games since L4d.png)
A user with the "effect detail" setting not in this specific range will not see this object.
  • 0: Default
  • 1: Low
  • 2: Medium
  • 3: High
Minimum GPU Level (mingpulevel) to Maximum GPU Level (maxgpulevel) <choices> (available in all games since L4d.png)
A user with the "shader detail" setting not in this specific range will not see this object. Settings are named differently in different games.
  • 0: Default
  • 1: Very low or Low
  • 2: Low or Medium
  • 3: Medium or High
  • 4: High or Very High

Inputs[edit | edit source]

SetScale <float>
Sets Scale.
HideSprite
Makes the sprite invisible.
ShowSprite
Makes sprite visible.
ToggleSprite
If visible, hides. If invisible, shows.
ColorRedValue <integer>
Change the intensity of the red channel (0-255).
ColorGreenValue <integer>
Change the intensity of the green channel (0-255).
ColorBlueValue <integer>
Change the intensity of the blue channel (0-255).
Alpha <integer>
Sets Render Amount/Transparency (renderamt).
Color <color255>
Sets the Render Color (rendercolor).