Player Physics: Improvements

This commit is contained in:
Ezhh 2017-09-03 00:49:00 +01:00 committed by rubenwardy
parent 1103e86580
commit c90d890192

View File

@ -8,15 +8,17 @@ root: ../../
Player physics can be modified using physics overrides. Physics overrides can set the
walking speed, jump speed and gravity constants. Physics overrides are set on a player
by player basis, and are multipliers - a value of 2 for gravity would make gravity twice
as strong.
by player basis, and are multipliers. For example, a value of 2 for gravity would make
gravity twice as strong.
* Basic Interface
* Your Turn
* [Basic Example](#basic_example)
* [Available Overrides](#available_overrides)
* [Mod Incompatibility ](#mod_incompatibility)
* [Your Turn](#your_turn)
## Basic Interface
## Basic Example
Here is an example which adds an antigravity command, which
Here is an example of how to add an antigravity command, which
puts the caller in low G:
{% highlight lua %}
@ -31,7 +33,7 @@ minetest.register_chatcommand("antigravity", {
})
{% endhighlight %}
### Possible Overrides
## Available Overrides
player:set_physics_override() is given a table of overrides.\\
According to [lua_api.txt](../lua_api.html#player-only-no-op-for-other-objects),
@ -41,22 +43,29 @@ these can be:
* jump: multiplier to default jump value (default: 1)
* gravity: multiplier to default gravity value (default: 1)
* sneak: whether player can sneak (default: true)
* sneak_glitch: whether player can use the sneak glitch (default: true)
The sneak glitch allows the player to climb an 'elevator' made out of
a certain placement of blocks by sneaking (pressing shift) and pressing
space to ascend. It was originally a bug in Minetest, but was kept as
it is used on many servers to get to higher levels.
They added the option above so you can disable it.
### Old Movement Behaviour
### Multiple mods
Player movement prior to the 0.4.16 release included the sneak glitch, which
allows various movement glitches, including the ability
to climb an 'elevator' made from a certain placement of nodes by sneaking
(pressing shift) and pressing space to ascend. Though the behaviour was
unintended, it has been preserved in overrides due to its use on many servers.
Please be warned that mods that override the same physics values of a player tend
Two overrides are needed to fully restore old movement behaviour:
* new_move: whether the player uses new movement (default: true)
* sneak_glitch: whether the player can use 'sneak elevators' (default: false)
## Mod Incompatibility
Please be warned that mods which override the same physics value of a player tend
to be incompatible with each other. When setting an override, it overwrites
any overrides that have been set before, by your or anyone else's mod.
any overrides that have been set before. This means that if multiple overrides set a
player's speed, only the last one to run will be in effect.
## Your Turn
* **sonic**: Set the speed multiplayer to a high value (at least 6) when a player joins the game.
* **super bounce**: Increase the jump value so that the player can jump up 20 meters (1 meter is 1 block).
* **space**: Make the gravity decrease as the player gets higher and higher up.
* **Sonic**: Set the speed multiplier to a high value (at least 6) when a player joins the game.
* **Super bounce**: Increase the jump value so that the player can jump 20 meters (1 meter is 1 node).
* **Space**: Make gravity decrease as the player gets higher.