I'm gonna try animated particles…
[Mod] Sprint [sprint]
- texmex
- Member
- Posts: 1753
- Joined: Mon Jul 11, 2016 21:08
- GitHub: tacotexmex
- In-game: tacotexmex
- LMD
- Member
- Posts: 1397
- Joined: Sat Apr 08, 2017 08:16
- GitHub: appgurueu
- IRC: appguru[eu]
- In-game: LMD
- Location: Germany
- Contact:
Re: [Mod] Sprint [sprint]
Very basic requirement. However, not compatible with other speed potions etc, insert this code to change :
Replace the original sprint function. Note : This interprets sprint as AMPLIFICATION, not as ADDITION! Thats a huge difference.
Code: Select all
local function setSprinting(playerName, sprinting) --Sets the state of a player (0=stopped/moving, 1=sprinting)
local player = minetest.get_player_by_name(playerName)
if players[playerName] then
local physics=player:get_physics_override()
local was_sprinting=players[playerName]["sprinting"]
players[playerName]["sprinting"] = sprinting
if sprinting == true then
if not was_sprinting then
player:set_physics_override({speed=physics["speed"]*SPRINT_SPEED,jump=physics["jump"]*SPRINT_JUMP})
end
elseif sprinting == false then
if was_sprinting then
player:set_physics_override({speed=physics.speed/SPRINT_SPEED,jump=physics.jump/SPRINT_JUMP})
end
end
return true
end
return false
end
Re: [Mod] Sprint [sprint]
awesome thank you !
Re: [Mod] Sprint [sprint]
Is this outdated? I get an error:
[EDIT] It's working as standalone, but not with HudBars 2.3.2 (as you can see in the log)[END]
AsyncErr: ServerThread::run Lua: Runtime error from mod 'sprint' in callback on_joinplayer(): ...\Desktop\Minetest\bin\..\builtin\common\misc_helpers.lua:631: Too many arguments provided to core.translate
stack traceback:
[C]: in function 'error'
...\Desktop\Minetest\bin\..\builtin\common\misc_helpers.lua:631: in function 'S'
...test\bin\..\mods\minetest_hudbars-2.3.2-a7fcac4\init.lua:78: in function 'make_label'
...test\bin\..\mods\minetest_hudbars-2.3.2-a7fcac4\init.lua:193: in function 'add_all'
...test\bin\..\mods\minetest_hudbars-2.3.2-a7fcac4\init.lua:303: in function 'init_hudbar'
...ers\Sten\Desktop\Minetest\bin\..\mods\sprint/esprint.lua:37: in function <...ers\Sten\Desktop\Minetest\bin\..\mods\sprint/esprint.lua:27>
...s\Sten\Desktop\Minetest\bin\..\builtin\game\register.lua:429: in function <...s\Sten\Desktop\Minetest\bin\..\builtin\game\register.lua:413>
[EDIT] It's working as standalone, but not with HudBars 2.3.2 (as you can see in the log)[END]
AsyncErr: ServerThread::run Lua: Runtime error from mod 'sprint' in callback on_joinplayer(): ...\Desktop\Minetest\bin\..\builtin\common\misc_helpers.lua:631: Too many arguments provided to core.translate
stack traceback:
[C]: in function 'error'
...\Desktop\Minetest\bin\..\builtin\common\misc_helpers.lua:631: in function 'S'
...test\bin\..\mods\minetest_hudbars-2.3.2-a7fcac4\init.lua:78: in function 'make_label'
...test\bin\..\mods\minetest_hudbars-2.3.2-a7fcac4\init.lua:193: in function 'add_all'
...test\bin\..\mods\minetest_hudbars-2.3.2-a7fcac4\init.lua:303: in function 'init_hudbar'
...ers\Sten\Desktop\Minetest\bin\..\mods\sprint/esprint.lua:37: in function <...ers\Sten\Desktop\Minetest\bin\..\mods\sprint/esprint.lua:27>
...s\Sten\Desktop\Minetest\bin\..\builtin\game\register.lua:429: in function <...s\Sten\Desktop\Minetest\bin\..\builtin\game\register.lua:413>
-
- New member
- Posts: 7
- Joined: Fri Sep 02, 2016 04:41
- IRC: Hoffscore or csisdustin
- In-game: Hoff
- Location: University Heights, Calgary, AB, Canada
Re: [Mod] Sprint [sprint]
OOps! Not your Mod, but I can't delete this posting???
HBSprint says no dependancies, but requires hunger value? runs in Jaunchi game which has no hunger value...
AsyncErr: Lua: Runtime error from mod '' in callback environment_Step(): ...-5.5.0-win64\bin\..\games\juanchi\mods\hbsprint\init.lua:232: attempt to index global 'hbhunger' (a nil value)
stack traceback:
...-5.5.0-win64\bin\..\games\juanchi\mods\hbsprint\init.lua:232: in function 'sprint_step'
...-5.5.0-win64\bin\..\games\juanchi\mods\hbsprint\init.lua:257: in function <...-5.5.0-win64\bin\..\games\juanchi\mods\hbsprint\init.lua:253>
...st\minetest-5.5.0-win64\bin\..\builtin\game\register.lua:425: in function <...st\minetest-5.5.0-win64\bin\..\builtin\game\register.lua:409>
sorry, I'll cut this when my brain works..
HBSprint says no dependancies, but requires hunger value? runs in Jaunchi game which has no hunger value...
AsyncErr: Lua: Runtime error from mod '' in callback environment_Step(): ...-5.5.0-win64\bin\..\games\juanchi\mods\hbsprint\init.lua:232: attempt to index global 'hbhunger' (a nil value)
stack traceback:
...-5.5.0-win64\bin\..\games\juanchi\mods\hbsprint\init.lua:232: in function 'sprint_step'
...-5.5.0-win64\bin\..\games\juanchi\mods\hbsprint\init.lua:257: in function <...-5.5.0-win64\bin\..\games\juanchi\mods\hbsprint\init.lua:253>
...st\minetest-5.5.0-win64\bin\..\builtin\game\register.lua:425: in function <...st\minetest-5.5.0-win64\bin\..\builtin\game\register.lua:409>
sorry, I'll cut this when my brain works..
Last edited by Hoffscore on Mon Feb 14, 2022 18:59, edited 1 time in total.
- LMD
- Member
- Posts: 1397
- Joined: Sat Apr 08, 2017 08:16
- GitHub: appgurueu
- IRC: appguru[eu]
- In-game: LMD
- Location: Germany
- Contact:
Re: [Mod] Sprint [sprint]
Wrong topic. The mod you're having issues with clearly is hbsprint.Hoffscore wrote: ↑Sun Feb 13, 2022 00:38Sprint says no dependancies, but requires hunger value? Jaunchi game has no hunger value...
AsyncErr: Lua: Runtime error from mod '' in callback environment_Step(): ...-5.5.0-win64\bin\..\games\juanchi\mods\hbsprint\init.lua:232: attempt to index global 'hbhunger' (a nil value)
stack traceback:
...-5.5.0-win64\bin\..\games\juanchi\mods\hbsprint\init.lua:232: in function 'sprint_step'
...-5.5.0-win64\bin\..\games\juanchi\mods\hbsprint\init.lua:257: in function <...-5.5.0-win64\bin\..\games\juanchi\mods\hbsprint\init.lua:253>
...st\minetest-5.5.0-win64\bin\..\builtin\game\register.lua:425: in function <...st\minetest-5.5.0-win64\bin\..\builtin\game\register.lua:409>
Who is online
Users browsing this forum: No registered users and 29 guests