Page 1 of 4

[Mod] Sprint [sprint]

PostPosted: Tue Jul 01, 2014 04:03
by GunshipPenguin
Allows the player to sprint by either double tapping w or pressing e. By default, sprinting will make the player travel 80% faster and allow him/her to jump 10% higher. Also adds a stamina bar that goes down when the player sprints and goes up when he/she isn't sprinting.

This mod is compatible with the HUD bars [hudbars] mod, but does not depend on it. In this care, a green HUD bar will be displayed, also showing a number. If this mod is not present, a standard statbar with 0-20 “half-arrows” is shown, which is a bit more coarse than the HUD bar version.

Speed while sprinting, jump height while sprinting, and other things can be configured. See README.md for details.

Licence: CC0
Dependencies: None

GitHub: https://github.com/GunshipPenguin/sprint

Re: [Mod] Sprint [sprint]

PostPosted: Tue Jul 01, 2014 04:57
by philipbenr
Very nice. With this, I can look for a way to tune down the default run speed. This helps a lot.

Re: [Mod] Sprint [sprint]

PostPosted: Tue Jul 01, 2014 14:03
by Wuzzy
For the future, I post a copy of sprint.tar.gz as an attachment here, just in case Sendspace deletes the file at some point in time.

Edit: OK, now since this mod is on GitHub, I recommend downloading it from GitHub instead. My copy is probably outdated now. ;-)

Re: [Mod] Sprint [sprint]

PostPosted: Tue Jul 01, 2014 15:40
by Bas080
Good mod! I changed movement_speed_walk to 2.7 so Sam happily walks down stairs instead of dropping. And changed the SPRINT_SPEED to 2.5 for a quick sprint.

Re: [Mod] Sprint [sprint]

PostPosted: Tue Jul 01, 2014 17:04
by philipbenr
I suggest using GitHub or some better online hosting service.

Re: [Mod] Sprint [sprint]

PostPosted: Tue Jul 01, 2014 20:35
by Vazon
There is a way to adjust the player running speed already in the minetest.config. Unless I misunderstand this mod is kind of pointless in the matter

Re: [Mod] Sprint [sprint]

PostPosted: Tue Jul 01, 2014 20:38
by BrandonReese
Vazon wrote:There is a way to adjust the player running speed already in the minetest.config. Unless I misunderstand this mod is kind of pointless in the matter


He uses set_physics_override to to increase the player's speed when they double tap 'w'.

Very clever mod, I will probably adapt this into Adventuretest so players can sprint without a fast priv, and the fast priv can be reserved for very fast movement for admins/moderators.

Re: [Mod] Sprint [sprint]

PostPosted: Wed Jul 02, 2014 02:07
by GunshipPenguin
Thanks for all the feedback everybody.

Re: [Mod] Sprint [sprint]

PostPosted: Wed Jul 02, 2014 19:19
by Calinou
Double-tap is annoying and hurts fingers; it'd be a better idea to use the “special” key, which is available for players without the “fast” privilege (which is what this mod is intended for).

This way, players with “fast” privilege can still go very fast if needed.

For hosting, I suggest learning some Git (very useful for mod development, it's often used in here) and using Gitorious.

Re: [Mod] Sprint [sprint]

PostPosted: Wed Jul 02, 2014 20:57
by Evergreen
Calinou wrote:Double-tap is annoying and hurts fingers; it'd be a better idea to use the “special” key, which is available for players without the “fast” privilege (which is what this mod is intended for).

This way, players with “fast” privilege can still go very fast if needed.

For hosting, I suggest learning some Git (very useful for mod development, it's often used in here) and using Gitorious.

Or Github. Calinou doesn't use it because technically it is proprietary, but choose whichever one you want.

Re: [Mod] Sprint [sprint]

PostPosted: Thu Jul 03, 2014 07:15
by GunshipPenguin
Took your guys's advice, project is now on GitHub.

Re: [Mod] Sprint [sprint]

PostPosted: Thu Jul 03, 2014 13:34
by trainwrecktony
worked for a while but i did get crash .... minetest git with gsmapper

Code: Select all
ERROR[main]: ERROR: An unhandled exception occurred: C:\minetestdev\bin\..\games\twt\mods\sprint\init.lua:18: attempt to index global 'player' (a nil value)
23:07:38: ERROR[main]: stack traceback:
23:07:38: ERROR[main]:    C:\minetestdev\bin\..\games\twt\mods\sprint\init.lua:18: in function <C:\minetestdev\bin\..\games\twt\mods\sprint\init.lua:12>
23:07:38: ERROR[main]:    C:\minetestdev\bin\..\builtin\game\register.lua:348: in function <C:\minetestdev\bin\..\builtin\game\register.lua:336>


Re: [Mod] Sprint [sprint]

PostPosted: Thu Jul 03, 2014 22:49
by GunshipPenguin
trainwrecktony wrote:worked for a while but i did get crash .... minetest git with gsmapper

Code: Select all
ERROR[main]: ERROR: An unhandled exception occurred: C:\minetestdev\bin\..\games\twt\mods\sprint\init.lua:18: attempt to index global 'player' (a nil value)
23:07:38: ERROR[main]: stack traceback:
23:07:38: ERROR[main]:    C:\minetestdev\bin\..\games\twt\mods\sprint\init.lua:18: in function <C:\minetestdev\bin\..\games\twt\mods\sprint\init.lua:12>
23:07:38: ERROR[main]:    C:\minetestdev\bin\..\builtin\game\register.lua:348: in function <C:\minetestdev\bin\..\builtin\game\register.lua:336>



I think I know what's causing this. Did this happen when you were playing with multiple people, or just singleplayer?

EDIT: Just made a commit that I think should fix this, try it out.

Re: [Mod] Sprint [sprint]

PostPosted: Fri Jul 04, 2014 03:48
by trainwrecktony
Was playing on my server , 3 players online, just me using the feature
New commit seems to be working so far no crash will update if happens

Re: [Mod] Sprint [sprint]

PostPosted: Thu Aug 28, 2014 17:30
by Minetestforfun
Very good mod, i haven't crash yet :)

Can you add a stop sprint when a player do a mouse click ?
Can you add a sprint effect for the first player view and the model, like a fast movment effect ? (like Mine****t ... ?)

Re: [Mod] Sprint [sprint]

PostPosted: Sun Aug 31, 2014 22:22
by GunshipPenguin
Minetestforfun wrote:Very good mod, i haven't crash yet :)

Can you add a stop sprint when a player do a mouse click ?
Can you add a sprint effect for the first player view and the model, like a fast movment effect ? (like Mine****t ... ?)


Hi, Thanks for the feedback.

I modified the code so the player will stop sprinting when the right mouse button is pressed. I'm not sure that I want it to be included in the Github repo though, so I uploaded it to Sendspace for you. Let me know if you find any bugs and I'll do my best to fix them.

https://www.sendspace.com/file/nh3xoh

You can toggle stop on sprint by changing the STOP_ON_CLICK variable and you can toggle which mouse button stops the player with the STOP_KEY variable (Set it to "RMB" for right mouse button and "LMB" for left mouse button, by default it is "RMB").

As for a sprint effect like Minecraft, I wanted to do that, however, I couldn't find a way to increase the player's FOV while sprinting and I'm not sure how I would go about creating sprint particles behind the player's feet like in Minecraft. If I figure out how to do that, I'll include it in the mod.

Re: [Mod] Sprint [sprint]

PostPosted: Mon Sep 01, 2014 00:09
by Minetestforfun
Thank you for your work, i try soon your modified code !

EDIT : it doesn't work with the stop_key define like that :
STOP_ON_CLICK = true
STOP_KEY = "RMB", "LMB"

Re: [Mod] Sprint [sprint]

PostPosted: Mon Sep 01, 2014 05:16
by 4aiman
So.. the old sprinting was abandoned?
Does the new one considers there maybe other mods that change physics?
What about stop sprinting if a player has touched a wall?

Re: [Mod] Sprint [sprint]

PostPosted: Mon Sep 01, 2014 06:16
by GunshipPenguin
Minetestforfun wrote:Thank you for your work, i try soon your modified code !

EDIT : it doesn't work with the stop_key define like that :
STOP_ON_CLICK = true
STOP_KEY = "RMB", "LMB"


The way I've written it, you can't use both mouse keys to stop the player from sprinting. I made another modified version where the player will stop sprinting if either the left mouse button or the right mouse button is pressed. It's also hosted on sendspace: https://www.sendspace.com/file/co5ccd

4aiman wrote:So.. the old sprinting was abandoned?
Does the new one considers there maybe other mods that change physics?
What about stop sprinting if a player has touched a wall?


I don't get what you're trying to say. I didn't change any code in the repo on Github, I just made a modified version and uploaded it to sendspace for Minetestforfun.
Also, I'll look into stopping sprinting if the player hits a wall.

Re: [Mod] Sprint [sprint]

PostPosted: Mon Sep 01, 2014 12:26
by Minetestforfun
@4aiman
Very good idea !
Maybe it is an future feature that would promotes creating jumping-levels [subgame/mod]

@GunshipPenguin
Ok, thank you, i try it soon

EDIT : it works perfectly, thank you

Re: [Mod] Sprint [sprint]

PostPosted: Mon Sep 01, 2014 20:27
by 4aiman
@GunshipPenguin
You, probably, won't get it at all, since you have only 6 messages which, in turn, means you're probably rather new here.
The old sprinting mod is buried somewhere @forum.minetest.net and I can't seem to find it.
So, nevermind the prelude. You got the question quite right.
Regards!

Re: [Mod] Sprint [sprint]

PostPosted: Wed Sep 03, 2014 03:10
by GunshipPenguin
4aiman wrote:@GunshipPenguin
You, probably, won't get it at all, since you have only 6 messages which, in turn, means you're probably rather new here.
The old sprinting mod is buried somewhere @forum.minetest.net and I can't seem to find it.
So, nevermind the prelude. You got the question quite right.
Regards!


Ah, I see. Sorry for any confusion.

Re: [Mod] Sprint [sprint]

PostPosted: Tue Sep 30, 2014 05:06
by GunshipPenguin
Added particle effect while sprinting and made sprinting a bit smoother.

Re: [Mod] Sprint [sprint]

PostPosted: Sat Nov 08, 2014 08:40
by GunshipPenguin
Cleaned up the code, updated the readme, and added the ablility to limit how much players can sprint via the SPRINT_STAMINA variable.

Re: [Mod] Sprint [sprint]

PostPosted: Sat Nov 08, 2014 16:56
by Don
Nice work!