CBaseAnimating
Jump to navigation
Jump to search
Code classes:
CBaseAnimating
(models)CBaseEntity
(all ents)
The CBaseAnimating
class enables entities to display a studio model.
Note: The lighting used on models depends primarily on where the origin is. If the origin is in light while the rest of the model is not, it may look unnatural. In some scenarios, env_projectedtexture
or env_cascade_light
can help to mask this.
ConVars/Commands[edit | edit source]
ConVar/Command | Parameters or default value | Parameter Type | Effect |
---|---|---|---|
ai_sequence_debug | 0 | 0 disables, 1 enables | To do: Effect description. |
sv_pvsskipanimation | 1 | 0 disables, 1 enables | To do: Effect description. |
Keyvalues[edit | edit source]
- World Model
(model)
<studio>
- A path to a .mdl.
- Skin
(skin or ModelSkin
)
<int>
- Some models have multiple skins. This value selects from the index, starting with 0.
- Body Group (Not in FGD)
(body)
<int>
- Sets the the active
$bodygroup
. - Playback Rate (Not in FGD)
(playbackrate)
<float>
- A multiplier of the speed at which the current animation will be played, negative values are accepted. Default is 1.0. The model will go back to its regular animation speed once its current one finishes.
- Cycle (Not in FGD)
(cycle)
<float>
- How far along the model is through playing its current animation, as a range from 0-1. This can be changed with AddOutput.
- Lighting Origin
(LightingOrigin)
<target_destination>
- An entity from which to sample lighting instead of the entity's origin. It cannot be any internal entity, including
info_lighting
. - Lighting Origin Offset (Not in FGD)
(LightingOriginHack)
<target_destination>
- The
info_lighting_relative
from which to sample lighting from instead of the entity's origin. Not in.
- Collisions
(solid)
<choices>
- Method of collision for this entity.
- 0: None
- 1: BSP (QPhysics) (Not in FGD)
- 2: Bounding Box
- 3: Oriented Bounding Box (Not in FGD)
- 4: Oriented Bounding Box, constrained to Yaw only (Not in FGD)
- 5: Custom/Test (Not in FGD)
- 6: VPhysics
- Start Fade Distance
(fademindist)
<float>
- Distance at which the entity starts fading. If less than 0, the entity will disappear instantly when the End Fade Distance is hit. The value will scale appropriately if the entity is in a 3D Skybox.
- End Fade Distance
(fademaxdist)
<float>
- Distance at which the entity ends fading. If less than 0, the entity won't disappear at all. The value will scale appropriately if the entity is in a 3D Skybox.
- Fade Scale
(fadescale)
<float>
- If specified in the
worldspawn
, or if the game is running below DirectX 8, entities will fade out even if the fade distances above aren't specified. This value gives more control over when this happens: numbers smaller than 1 cause the entity to fade out farther away, and greater than 1 cause it to fade out at closer distances. Using 0 turns off the forced fade altogether. See also$noforcedfade
. - Shadow Cast Distance
(shadowcastdist)
<int>
- Sets how far the entity casts
_rt_shadows
shadows.0
means default distance from theshadow_control
entity.
- Render Mode
(rendermode)
<choices>
- A special rendering mode to use on this entity.
- Render Amount/Transparency
(renderamt)
<integer>
- Transparency amount, requires a Render Mode
(rendermode)
other than Normal. 0 is invisible, 255 is fully visible.
- Render Color (R G B)
(rendercolor)
<color255>
- Color channel filter to add to this entity's texture(s). Bug:
Broken for brush entities.
- Render FX
(renderfx)
<choices>
- Preset appearance effects. Partially supported in
, completely non-functional in
. Bug: Sometimes functions incorrectly if changed with AddOutput, but is the only way to change effects other than making multiple versions of the object.
Sequence (Not in FGD)(sequence)
<int>
- No effect.
- Model Scale (Not in FGD)
(modelscale)
<float>
(only available in)
- A multiplier for the size of the model. Negative values are accepted. Does not scale the individual pieces that make up physics meshes, but will scale the distances between them. Not available in
or the 2013 SDK.
- Minimum CPU Level
(mincpulevel)
to Maximum CPU Level(maxcpulevel)
<choices>
(available in all games since)
- A user with the "effect detail" setting not in this specific range will not see this object.
- 0: Default
- 1: Low
- 2: Medium
- 3: High
- Minimum GPU Level
(mingpulevel)
to Maximum GPU Level(maxgpulevel)
<choices>
(available in all games since)
- A user with the "shader detail" setting not in this specific range will not see this object. Settings are named differently in different games.
- 0: Default
- 1: Very low or Low
- 2: Low or Medium
- 3: Medium or High
- 4: High or Very High
Glow Backface Multiplier (Not in FGD)(glowbackfacemult)
<float>
(only available in)
- No effect.
- No Animation Sounds (Not in FGD)
(SuppressAnimSounds)
<boolean>
(available in all games since)
- Silences sounds linked to animations.
Disable ShadowDepth(disableshadowdepth)
<boolean>
(available in all games since)
- Supposed to stop this entity from casting a shadow from
env_projectedtexture
andenv_cascade_light
, but doesn't. In order to disable these shadows, you need to manually add 2048 to theeffects
keyvalue with AddOutput. - Projected Texture Cache
(shadowdepthnocache)
<choices>
(available in all games since)
- Tells projected textures if this object's shadow needs to be updated every frame, or if it's static and the data for it can be cached (thereby saving some resources).
- 0: Default
- 1: No cache - render every frame (adds
EF_SHADOWDEPTH_NOCACHE
) - 2: Cache it - render only once
- Disable Flashlight
(disableflashlight)
<boolean>
(available in all games since)
- Adds
EF_NOFLASHLIGHT
to this entity.
- Render in Fast Reflections
(drawinfastreflection)
<boolean>
(available in all games since)
- Makes the entity be rendered in reflections from water materials using
$reflectonlymarkedentities
.
Inputs[edit | edit source]
- SetBodyGroup
<integer>
- Sets Body Group.
- Skin
<integer>
- Sets Skin.
- Ignite
- Makes the entity catch on fire indefinitely.
- IgniteLifetime
<float>
- Makes the entity catch on fire for a given amount of time.
- BecomeRagdoll
- Kills the entity and creates a client-side ragdoll from the model. The model must have $collisionjoints, otherwise it may cause bugs. See also:
phys_convert
. - SetLightingOrigin
<target_destination>
- Sets Lighting Origin.
- SetLightingOriginHack
<target_destination>
- Sets Lighting Origin Offset.
- Note: Not available in
.
- SetModelScale
<string>
(only available in)
- Multiplies the size of the model. Does not alter the physics collisions in most cases, however. Negative values are accepted. In
(To do: And some other games) a second number can be added to make the model grow/shrink smoothly over a certain number of seconds. Not available in
or the 2013 SDK.
- Tip: The
modelscale
keyvalue can be changed with the AddOutput input in games that don't have this input. - EnableDamageForces
- Allows the entity to be pushed by damage done to it (usually force amount correlates with the damage done).
- DisableDamageForces
- Prevents the entity from being pushed by damage done to it.
- Alpha
<integer>
- Sets Render Amount/Transparency
(renderamt)
.
- Color
<color255>
- Sets the Render Color
(rendercolor)
. IgniteNumHitboxFires<int>
- Functions identically to Ignite.
IgniteHitboxFireScale<float>
- Functions identically to Ignite.
- EnableDraw (available in all games since
)
- Removes
EF_NODRAW
from the entity. - DisableDraw (available in all games since
)
- Applies
EF_NODRAW
to the entity. Note that this is different than Render Mode 10. - EnableReceivingFlashlight (available in all games since
)
- Makes it so that the entity is lit by
env_projectedtexture
s. - DisableReceivingFlashlight (available in all games since
)
- Prevents the entity from being lit by
env_projectedtexture
s. The shadow made by the projected texture will still cast.
- EnableDrawInFastReflection (available in all games since
)
- Sets Render in Fast Reflections to true.
- DisableDrawInFastReflection (available in all games since
)
- Sets Render in Fast Reflections to false.
Outputs[edit | edit source]
- OnIgnite
- Fired when the entity catches fire, such as from an
env_entity_igniter
or the Ignite inputs. - OnFizzled (only available in
)
- Fired when this entity is fizzled by a fizzler or any other means.