Model entity/Generic Keyvalues, Inputs and Outputs/Inputs: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(template parsing and documentation notes)
 
(36 intermediate revisions by 10 users not shown)
Line 1: Line 1:
<noinclude>This template is our holder for all [[inputs]] that are assigned through {{ent|CBaseAnimating}}.
== Inputs ==
{{I|SetBodyGroup|param=int|Sets body {{↑|Keyvalues|keyvalue}}}}
{{I|SetModelScale|param=vec2|since={{src13}}|Multiplies the size of the model. Does not alter the physics collisions in most cases. Can take two values separated by a space, in which case the first value would be the target model scale and the second value would be the number of seconds the change in scale will be spread over. If there is no second value, the model will scale instantly.{{tip|The <code>modelscale</code> keyvalue can be [[AddOutput]]ed as a workaround for other games with this input missing.}}
:{{warning|Negative or extremely high values can cause crashes!}}}}
{{I|SetModel|param=string|Changes the model to the specified path. Form of <tt>models/ammo/ammo_us.mdl</tt>.
:{{important|Absolutely NO quotes! Make sure you use the forward slash '/'. [[Merasmus]] says to heed this advice, else thou shalt corrupt the VMF.}}|only={{tf2branch}}}}


When applying to a page, add <code>|portal2=1</code> to display inputs added by Portal 2 (if they should be there).
=== Rendering ===
----
{{I|skin|param=int|Sets skin {{↑|Keyvalues|keyvalue}}.}}
[[Category:Keyvalue Templates|Global]]
{{I|Color|param=color255|Sets color. {{|Effects_-_Render|See rendercolor keyvalue}}}}
</noinclude>
{{I|Alpha|param=int 0-255|Sets alpha. {{|Effects_-_Render|See renderamt keyvalue}}}}
{{IO|skin|param=int|Selects a [[skin]] from the model's index, starting with 0.}}
{{I|fademindist|param=float|Same effect as {{|Performance|fademindist}} keyvalue}}
{{IO|SetBodyGroup|param=int|Sets the the active [[$bodygroup]].}}
{{I|fademaxdist|param=float|Same effect as {{↑|Performance|fademaxdist}} keyvalue}}
{{IO|Ignite|Makes the entity catch on fire indefinitely.}}
{{I|AlternativeSorting|param=bool|Swaps the rendering order of the entity. Used to attempt to fix sorting problems when rendering, for example an object rendering in front of translucent materials.}}
{{IO|IgniteLifetime|param=float|Makes the entity catch on fire for a given amount of time.}}
 
{{IO|IgniteNumHitboxFires|param=int|Makes the entity catch on fire with a given number of [[hitbox]] fire particles.}}
=== Animation ===
{{IO|IgniteHitboxFireScale|param=float|Makes the entity catch on fire with a given scale for [[hitbox]] fire particles.}}
{{I|SetCycle|param=float|Skip to a specific point in the current animation.|only={{tf2branch}}}}
{{IO|BecomeRagdoll|Kills the entity and creates a client-side ragdoll from the model. Input is only passed if the model contains [[$collisionjoints]], for other models [[phys_convert]] can be used instead.}}
{{I|SetPlayBackRate|param=float|Change the animation speed multiplier.}}
{{IO|SetLightingOrigin|param=targetname|Sets the entity's lighting origin to an {{ent|info_lighting}}.}}
 
{{IO|SetLightingOriginHack|param=targetname|Offsets the entity's lighting origin by their distance from an {{ent|info_lighting_relative}}. {{note|Not available in {{l4d}}{{l4d2}}.}}}}
=== Lighting / Shadow / Reflectinos ===
{{IO|fademindist|param=float|Sets distance at which the entity starts fading. If <0, the entity will disappear instantly when end fade is hit. The value will scale appropriately if the entity is in a [[3D Skybox]].}}
{{I|SetLightingOrigin|param=targetname|Sets the entity's lighting origin to use this entity's position.}}
{{IO|fademaxdist|param=float|Sets distance at which the entity ends fading. If <0, the entity won't disappear at all. The value will scale appropriately if the entity is in a [[3D Skybox]].}}
{{I|SetLightingOriginHack|param=targetname|Offsets the entity's lighting origin by their distance from an {{ent|info_lighting_relative}}. Use <code>SetLightingOrigin</code> instead.|deprecated=1|removed={{l4d}}}}
{{IO|SetModelScale|param=vector|Multiplies the size of the model. Does not alter the physics collisions in most cases, however. Takes two values separated by a space. The first is the target model scale. The second value is the number of seconds the change in scale will be spread over.}}
{{I Shadow}}
{{IO|Alpha|param=int|Sets the entity's transparency to a number from 0 (invisible) to 255 (fully visible). Requires the entity to have its '''[[Render Mode]] (rendermode)''' set to a number other than <code>0</code>.}}
{{I Reflection}}
{{IO|AlternativeSorting|param=bool|Swaps the rendering order of the entity. Used to attempt to fix sorting problems when rendering, for example an object rendering in front of translucent materials.}}
 
{{IO|Color|param=color255|Sets an RGB color for the entity.}}
=== Miscellaneous ===
{{IO|SetDamageFilter|param=targetname|Sets a [[filter]] for this entity for when it receives damage.}}
{{I|SetDamageFilter|param=targetname|Sets a [[filter]] for this entity for when it receives damage.}}
{{IO|EnableDamageForces|Allows the entity to be pushed by damage done to it (usually force amount correlates with the damage done).}}
{{I|Ignite|Makes the entity catch on fire indefinitely.}}
{{IO|DisableDamageForces|Prevents the entity from being pushed by damage done to it.}}
{{I|IgniteLifetime|param=float|Makes the entity catch on fire for a given amount of time.}}
{{IO|EnableShadow|Allows the entity to draw a [[render target]] shadow.}}
{{I|IgniteNumHitboxFires|param=int|Makes the entity catch on fire with a given number of [[hitbox]] fire particles.|removed={{l4d2}}}}
{{IO|DisableShadow|Prevents the entity from drawing a [[render target]] shadow.}}
{{I|IgniteHitboxFireScale|param=float|Makes the entity catch on fire with a given scale for [[hitbox]] fire particles.|removed={{l4d2}}}}
{{#if:{{{portal2|}}}|{{IO|EnableDraw|since=P2|Removes {{ent|EF_NODRAW}} from the entity.}}
{{note|<code>IgniteNumHitboxFires</code> / <code>IgniteHitboxFireScale</code> are still present in games post {{l4d2}} but call the same function as <code>Ignite</code> (they still take integer and float parameter but don't do anything with them)}}
{{IO|DisableDraw|since=P2|Applies {{ent|EF_NODRAW}} to the entity. Note that this is different than {{ent|rendermode|10}}.}}
{{I|BecomeRagdoll|Kills the entity and creates a client-side ragdoll from the model. Input is only passed if the model contains {{ent|$collisionjoints}}. For other models, {{ent|phys_convert}} can be used instead.}}
{{IO|EnableReceivingFlashlight|since=P2|Makes it so that the entity is lit by {{ent|env_projectedtexture}}s.}}
{{I|EnableDamageForces|Allows the entity to be pushed by damage done to it (usually force amount correlates with the damage done).}}
{{IO|DisableReceivingFlashlight|since=P2|Prevents the entity from being lit by {{ent|env_projectedtexture}}s. The shadow made by the texture will still cast.}}
{{I|DisableDamageForces|Prevents the entity from being pushed by damage done to it.}}
{{IO|EnableDrawInFastReflection|since=P2|Makes the entity be rendered in reflections from water materials using <code>$reflectonlymarkedentities</code>.}}
{{IO|DisableDrawInFastReflection|since=P2|Prevents the entity from rendering in fast reflections.}}}}

Latest revision as of 07:51, 5 May 2025

Inputs

SetBodyGroup <integerRedirectInput/integer>
Sets body keyvalue ↑
SetModelScale <vector2> (in all games since Source 2013)
Multiplies the size of the model. Does not alter the physics collisions in most cases. Can take two values separated by a space, in which case the first value would be the target model scale and the second value would be the number of seconds the change in scale will be spread over. If there is no second value, the model will scale instantly.
Tip.pngTip:The modelscale keyvalue can be AddOutputed as a workaround for other games with this input missing.
Warning.pngWarning:Negative or extremely high values can cause crashes!
SetModel <stringRedirectInput/string> (only in Team Fortress 2 branch)
Changes the model to the specified path. Form of models/ammo/ammo_us.mdl.
Icon-Important.pngImportant:Absolutely NO quotes! Make sure you use the forward slash '/'. Merasmus says to heed this advice, else thou shalt corrupt the VMF.

Rendering

skin <integerRedirectInput/integer>
Sets skin keyvalue ↑.
Color <color255RedirectInput/color32>
Sets color. See rendercolor keyvalue ↑
Alpha <integer 0–255>
Sets alpha. See renderamt keyvalue ↑
fademindist <floatRedirectInput/float>
Same effect as fademindist ↑ keyvalue
fademaxdist <floatRedirectInput/float>
Same effect as fademaxdist ↑ keyvalue
AlternativeSorting <booleanRedirectInput/boolean>
Swaps the rendering order of the entity. Used to attempt to fix sorting problems when rendering, for example an object rendering in front of translucent materials.

Animation

SetCycle <floatRedirectInput/float> (only in Team Fortress 2 branch)
Skip to a specific point in the current animation.
SetPlayBackRate <floatRedirectInput/float>
Change the animation speed multiplier.

Lighting / Shadow / Reflectinos

SetLightingOrigin <targetnameRedirectInput/string>
Sets the entity's lighting origin to use this entity's position.
SetLightingOriginHack <targetnameRedirectInput/string> (removed since Left 4 Dead) Obsolete
Deprecated.
Offsets the entity's lighting origin by their distance from an info_lighting_relative. Use SetLightingOrigin instead.

Shadow:

DisableShadow
Turn dynamic shadows off for this entity. Identical to applying  EF_NOSHADOW.
EnableShadow
Turn dynamic shadows on for this entity.
DisableReceivingFlashlight  (in all games since Portal 2)
This object will not receive light or shadows from projected textures.
EnableReceivingFlashlight  (in all games since Portal 2)
This object may receive light or shadows from projected textures.

Reflection:

DisableDrawInFastReflection  (in all games since Portal 2)
Turns off rendering of this entity in reflections when using $reflectonlymarkedentities in water material.
EnableDrawInFastReflection  (in all games since Portal 2)
Turn on rendering of this entity in reflections when using $reflectonlymarkedentities in water material.

Miscellaneous

SetDamageFilter <targetnameRedirectInput/string>
Sets a filter for this entity for when it receives damage.
Ignite
Makes the entity catch on fire indefinitely.
IgniteLifetime <floatRedirectInput/float>
Makes the entity catch on fire for a given amount of time.
IgniteNumHitboxFires <integerRedirectInput/integer> (removed since Left 4 Dead 2)
Makes the entity catch on fire with a given number of hitbox fire particles.
IgniteHitboxFireScale <floatRedirectInput/float> (removed since Left 4 Dead 2)
Makes the entity catch on fire with a given scale for hitbox fire particles.
Note.pngNote:IgniteNumHitboxFires / IgniteHitboxFireScale are still present in games post Left 4 Dead 2 but call the same function as Ignite (they still take integer and float parameter but don't do anything with them)
BecomeRagdoll
Kills the entity and creates a client-side ragdoll from the model. Input is only passed if the model contains $collisionjoints. For other models, phys_convert can be used instead.
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.