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

Env spark: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
(-added class hierarchy, cleanup)
Line 1: Line 1:
{{lang|Env spark}}
{{LanguageBar}}
[[File:env_spark.jpg|thumb|200px|right|<code>env_spark</code> with directional, glowing medium-sized sparks. By default, the sparks jump up a bit from the origin of the entity, so if you are attempting to create a sparks like this, you must use the ''Directional'' flag and point the entity downwards.]]
[[File:env_spark.jpg|thumb|200px|right|<code>env_spark</code> with directional, glowing medium-sized sparks. By default, the sparks jump up a bit from the origin of the entity, so if you are attempting to create a sparks like this, you must use the ''Directional'' flag and point the entity downwards.]]
{{CD|CEnvSpark|file1=EnvSpark.cpp}}
{{this is a|point entity|name=env_spark|sprite=1}} It is used to create sparks at its origin.
{{this is a|point entity|name=env_spark|sprite=1}} It is used to create sparks at its origin.
{{Note|The "DoSpark" soundscript this entity plays on spark is set to misc/null.wav.  You will need to override this soundscript in your map, or manually play sound effects using the <code>OnSpark</code> output{{todo|likely the case in other games, only observed in {{tf2}}}}}}
{{Note|The "DoSpark" soundscript this entity plays on spark is set to misc/null.wav.  You will need to override this soundscript in your map, or manually play sound effects using the <code>OnSpark</code> output{{todo|likely the case in other games, only observed in {{tf2}}}}}}
{{code class|CEnvSpark|EnvSpark.cpp}}


{{clearleft}}
{{clearleft}}


==Flags==
==Flags==
*64: Start ON
{{fl|64|Start ON}}
*128: Glow
{{fl|128|Glow}}
*256: Silent
{{fl|256|Silent}}
*512: Directional
{{fl|512|Directional}}


==Keyvalues==
==Keyvalues==
{{KV Targetname}}
{{KV|Max Delay|intn=MaxDelay|string|The longest delay between sparks (in seconds). If this value is changed with {{ent|AddOutput}}, the change will only take effect after the entity sparks again.}}
{{KV|Max Delay|intn=MaxDelay|string|The longest delay between sparks (in seconds). If this value is changed with {{ent|AddOutput}}, the change will only take effect after the entity sparks again.}}
{{KV|Magnitude|intn=Magnitude|choices|The amount of the sparks.
{{KV|Magnitude|intn=Magnitude|choices|The amount of the sparks.
Line 25: Line 25:
:*2: Medium
:*2: Medium
:*3: Long}}
:*3: Long}}
{{KV BaseEntity}}


==Inputs==
==Inputs==
Line 32: Line 31:
{{IO|ToggleSpark|Toggle the on/off state of the spark effect.}}
{{IO|ToggleSpark|Toggle the on/off state of the spark effect.}}
{{IO|SparkOnce|Spark once.}}
{{IO|SparkOnce|Spark once.}}
{{I BaseEntity}}


==Outputs==
==Outputs==
{{IO|OnSpark|nofgd=1|Fired when the sparks emit.}}
{{IO|OnSpark|nofgd=1|Fired when the sparks emit.}}
{{O BaseEntity|l4d=1}}


[[Category:Special effects]]
[[Category:Special effects]]

Revision as of 09:57, 25 September 2024

English (en)Translate (Translate)
env_spark with directional, glowing medium-sized sparks. By default, the sparks jump up a bit from the origin of the entity, so if you are attempting to create a sparks like this, you must use the Directional flag and point the entity downwards.
C++ Class hierarchy
CEnvSpark
CPointEntity
CBaseEntity
C++ EnvSpark.cpp
Env spark.png

env_spark is a point entity available in all Source Source games. It is used to create sparks at its origin.

Note.pngNote:The "DoSpark" soundscript this entity plays on spark is set to misc/null.wav. You will need to override this soundscript in your map, or manually play sound effects using the OnSpark output
Todo: likely the case in other games, only observed in Team Fortress 2

Flags

Start ON : [64]
Glow : [128]
Silent : [256]
Directional : [512]

Keyvalues

Name (targetname) <string>[ Edit ]
The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g. parentname or target).
Also displayed in Hammer's 2D views and Entity Report.
See also:  Generic Keyvalues, Inputs and Outputs available to all entities

Max Delay (MaxDelay) <string>
The longest delay between sparks (in seconds). If this value is changed with AddOutput, the change will only take effect after the entity sparks again.
Magnitude (Magnitude) <choices>
The amount of the sparks.
  • 1: Small
  • 2: Medium
  • 5: Large
  • 8: Huge
Spark Trail Length (TrailLength) <choices>
Length of the spark trails. Other numbers may be entered to create extremely long or short trails.
  • 1: Short
  • 2: Medium
  • 3: Long

Inputs

StartSpark
Start the spark effect.
StopSpark
Stop the spark effect.
ToggleSpark
Toggle the on/off state of the spark effect.
SparkOnce
Spark once.

Outputs

OnSpark  !FGD
Fired when the sparks emit.