Per-player speed / jump / gravity overrides #598
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since I coded the new player physics, people frequently asked if something could be done to create low gravity areas and allow per-player weights. RealBadAngel also said he's like to do a jump boots powerup for one of his ideas, and I don't think running boots would be a bad idea either (or slow nodes like MineCraft's "soul sand").
So here's a patch which allows doing all that. It implements a new Lua function that can modify walking speed, jump height and gravity for individual players. To test it, use this function in a Lua script: player:set_physics_override(float_speed, float_jump, float_gravity). By default all values are 1... 0.5 means half of the normal amount while 2 means double the normal amount. They basically multiply the global physics settings in minetest.conf for individual players as optional overrides. I found this the cleanest and safest implementation so I hope no major changes are needed.