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

Env particlescript: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(raw; needs cleanup)
 
mNo edit summary
 
(38 intermediate revisions by 25 users not shown)
Line 1: Line 1:
{{cleanup}}
{{LanguageBar}}
env_particlescript
{{CD|CEnvParticleScript|file1=env_particlescript.cpp}}
{{note|Using {{ent|info_particle_system}} is preferred.}}
{{this is a|model entity|name=env_particlescript}} It is an entity used for creating sprites attached to the specified model's attachments. It uses 2 [[Animation Events|animation events]] for creating and deleting these sprites : <code>CL_EVENT_SPRITEGROUP_CREATE</code> (6002) and <code>CL_EVENT_SPRITEGROUP_DESTROY</code> (6003). In {{hl2|1}}, it is used for simulating hundreds of [[scanners]] leaving the [[Citadel]] in <code>d1_trainstation_06</code>.


An entity that has special animation events that can be fired by a model with an animation inside its .qc designed foruse by this entity.


KEYS
{{ExpandBox|title=Example [[QC]] snippet from {{path|ambient_citadel_paths|mdl|icon=file}}|{{clr}}
<syntaxhighlight lang=js>
$sequence "paths1" {
"Ambient_citadel_paths_anims\paths1.smd"
{ event 6002 1 "output1a sprites/scanner_dots1" }
{ event 6002 1 "output1b sprites/scanner_dots2" }
{ event 6002 1 "output1c sprites/scanner_dots2" }
{ event 6002 1 "output2a sprites/scanner_dots2" }
{ event 6002 1 "output2b sprites/scanner_dots1" }
{ event 6002 1 "output2c sprites/scanner_dots2" }
{ event 6002 1 "output3a sprites/scanner_dots1" }
{ event 6002 1 "output3b sprites/scanner_dots2" }
{ event 6002 1 "output3c sprites/scanner_dots1" }
{ event 6003 98 "output1a" }
{ event 6003 98 "output1b" }
{ event 6003 98 "output1c" }
{ event 6003 98 "output2a" }
{ event 6003 98 "output2b" }
{ event 6003 98 "output2c" }
{ event 6003 98 "output3a" }
{ event 6003 98 "output3b" }
{ event 6003 98 "output3c" }
fps 7
loop
}
</syntaxhighlight>
}}


Name targetname <target_source> The name that other entities refer to this entity by.
==Keyvalues==
{{KV Targetname}}
{{KV|Script Model|intn=model|model|Model to use for animation sequences.}}


Parent parentname <target_destination> The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.
==Inputs==
 
{{I|SetSequence|Sets the script model's sequence.|param=string}}
Pitch Yaw Roll (Y Z X) angles <angle> This entity's orientation in the world. Pitch is rotation around the Y axis, yaw is the rotation around the Z axis, roll is the rotation around the X axis.
 
Script Model model <studio> Model to use for animation sequences.
 
 
INPUTS
 
Kill Removes this entity from the world.
 
KillHierarchy Removes this entity and all its children from the world.
 
AddOutput <string> Adds an entity I/O connection to this entity. Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire (-1 == infinite)>. Very dangerous, use with care.
 
FireUser1 Causes this entity's OnUser1 output to be fired.
 
FireUser2 Causes this entity's OnUser2 output to be fired.
 
FireUser3 Causes this entity's OnUser3 output to be fired.
 
FireUser4 Causes this entity's OnUser4 output to be fired.
 
SetParent <string> Changes the entity's parent in the movement hierarchy.
 
SetParentAttachment <string> Change this entity to attach to a specific attachment point on its parent. Entities must be parented before being sent this input. The parameter passed in should be the name of the attachment.
 
ClearParent Removes this entity from the the movement hierarchy, leaving it free to move independently.
 
SetSequence <string> Sets the script model's sequence.
 
 
OUTPUTS
 
OnUser1 Fired in response to FireUser1 input.
 
OnUser2 Fired in response to FireUser2 input.
 
OnUser3 Fired in response to FireUser3 input.
 
OnUser4 Fired in response to FireUser4 input.

Latest revision as of 06:48, 28 May 2025

English (en)Translate (Translate)
C++ Class hierarchy
CEnvParticleScript
CBaseAnimating
CBaseEntity
C++ env_particlescript.cpp
Note.pngNote:Using info_particle_system is preferred.

env_particlescript is a model entity available in all Source Source games. It is an entity used for creating sprites attached to the specified model's attachments. It uses 2 animation events for creating and deleting these sprites : CL_EVENT_SPRITEGROUP_CREATE (6002) and CL_EVENT_SPRITEGROUP_DESTROY (6003). In Half-Life 2, it is used for simulating hundreds of scanners leaving the Citadel in d1_trainstation_06.


Example QC snippet from Fileambient_citadel_paths.mdl 
$sequence "paths1" {
	"Ambient_citadel_paths_anims\paths1.smd"
	{ event 6002 1 "output1a sprites/scanner_dots1" }
	{ event 6002 1 "output1b sprites/scanner_dots2" }
	{ event 6002 1 "output1c sprites/scanner_dots2" }
	{ event 6002 1 "output2a sprites/scanner_dots2" }
	{ event 6002 1 "output2b sprites/scanner_dots1" }
	{ event 6002 1 "output2c sprites/scanner_dots2" }
	{ event 6002 1 "output3a sprites/scanner_dots1" }
	{ event 6002 1 "output3b sprites/scanner_dots2" }
	{ event 6002 1 "output3c sprites/scanner_dots1" }
	{ event 6003 98 "output1a" }
	{ event 6003 98 "output1b" }
	{ event 6003 98 "output1c" }
	{ event 6003 98 "output2a" }
	{ event 6003 98 "output2b" }
	{ event 6003 98 "output2c" }
	{ event 6003 98 "output3a" }
	{ event 6003 98 "output3b" }
	{ event 6003 98 "output3c" }
	fps 7
	loop
}

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

Script Model (model) <model path>
Model to use for animation sequences.

Inputs

SetSequence <stringRedirectInput/string>
Sets the script model's sequence.