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

From Valve Developer Community
Jump to navigation Jump to search
(Fixed up some descriptions, removed fadescale as the input doesn't exist)
 
(38 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{IO|skin|param=int|Selects a [[skin]] from the model's index, starting with 0.}}
== Inputs ==
{{IO|SetBodyGroup|param=int|Sets the the active [[$bodygroup]].}}
{{I|SetBodyGroup|param=int|Sets body {{↑|Keyvalues|keyvalue}}}}
{{IO|Ignite|Makes the entity catch on fire indefinitely.}}
{{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.}}
{{IO|IgniteLifetime|param=float|Makes the entity catch on fire for a given amount of time.}}
:{{warning|Negative or extremely high values can cause crashes!}}}}
{{IO|IgniteNumHitboxFires|param=int|Makes the entity catch on fire with a given number of [[hitbox]] fire particles.}}
{{I|SetModel|param=string|Changes the model to the specified path. Form of <tt>models/ammo/ammo_us.mdl</tt>.
{{IO|IgniteHitboxFireScale|param=float|Makes the entity catch on fire with a given scale for [[hitbox]] fire particles.}}
:{{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}}}}
{{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.}}
 
{{IO|SetLightingOrigin|param=targetname|Sets the entity's lighting origin to an {{ent|info_lighting}}.}}
=== Rendering ===
{{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}}.}}}}
{{I|skin|param=int|Sets skin {{↑|Keyvalues|keyvalue}}.}}
{{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|Color|param=color255|Sets color. {{↑|Effects_-_Render|See rendercolor keyvalue}}}}
{{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|Alpha|param=int 0-255|Sets alpha. {{↑|Effects_-_Render|See renderamt keyvalue}}}}
{{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|fademindist|param=float|Same effect as {{↑|Performance|fademindist}} keyvalue}}
{{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|fademaxdist|param=float|Same effect as {{↑|Performance|fademaxdist}} keyvalue}}
{{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.}}
{{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|Color|param=color255|Sets an RGB color for the entity.}}
 
{{IO|SetDamageFilter|param=targetname|Sets a [[filter]] for this entity for when it receives damage.}}
=== Animation ===
{{IO|EnableDamageForces|Allows the entity to be pushed by damage done to it (usually force amount correlates with the damage done).}}
{{I|SetCycle|param=float|Skip to a specific point in the current animation.|only={{tf2branch}}}}
{{IO|DisableDamageForces|Prevents the entity from being pushed by damage done to it.}}
{{I|SetPlayBackRate|param=float|Change the animation speed multiplier.}}
{{IO|EnableShadow|Allows the entity to draw a [[render target]] shadow.}}
 
{{IO|DisableShadow|Prevents the entity from drawing a [[render target]] shadow.}}
=== Lighting / Shadow / Reflectinos ===
{{IO|EnableDraw|since=P2|Removes {{ent|EF_NODRAW}} from the entity.}}
{{I|SetLightingOrigin|param=targetname|Sets the entity's lighting origin to use this entity's position.}}
{{IO|DisableDraw|since=P2|Applies {{ent|EF_NODRAW}} to the entity. Note that this is different than {{ent|rendermode|10}}.}}
{{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|EnableReceivingFlashlight|since=P2|Makes it so that the entity is lit by {{ent|env_projectedtexture}}s.}}
{{I Shadow}}
{{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 Reflection}}
{{IO|EnableDrawInFastReflection|since=P2|Makes the entity render in fast reflections. {{todo|Clarify what "fast reflections" are. It seems to be associated with water.}}}}
 
{{IO|DisableDrawInFastReflection|since=P2|Prevents the entity from rendering in fast reflections.}}
=== Miscellaneous ===
{{I|SetDamageFilter|param=targetname|Sets a [[filter]] for this entity for when it receives damage.}}
{{I|Ignite|Makes the entity catch on fire indefinitely.}}
{{I|IgniteLifetime|param=float|Makes the entity catch on fire for a given amount of time.}}
{{I|IgniteNumHitboxFires|param=int|Makes the entity catch on fire with a given number of [[hitbox]] fire particles.|removed={{l4d2}}}}
{{I|IgniteHitboxFireScale|param=float|Makes the entity catch on fire with a given scale for [[hitbox]] fire particles.|removed={{l4d2}}}}
{{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)}}
{{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.}}
{{I|EnableDamageForces|Allows the entity to be pushed by damage done to it (usually force amount correlates with the damage done).}}
{{I|DisableDamageForces|Prevents the entity from being pushed by damage done to it.}}

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.