mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Add physics overrides for walk speed and Fast Mode (#14475)
Co-authored-by: Wuzzy <Wuzzy@disroot.org>
This commit is contained in:
parent
c044a3c1ca
commit
2bdd0a6bdb
8 changed files with 94 additions and 33 deletions
|
@ -702,8 +702,18 @@ Methods:
|
|||
```lua
|
||||
{
|
||||
speed = float,
|
||||
speed_climb = float,
|
||||
speed_crouch = float,
|
||||
speed_fast = float,
|
||||
speed_walk = float,
|
||||
acceleration_default = float,
|
||||
acceleration_air = float,
|
||||
acceleration_fast = float,
|
||||
jump = float,
|
||||
gravity = float,
|
||||
liquid_fluidity = float,
|
||||
liquid_fluidity_smooth = float,
|
||||
liquid_sink = float,
|
||||
sneak = boolean,
|
||||
sneak_glitch = boolean,
|
||||
new_move = boolean,
|
||||
|
@ -719,7 +729,8 @@ Methods:
|
|||
* `get_breath()`
|
||||
* returns the player's breath
|
||||
* `get_movement_acceleration()`
|
||||
* returns acceleration of the player in different environments:
|
||||
* returns acceleration of the player in different environments
|
||||
(note: does not take physics overrides into account):
|
||||
|
||||
```lua
|
||||
{
|
||||
|
@ -730,7 +741,8 @@ Methods:
|
|||
```
|
||||
|
||||
* `get_movement_speed()`
|
||||
* returns player's speed in different environments:
|
||||
* returns player's speed in different environments
|
||||
(note: does not take physics overrides into account):
|
||||
|
||||
```lua
|
||||
{
|
||||
|
@ -743,7 +755,8 @@ Methods:
|
|||
```
|
||||
|
||||
* `get_movement()`
|
||||
* returns player's movement in different environments:
|
||||
* returns player's movement in different environments
|
||||
(note: does not take physics overrides into account):
|
||||
|
||||
```lua
|
||||
{
|
||||
|
|
|
@ -8089,13 +8089,18 @@ child will follow movement and rotation of that bone.
|
|||
* `set_physics_override(override_table)`
|
||||
* Overrides the physics attributes of the player
|
||||
* `override_table` is a table with the following fields:
|
||||
* `speed`: multiplier to default movement speed and acceleration values (default: `1`)
|
||||
* `jump`: multiplier to default jump value (default: `1`)
|
||||
* `gravity`: multiplier to default gravity value (default: `1`)
|
||||
* `speed`: multiplier to *all* movement speed (`speed_*`) and
|
||||
acceleration (`acceleration_*`) values (default: `1`)
|
||||
* `speed_walk`: multiplier to default walk speed value (default: `1`)
|
||||
* Note: The actual walk speed is the product of `speed` and `speed_walk`
|
||||
* `speed_climb`: multiplier to default climb speed value (default: `1`)
|
||||
* Note: The actual climb speed is the product of `speed` and `speed_climb`
|
||||
* `speed_crouch`: multiplier to default sneak speed value (default: `1`)
|
||||
* Note: The actual sneak speed is the product of `speed` and `speed_crouch`
|
||||
* `speed_fast`: multiplier to default speed value in Fast Mode (default: `1`)
|
||||
* Note: The actual fast speed is the product of `speed` and `speed_fast`
|
||||
* `jump`: multiplier to default jump value (default: `1`)
|
||||
* `gravity`: multiplier to default gravity value (default: `1`)
|
||||
* `liquid_fluidity`: multiplier to liquid movement resistance value
|
||||
(for nodes with `liquid_move_physics`); the higher this value, the lower the
|
||||
resistance to movement. At `math.huge`, the resistance is zero and you can
|
||||
|
@ -8113,6 +8118,8 @@ child will follow movement and rotation of that bone.
|
|||
* `acceleration_air`: multiplier to acceleration
|
||||
when jumping or falling (default: `1`)
|
||||
* Note: The actual acceleration is the product of `speed` and `acceleration_air`
|
||||
* `acceleration_fast`: multiplier to acceleration in Fast Mode (default: `1`)
|
||||
* Note: The actual acceleration is the product of `speed` and `acceleration_fast`
|
||||
* `sneak`: whether player can sneak (default: `true`)
|
||||
* `sneak_glitch`: whether player can use the new move code replications
|
||||
of the old sneak side-effects: sneak ladders and 2 node sneak jump
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue