Env gravity: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
 
(11 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{This is a|point|name=env_gravity|game=Black Mesa}} This entity manage gravity, friction and fall damage scale. Affects globally for all clients/players and doesn't affects for other objects (physics objects, [[NPC|NPCs]], e. t. c.). Used in [[xen]] levels from the original campaign to disable fall damage and set player's gravity to the slightly lower gravity value than in earthbound levels.
{{CDA|CEnvGravity|CBaseEntity|}}
 
{{This is a|logical entity|name=env_gravity|game=Black Mesa}} This entity manage gravity, friction and fall damage scale. Affects globally for all clients/players and doesn't affects for other objects (physics objects, [[NPC|NPCs]], e. t. c.). Used in [[xen]] levels from the original campaign to disable fall damage and set player's gravity to the slightly lower gravity value than in earthbound levels.
==Keyvalues==
{{KV BaseEntity|noscroll=1}}


==Inputs==
==Inputs==
{{IO|SetGravity|param=integer|Set {{code|sv_gravity}} to specific amount. Value in xen levels is 420. Value in earthbound levels is 600 (the default value).
{{I|SetGravity|param=integer|Set {{code|sv_gravity}} to specific amount. Value in xen levels is 420. Value in earthbound levels is 600 (the default value).}}
{{bug|Value 248 and lower breaks player's jump. It feels like player's jump is too low.
:{{bug|hidetested=1|Value 248 and lower breaks player's jump. It feels like player's jump is too low. [https://www.youtube.com/watch?v{{=}}xegwv1l9q10 Example] of the bug.}}
{{expand|title=Example.|
{{I|SetFriction|param=integer|Set {{code|sv_friction}} to specific amount. With 0 player will slide endlessly. High values will hinder players movement, making them slower. The default value is 4.}}
<br>
:{{note|Even with 0, player's sliding speed has a limit, but only if player is standing. With crouch you can achieve high speed.}}
<gallery mode=packed heights=390px>
:{{bug|hidetested=1|With 0 value, physics objects in sleep state push player away. Moving physics objects kills player with a high chance. [https://www.youtube.com/watch?v{{=}}Ohp0E7s7UaU Example] of the bug.}}
File:env_gravityBug1.gif|Issue showcase.
{{I|SetFallDamageScale|param=float|Set {{code|sv_falldamagescale}} to specific amount. Value in xen levels is 0, so, player even don't need [[Item longjump|longjump module]] to escape fall damage in xen. Value in earthbound levels is 1 (the default value). With 355.2 value, player will die in any case if take fall damage.}}
</gallery>
}}
}}
}}
{{IO|SetFriction|param=integer|Set {{code|sv_friction}} to specific amount. With 0 player will slide endlessly. High values will hinder players movement, making them slower. The default value is 4.
{{note|Even with 0, player's sliding speed has a limit, but only if player is standing. With crouch you can achieve high speed.}}
{{note|With 0 value, physics objects in sleep state push player away. Moving physics objects kill player with hight with a high chance.
{{expand|title=Example.|
<br>
<gallery mode=packed heights=390px>
File:env_gravityBug2.gif|Showcase.
</gallery>
}}
}}
}}
{{IO|SetFallDamageScale|param=float|Set {{code|sv_falldamagescale}} to specific amount. Value in xen levels is 0, so, player even don't need [[Item longjump|longjump module]] to escape fall damage in xen. Value in earthbound levels is 1 (the default value). With 355.2 value, player will die in any case if take fall damage.}}
 
{{I BaseEntity|noscroll=0}}
 
==Outputs==
{{O BaseEntity|hl2=1}}


== See also ==
== See also ==
* {{ent|trigger_gravity}}
* {{ent|trigger_gravity}}
* [[Gravity]]
* [[Gravity]]

Latest revision as of 23:45, 26 May 2025

C++ Class hierarchy
CEnvGravity
CBaseEntity

env_gravity is a logical entity available in Black Mesa Black Mesa. This entity manage gravity, friction and fall damage scale. Affects globally for all clients/players and doesn't affects for other objects (physics objects, NPCs, e. t. c.). Used in xen levels from the original campaign to disable fall damage and set player's gravity to the slightly lower gravity value than in earthbound levels.

Inputs

SetGravity <integerRedirectInput/integer>
Set sv_gravity to specific amount. Value in xen levels is 420. Value in earthbound levels is 600 (the default value).
Icon-Bug.pngBug:Value 248 and lower breaks player's jump. It feels like player's jump is too low. Example of the bug.
SetFriction <integerRedirectInput/integer>
Set sv_friction to specific amount. With 0 player will slide endlessly. High values will hinder players movement, making them slower. The default value is 4.
Note.pngNote:Even with 0, player's sliding speed has a limit, but only if player is standing. With crouch you can achieve high speed.
Icon-Bug.pngBug:With 0 value, physics objects in sleep state push player away. Moving physics objects kills player with a high chance. Example of the bug.
SetFallDamageScale <floatRedirectInput/float>
Set sv_falldamagescale to specific amount. Value in xen levels is 0, so, player even don't need longjump module to escape fall damage in xen. Value in earthbound levels is 1 (the default value). With 355.2 value, player will die in any case if take fall damage.

See also