env_spritetrain

Modified

12-Jul-2023

The env_spritetrain entity resembles an env_sprite which can move along path_corner entities as a func_train can. Ever wanted to make a flame travel along a fuse to a bomb? This entity is for you.

Keyvalues


OnDestroy Function ondestroyfn : Name of the function to use from already parsed .as script files when entity is destroyed (killed) in any way. If the function belongs to namespace, you must use prefix with the namespace name (e.g. mynamespace::MyFunction) for the keyvalue.

Name targetname : Set name of env_spritetrain so other entities can trigger it to start or stop sprite movement. Depending on trigger use-type: 'On'- start movement, 'Off'- stop movement, 'Toggle'- toggle movement. Can be kill-targeted but sprite is not removed, only the 'train' part.

Global Entity Name globalname : Global name of entity, allows to have one entity in the multiple maps (e.g. elevator in map1 and map2 have the same "Global Entity Name" which tells the engine to treat those entities as a one single entity, so all elevator settings, positions, actions e.t.c. are copied to another map in a moment of map transitions.

Render FX renderfx : Set custom render FX effect. Only works when "Render Mode" is set to different than 'Normal'

  • 0 : Normal : Default rendering.
  • 1 : Slow Pulse : Transparency slow fading in and out in a loop.
  • 2 : Fast Pulse : Transparency fast fading in and out in a loop.
  • 3 : Slow Wide Pulse : Transparency slow fading in and out widely in a loop.
  • 4 : Fast Wide Pulse : Transparency fast fading in and out widely in a loop.
  • 9 : Slow Strobe : Regular slow appearing/dissapearing.
  • 10 : Fast Strobe : Regular fast appearing/dissapearing.
  • 11 : Faster Strobe : Regular very fast appearing/dissapearing.
  • 12 : Slow Flicker : Random slow appearing/dissapearing.
  • 13 : Fast Flicker : Random fast appearing/dissapearing.
  • 5 : Slow Fade Away : Not working. Fading out slowly until reaching invisibility. Works once when entity spawns or have changed it's "Render FX" at a runtime (e.g. through env_render). Requires high "FX Amount"
  • 6 : Fast Fade Away : Not working. Fading out quickly until reaching invisibility. Works once when entity spawns or have changed it's "Render FX" at a runtime (e.g. through env_render). Requires high "FX Amount"
  • 7 : Slow Become Solid : Not working. Fading in slowly from invisible to fully visible. Works once when entity spawns or have changed it's "Render FX" at a runtime (e.g. through env_render). Requires low or zero "FX Amount"
  • 8 : Fast Become Solid : Not working. Fading in quickly from invisible to fully visible. Works once when entity spawns or have changed it's "Render FX" at a runtime (e.g. through env_render). Requires low or zero "FX Amount"
  • 14 : Constant Glow : Sprites with 'Glow' render mode only. Disables sprite resizing.
  • 15 : Distort : Random distortion, looped.
  • 16 : Hologram (Distort + fade) : 'Random distortion' + 'Pulse' applied, looped.
  • 17 : Dead Player (DONT USE!)
  • 18 : Explode (Garg Like)
  • 19 : Glow Shell : Applies nice animated glowing shell on model. Color can be applied. "FX Amount" manipulates glow shell size.
  • 20 : ClampMinScale (Sprites)

Render Mode rendermode : Render mode determines how this entity is rendered.

  • 0 : Normal : Normal rendering. Entity will receive light, except if it is a sprite. "FX Amount" is obsolete when this is used.
  • 1 : Color : Brush entities only: Instead of rendering the texture, the whole entity will appear in one color, set by "FX Color". "FX Amount" sets the transparency. 0 means invisible. 255 means fully opaque.
  • 2 : Texture : Texture-only rendering. Entity will not receive light. Instead, only the texture will be rendered as is. "FX Amount" sets the transparency. 0 means invisible. 255 means fully opaque. This is used for transparent things such as windows. Tip: If you have a window separating a dark and a bright room using only one entity, you can apply a brighter glass texture to the side of the window seen from within the dark room than to the side seen from the bright room. That way, the window's brightness will look realistic from both sides, instead of from just one. Generally, darker rooms require the render amount to be lower, making the glass more transparent, or it would look illogically bright.
  • 3 : Glow : Sprites only. The sprite will appear in the same size regardless of your distance to it. In addition to that, the further away you are from it, the less visible it will be. (It's only barely visible at about 500 units far away) Good for light coronas. This renders the sprite in additive mode.
  • 4 : Solid : Brush entities only. All textures of the brush entity starting with '{' will have the last color of their palette (usually blue, black or purple) be rendered fully transparent. This is used for textures with see-through parts, such as grates and railings. Requires "FX Amount" to be set to a value greater than 0, commonly 255.
  • 5 : Additive : Works just as the "Render Mode" 'Texture', except that the entity's appearance will be added to the background instead of forming a mean. This means, black pixels of textures will be fully transparent, while full-bright pixels are added with a factor of "FX Amount" divided by 255. This is often used for sprites indicating a glowing light, as well as for overlay func_illusionaries to give a computer texture the appearance of having many small, glowing lights, screens and whatever other elements. Render-amount of 255 makes it bright. 0 makes it invisible.

FX Amount (1 - 255) renderamt : Render amount to use when other than "Render Mode" 'Normal' is used.

FX Color (R G B) rendercolor : Used with "Render Mode" 'Color' and 'Glow' to set color. Also sets color of 'Glow Shell' "Render Mode".

Move Sound movesnd : Sound that is played while the env_spritetrain is moving.

  • 0 : No Sound
  • 1 : big elev 1

  • 2 : big elev 2

  • 3 : tech elev 1

  • 4 : tech elev 2

  • 5 : tech elev 3

  • 6 : freight elev 1

  • 7 : freight elev 2

  • 8 : heavy elev

  • 9 : rack elev

  • 10 : rail elev

  • 11 : squeek elev

  • 12 : odd elev 1

  • 13 : odd elev 2

Move Sound Loops? movesnd_loop : Sets if "Move Sound" should be looped during movement until it stops.

  • 0 : No
  • 1 : Yes

Stop Sound stopsnd : Sound which is played once as the env_spritetrain stops moving.

  • 0 : No Sound
  • 1 : big elev stop1

  • 2 : big elev stop2

  • 3 : freight elev stop

  • 4 : heavy elev stop

  • 5 : rack stop

  • 6 : rail stop

  • 7 : squeek stop

  • 8 : quick stop

Move Sound Override noise : Sound file to use when the env_spritetrain is moving. Useful when you don't want to use sound from default sound list. This overrides default "Move Sound" sound. Note that other sounds format (AIFF, ASF, DLS, FLAC, IT, M3U, MID, MOD, MP2, MP3, OGG, S3M, VAG, WMA, XM) can be used, even if editor sound browser allows to pick only WAV files.

Stop Sound Override noise1 : Sound file to use when the env_spritetrain is stop moving. Useful when you don't want to use sound from default sound list. This overrides default "Stop Sound" sound. Note that other sounds format (AIFF, ASF, DLS, FLAC, IT, M3U, MID, MOD, MP2, MP3, OGG, S3M, VAG, WMA, XM) can be used, even if editor sound browser allows to pick only WAV files.

Sound Volume 0.0 - 1.0 volume : Move and stop sound volume.

Sound Replacement File soundlist : Allows you to setup a sound replacement file for the env_spritetrain sounds. The path begins in 'svencoop/sound/mapname', whereas 'mapname' would be your map's name. You can go to the parent directory using '../'. A valid sound replacement file contains one or more lines with two sound-paths, which are separated by a space and wrapped into quotes. The first sound is the sound to be replaced. The second sound is the new sound. Sound-paths start in the sound directory. You cannot go to the parent directory using '../' in that case. These sounds do not need to be precached using a custom_precache point entity.

First stop target target : The name of the first path_corner (where the train starts). The env_spritetrain is teleported to this position on map start, no matter where it's placed.

Speed (units per second) speed : Movement-speed in units per second.

Obey Trigger Mode m_iObeyTriggerMode : Controls how env_spritetrain behave when triggered with different use-types.

  • 0 : No : 'Off', 'On' and 'Toggle'- toggle env_spritetrain movement.
  • 1 : Yes : 'On'- start moving, 'Off'- stop moving, 'Toggle'- toggle moving.

Sprite Name model : Set a sprite here. Path starts in modification's folder.

Sprite Scale scale : Scaling factor for the sprite. Defaults to 0.25 if not set.

Flags


  • 2048 : Not in Deathmatch : Obsolete in Sven Co-op. Makes the entity don't appear in Multiplayer Games.

Spritetrains are not efficient on the network-code. You should use them as little as possible and only temporarily.