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

CBeam: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
Line 14: Line 14:
{{DEFINE_FIELD|m_nNumBeamEnts|FIELD_INTEGER}}
{{DEFINE_FIELD|m_nNumBeamEnts|FIELD_INTEGER}}
{{DEFINE_FIELD|m_nMinDXLevel|FIELD_INTEGER}}
{{DEFINE_FIELD|m_nMinDXLevel|FIELD_INTEGER}}
{{DEFINE_FIELD|m_flHDRColorScale|FIELD_FLOAT}}
{{DEFINE_FIELD|m_flDamage|FIELD_FLOAT}}
{{DEFINE_FIELD|m_nDissolveType|FIELD_INTEGER}}


{{DEFINE_FIELD|m_fWidth|FIELD_FLOAT|Width of the beam at the start}}
{{DEFINE_FIELD|m_fWidth|FIELD_FLOAT|Width of the beam at the start}}
Line 44: Line 48:
== KIO access to fields <!-- not sure if this is correct way to call this stuff --> ==  
== KIO access to fields <!-- not sure if this is correct way to call this stuff --> ==  
=== KeyFields ===
=== KeyFields ===
{{DEFINE_KEYFIELD|m_flHDRColorScale|FIELD_FLOAT|HDRColorScale}}
{{DEFINE_KEYFIELD|[[#Fields|m_flHDRColorScale ↑]]|FIELD_FLOAT|HDRColorScale}}
{{DEFINE_KEYFIELD|m_flDamage|FIELD_FLOAT|damage}}
{{DEFINE_KEYFIELD|[[#Fields|m_flDamage ↑]]|FIELD_FLOAT|damage}}
{{DEFINE_KEYFIELD|m_nDissolveType|FIELD_INTEGER|dissolvetype}}
{{DEFINE_KEYFIELD|[[#Fields|m_nDissolveType ↑]]|FIELD_INTEGER|dissolvetype}}


=== Inputs ===
=== Inputs ===

Revision as of 03:18, 10 August 2024

English (en)Translate (Translate)
Icon-NotInFGD.png
This entity is not in the FGD by default.
It should not be put directly in a map because it doesn't provide enough KIO access and env_beam is available, but it might be of interest for vscript use.
When Dog holds objects, his hand creates four beams.
C++ Class hierarchy
CBeam
CBaseEntity
C++ beam_shared.cpp

beam is a point entity available in all Source Source games. It is a base entity used by other entities to make beams or other effects, such as bubbles. The entities which use this one offer greater control over the effect.

Fields

Note.pngNote:These are changable via NetProps vscript instance ↓ or available KIO ↓

m_nHaloIndex <FIELD_MODELINDEX>

m_nBeamType <FIELD_INTEGER>

m_nBeamFlags <FIELD_INTEGER>

m_nNumBeamEnts <FIELD_INTEGER>

m_nMinDXLevel <FIELD_INTEGER>


m_flHDRColorScale <FIELD_FLOAT>

m_flDamage <FIELD_FLOAT>

m_nDissolveType <FIELD_INTEGER>


m_fWidth <FIELD_FLOAT>

Width of the beam at the start

m_fEndWidth <FIELD_FLOAT>

Width of the beam at the end

m_fFadeLength <FIELD_FLOAT>

m_fHaloScale <FIELD_FLOAT>

m_fAmplitude <FIELD_FLOAT>

m_fStartFrame <FIELD_FLOAT>

m_fSpeed <FIELD_FLOAT>


m_flFrameRate <FIELD_FLOAT>

m_flFrame <FIELD_FLOAT>


m_flFireTime <FIELD_TIME>


m_vecEndPos <FIELD_POSITION_VECTOR>

m_hEndEntity <FIELD_EHANDLE>


  1. ifdef PORTAL

m_bDrawInMainRender <FIELD_BOOLEAN>

m_bDrawInPortalRender <FIELD_BOOLEAN>

  1. endif


Array fields

m_hAttachEntity[10] <FIELD_EHANDLE>

m_nAttachIndex[10] <FIELD_INTEGER>


KIO access to fields

KeyFields

m_flHDRColorScale ↑ <FIELD_FLOAT> (HDRColorScale)

m_flDamage ↑ <FIELD_FLOAT> (damage)

m_nDissolveType ↑ <FIELD_INTEGER> (dissolvetype)


Inputs

Note.pngNote:These inputs are usable either as Keyvalue or Input, they are also not autocompleted for ent_fire ConCommand

m_fSpeed ↑ <FIELD_FLOAT> (ScrollSpeed)


Input Functions

Width <FIELD_FLOAT> linked function: InputWidth

Asserts that specified width is lower than MAX_BEAM_WIDTH and then sets m_fWidth ↑ and m_fEndWidth ↑

Noise <FIELD_FLOAT> linked function: InputNoise

Sets m_fAmplitude ↑

ColorRedValue <FIELD_FLOAT> linked function: InputColorRedValue

Sets r portion of m_clrRender to value clamped between 0, 255

ColorGreenValue <FIELD_FLOAT> linked function: InputColorGreenValue

Sets g portion of m_clrRender to value clamped between 0, 255

ColorBlueValue <FIELD_FLOAT> linked function: InputColorBlueValue

Sets b portion of m_clrRender to value clamped between 0, 255

Constants

  • MAX_BEAM_WIDTH = 102.3f
  • MAX_BEAM_SCROLLSPEED = 100.0f
  • MAX_BEAM_NOISEAMPLITUDE = 64

Flags

SF_BEAM_STARTON : [1]
SF_BEAM_TOGGLE : [2]
SF_BEAM_RANDOM : [4]
SF_BEAM_RING : [8]
SF_BEAM_SPARKSTART : [16]
SF_BEAM_SPARKEND : [32]
SF_BEAM_DECALS : [64]
SF_BEAM_SHADEIN : [128]
SF_BEAM_SHADEOUT : [256]
SF_BEAM_TAPEROUT : [512]
SF_BEAM_TEMPORARY : [32768]

Additional information in ent_text overlay

  • start: <origin>
  • end: <m_vecEndPos>


exact format:

start: (%.2f,%.2f,%.2f)", GetAbsOrigin().x, GetAbsOrigin().y, GetAbsOrigin().z
end  : (%.2f,%.2f,%.2f)", m_vecEndPos.GetX(), m_vecEndPos.GetY(), m_vecEndPos.GetZ()

See Also