From c90d89019265b2efe78bc5902ee44fc2f862be36 Mon Sep 17 00:00:00 2001 From: Ezhh Date: Sun, 3 Sep 2017 00:49:00 +0100 Subject: [PATCH] Player Physics: Improvements --- en/chapters/player_physics.md | 47 +++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/en/chapters/player_physics.md b/en/chapters/player_physics.md index 8f4d87c..a8aab95 100644 --- a/en/chapters/player_physics.md +++ b/en/chapters/player_physics.md @@ -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.