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

Env muzzleflash: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(raw; needs cleanup)
 
m (→‎Inputs: Substituted IO templates)
 
(26 intermediate revisions by 15 users not shown)
Line 1: Line 1:
{{cleanup}}
{{Underlinked|date=January 2024}}
env_muzzleflash


Muzzle Flash
<!-- When this page is updated to {{langsp}} or {{langsp}} instead of {{lang}}, please move {{this is a}} to the base page, as it is automatically translated. -->
{{lang|Env muzzleflash}}
{{Ent not in fgd}}
{{CD|CEnvMuzzleFlash|file1=effects.cpp}}
{{this is a|point entity|name=env_muzzleflash}} This is an entity that creates the effect of flames leaving a guns barrel when it fires. This entity is useful when making your own custom-made turrets or weapons to add a realistic flame effect. Unlike {{ent|env_gunfire}}, this does not make any bullet effects or sound.


KEYS
==Keyvalues==
{{KV Targetname}}
{{KV|Parent Attachment|intn=parentattachment|string|The name of an attachment on the [[parent]] to hierarchically attach to.}}
{{KV|Scale|intn=scale|float|Size of the muzzle flash.}}


Name targetname <target_source> The name that other entities refer to this entity by.
==Inputs==
{{I|Fire|Fires the effect once.}}


Parent parentname <target_destination> The name of this entity's parent in the movement hierarchy. Entities with parents move with their parent.
==FGD Code==
 
<syntaxhighlight lang=cpp>
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.
@PointClass base(Targetname, Parentname, Angles) = env_muzzleflash : "Muzzle Flash"
 
[
Parent Attachment parentattachment <string> The name of an attachment on the parent to hierarchically attach to.
parentattachment(string) : "Parent Attachment" : "" : "The name of an attachment on the parent to hierarchically attach to."
 
scale(float) : "Scale" : 1 : "Size of the muzzle flash."
Scale scale <float> Size of the muzzle flash.
 
input Fire(void) : "Fires the effect once."
 
]
INPUTS
</syntaxhighlight>
 
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.
 
Fire Fires the effect once.
 
 
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 10:52, 21 April 2025

Underlinked - Logo.png
This article needs more Wikipedia icon links to other articles to help Wikipedia icon integrate it into the encyclopedia. Please help improve this article by adding links Wikipedia icon that are relevant to the context within the existing text.
January 2024
English (en)Translate (Translate)
Icon-NotInFGD.png
This entity is not in the Counter-Strike: SourceDay of Defeat: SourceTeam Fortress 2Left 4 DeadLeft 4 Dead 2Counter-Strike: Global Offensive FGD by default.
See below for instructions on making it available.
C++ Class hierarchy
CEnvMuzzleFlash
CPointEntity
CBaseEntity
C++ effects.cpp

env_muzzleflash is a point entity available in all Source Source games. This is an entity that creates the effect of flames leaving a guns barrel when it fires. This entity is useful when making your own custom-made turrets or weapons to add a realistic flame effect. Unlike env_gunfire, this does not make any bullet effects or sound.

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

Parent Attachment (parentattachment) <string>
The name of an attachment on the parent to hierarchically attach to.
Scale (scale) <float>
Size of the muzzle flash.

Inputs

Fire
Fires the effect once.

FGD Code

@PointClass base(Targetname, Parentname, Angles) = env_muzzleflash : "Muzzle Flash" 
[
	parentattachment(string) : "Parent Attachment" : "" : "The name of an attachment on the parent to hierarchically attach to."
	scale(float) : "Scale" : 1 : "Size of the muzzle flash."
	
	input Fire(void) : "Fires the effect once."
]