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

FunCBaseFlex: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(maybe)
No edit summary
Line 2: Line 2:
{{CD|CBaseFlex|file1=baseflex.cpp|CBaseAnimatingOverlay}}
{{CD|CBaseFlex|file1=baseflex.cpp|CBaseAnimatingOverlay}}
{{This is a|point entity|name=funCBaseFlex}}
{{This is a|point entity|name=funCBaseFlex}}
Debug entity related to flexes. Valve's remark in code: ''meaningless independant class!!''
Debug entity related to flexes, or possibly made an entity defined by mistake. Valve's remark in code: ''meaningless independant class!!''
{{idea|May be useful for spawning models that have face controllers set up. Spawning such models as prop_dynamic would cause faces to have weird graphical glitches.}}


== Description ==
This entity has a useful property, that it serves as a generic model entity that supports [[pose parameter]]s and flexes properly. Other entities such as [[prop_dynamic]] do not support those and have visual glitches, or have side effects such as [[generic_actor]].
Since this entity was never intended to be used, it requires special setup to spawn correctly. Example in [[VScript]] for {{tf2|2}}:
<source lang=js>
function BaseFlexThink()
{
    self.StudioFrameAdvance()
    return -1
}
local entity = Entities.CreateByClassname("funCBaseFlex")
entity.SetModel("models/player/heavy.mdl")
entity.SetAbsOrigin(Vector(417, -326, -191))
entity.SetAbsAngles(QAngle(0, 90, 0))
entity.SetPlaybackRate(1.0)
entity.DispatchSpawn()
entity.EmitSound("Heavy.Cheers05")
AddThinkToEnt(npc, "BaseFlexThink")
</source>


== See Also ==
== See Also ==
* [[CBaseFlex]]
* [[CBaseFlex]]
* [[Rendering and studio model related KIO]]
* [[Rendering and studio model related KIO]]

Revision as of 08:35, 24 October 2024

Icon-NotInFGD.png
This entity is not in the FGD by default.
See below for instructions on making it available.
C++ Class hierarchy
CBaseFlex
CBaseAnimatingOverlay
CBaseAnimating
CBaseEntity
C++ baseflex.cpp

funCBaseFlex is a point entity available in all Source Source games. Debug entity related to flexes, or possibly made an entity defined by mistake. Valve's remark in code: meaningless independant class!!

Description

This entity has a useful property, that it serves as a generic model entity that supports pose parameters and flexes properly. Other entities such as prop_dynamic do not support those and have visual glitches, or have side effects such as generic_actor.

Since this entity was never intended to be used, it requires special setup to spawn correctly. Example in VScript for Team Fortress 2 Team Fortress 2:

function BaseFlexThink()
{
    self.StudioFrameAdvance()
    return -1
}

local entity = Entities.CreateByClassname("funCBaseFlex")
entity.SetModel("models/player/heavy.mdl")
entity.SetAbsOrigin(Vector(417, -326, -191))
entity.SetAbsAngles(QAngle(0, 90, 0))
entity.SetPlaybackRate(1.0)
entity.DispatchSpawn()
entity.EmitSound("Heavy.Cheers05")
AddThinkToEnt(npc, "BaseFlexThink")

See Also