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

From Valve Developer Community
Jump to navigation Jump to search
(checked all games.)
 
 
(39 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{IO|skin|Sets the model's [[skin]].}}
== Inputs ==
{{IO|SetBodyGroup|Sets the the active [[$bodygroup]].}}
{{I|SetBodyGroup|param=int|Sets body {{↑|Keyvalues|keyvalue}}}}
{{IO|Ignite|Makes the entity catch on fire.}}
{{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.{{confirm}}}}
:{{warning|Negative or extremely high values can cause crashes!}}}}
{{IO|IgniteNumHitboxFires|param=int|}}
{{I|SetModel|param=string|Changes the model to the specified path. Form of <tt>models/ammo/ammo_us.mdl</tt>.
{{IO|IgniteHitboxFireScale|param=float|}}
:{{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|Makes the entity into a [[client-side]] ragdoll.}}
 
{{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|fadescale|param=float|If specified in the {{ent|worldspawn}}, or if the engine 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 at further distances, and greater than 1 cause it to fade out at closer distances. Using 0 turns off the forced fade altogether. See also {{ent|$noforcedfade}}.}}
{{I|fademindist|param=float|Same effect as {{|Performance|fademindist}} keyvalue}}
{{todo|In what game is fadescale an input?}}
{{I|fademaxdist|param=float|Same effect as {{↑|Performance|fademaxdist}} keyvalue}}
{{IO|SetModelScale|param=vector|Multiplies the size of the model. Does not alter the physics collisions in most cases, however. It can take an optional second parameter that functions as a delay.}}
{{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|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 <code>1</code>.}}
 
{{IO|AlternativeSorting|param=bool|Used to attempt to fix sorting problems when rendering. {{todo|What is the effect?}}}}
=== Animation ===
{{IO|Color|param=color255|Sets an RGB color for the entity. Requires the entity to have its '''[[Render Mode]] (rendermode)''' set to <code>1</code>.}}
{{I|SetCycle|param=float|Skip to a specific point in the current animation.|only={{tf2branch}}}}
{{IO|SetDamageFilter|param=targetname|Sets a [[filter]] for this entity for when it receives damage.}}
{{I|SetPlayBackRate|param=float|Change the animation speed multiplier.}}
{{IO|EnableDamageForces|Makes it so that the entity will be pushed by damage done to it (usually force amount correlates with the damage done).}}
 
{{IO|DisableDamageForces|Prevents the entity from being pushed by damage done to it.}}
=== Lighting / Shadow / Reflectinos ===
{{IO|EnableShadow|Makes it so that the entity will draw a [[render target]] shadow.}}
{{I|SetLightingOrigin|param=targetname|Sets the entity's lighting origin to use this entity's position.}}
{{IO|DisableShadow|Prevents the entity from drawing a [[render target]] shadow.}}
{{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|EnableDraw|since=P2|Removes {{ent|EF_NODRAW}} from the entity.}}
{{I Shadow}}
{{IO|DisableDraw|since=P2|Applies {{ent|EF_NODRAW}} to the entity. Note that this is different than {{ent|rendermode|10}}.}}
{{I Reflection}}
{{IO|EnableReceivingFlashlight|since=P2|Makes it so that the entity is lit by {{ent|env_projectedtexture}}s.}}
 
{{IO|DisableReceivingFlashlight|since=P2|Prevents the entity from being lit by {{ent|env_projectedtexture}}s. The shadow made by the texture will still cast.}}
=== Miscellaneous ===
{{IO|EnableDrawInFastReflection|since=P2|Makes the entity render in fast reflections. {{todo|Clarify what "fast reflections" are. It seems to be associated with water in Portal 2.}}}}
{{I|SetDamageFilter|param=targetname|Sets a [[filter]] for this entity for when it receives damage.}}
{{IO|DisableDrawInFastReflection|since=P2|Prevents the entity from rendering in fast reflections.}}
{{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.