Limit falling speed

User avatar
Extex
Member
 
Posts: 127
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Limit falling speed

by Extex » Fri Nov 22, 2019 03:16

Is there someway to limit how fast the player falls?
Player of PK, RIP. Creator of the light_tool mod. Working on another mod which is pretty cool so far
 

Skamiz Kazzarch
Member
 
Posts: 104
Joined: Fri Mar 09, 2018 20:34
Location: la lojbaugag.
GitHub: Skamiz
In-game: Skamiz

Re: Limit falling speed

by Skamiz Kazzarch » Fri Nov 22, 2019 09:44

I immagine you could use get_player_velocity() in globalstep to find out the current speed and if it's too fast use add_player_velocity() to slow the player down.
Relevant lua api: https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L5673

Though I suspect it would still be somewhat janky it would probably prevent these situations where you are falling several hundres of block per second.
 

warpnarget
New member
 
Posts: 9
Joined: Sat Oct 12, 2019 21:34
In-game: warpnarget

Re: Limit falling speed

by warpnarget » Fri Nov 22, 2019 19:51

what if someone likes falling hundreds of blocks per second
 

User avatar
Linuxdirk
Member
 
Posts: 2219
Joined: Wed Sep 17, 2014 11:21
Location: Germany
In-game: Linuxdirk
 

Skamiz Kazzarch
Member
 
Posts: 104
Joined: Fri Mar 09, 2018 20:34
Location: la lojbaugag.
GitHub: Skamiz
In-game: Skamiz

Re: Limit falling speed

by Skamiz Kazzarch » Sat Nov 23, 2019 07:28

Derp, didn't even thought of that.
That should certainly slow down the initial fall, but will it stop it stop the player from acumulating those stupidly large speeds over large distances?
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 1 guest