CBaseAnimating

From Source Entities
Jump to navigation Jump to search

Code classes:

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/CommandParameters or default valueParameter TypeEffect
ai_sequence_debug00 disables, 1 enablesTo do: Effect description.
sv_pvsskipanimation10 disables, 1 enablesTo do: Effect description.

Keyvalues[edit | edit source]

World Model (model) <studio>
A path to a .mdl.
Skin (skin or ModelSkinAsw.png) <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 L4d.pngL4d2-small.png.
Collisions (solid) <choices>
Method of collision for this entity.
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 the shadow_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: P2.pngCsgo-small.pngBroken for brush entities.
Render FX (renderfx) <choices>
Preset appearance effects. Partially supported in Asw.png, completely non-functional in P2.pngCsgo-small.png. 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 Hl2.pngCss.pngDods.pngTf2.pngAsw.pngP2.pngCsgo-small.png)
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 P1.png or the 2013 SDK.
Minimum CPU Level (mincpulevel) to Maximum CPU Level (maxcpulevel) <choices> (available in all games since L4d.png)
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 L4d.png)
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 L4d2-small.png)
No effect.
No Animation Sounds (Not in FGD) (SuppressAnimSounds) <boolean> (available in all games since P2.png)
Silences sounds linked to animations.
Disable ShadowDepth (disableshadowdepth) <boolean> (available in all games since P2.png)
Supposed to stop this entity from casting a shadow from env_projectedtexture and env_cascade_light, but doesn't. In order to disable these shadows, you need to manually add 2048 to the effects keyvalue with AddOutput.
Projected Texture Cache (shadowdepthnocache) <choices> (available in all games since P2.png)
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).
Disable Flashlight (disableflashlight) <boolean> (available in all games since P2.png)
Adds EF_NOFLASHLIGHT to this entity.
Render in Fast Reflections (drawinfastreflection) <boolean> (available in all games since P2.png)
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 L4d.pngL4d2-small.png.
SetModelScale <string> (only available in Hl2.pngCss.pngDods.pngTf2.png)
Multiplies the size of the model. Does not alter the physics collisions in most cases, however. Negative values are accepted. In Css.png (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 P1.png 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 P2.png)
Removes EF_NODRAW from the entity.
DisableDraw  (available in all games since P2.png)
Applies EF_NODRAW to the entity. Note that this is different than Render Mode 10.
EnableReceivingFlashlight  (available in all games since P2.png)
Makes it so that the entity is lit by env_projectedtextures.
DisableReceivingFlashlight  (available in all games since P2.png)
Prevents the entity from being lit by env_projectedtextures. The shadow made by the projected texture will still cast.
EnableDrawInFastReflection  (available in all games since P2.png)
Sets Render in Fast Reflections to true.
DisableDrawInFastReflection  (available in all games since P2.png)
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 P2.png)
Fired when this entity is fizzled by a fizzler or any other means.