[Mod] Sprint [sprint]

User avatar
GunshipPenguin
Member
Posts: 94
Joined: Tue Jan 28, 2014 00:38
GitHub: GunshipPenguin
IRC: GunshipPenguin
In-game: GunshipPenguin
Location: Vancouver, BC

[Mod] Sprint [sprint]

by GunshipPenguin » Post

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
Last edited by GunshipPenguin on Mon Feb 23, 2015 22:01, edited 6 times in total.

User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

Re: [Mod] Sprint [sprint]

by philipbenr » Post

Very nice. With this, I can look for a way to tune down the default run speed. This helps a lot.

User avatar
Wuzzy
Member
Posts: 4781
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Re: [Mod] Sprint [sprint]

by Wuzzy » Post

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. ;-)
Attachments
sprint.tar.gz
(1.16 KiB) Downloaded 1202 times
Last edited by Wuzzy on Mon Feb 09, 2015 19:27, edited 1 time in total.

User avatar
Bas080
Member
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080
Location: Netherlands

Re: [Mod] Sprint [sprint]

by Bas080 » Post

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.

User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

Re: [Mod] Sprint [sprint]

by philipbenr » Post

I suggest using GitHub or some better online hosting service.

Vazon
Member
Posts: 191
Joined: Sat Aug 17, 2013 17:20
IRC: Vazon
In-game: Vazon
Location: Tennessee, U.S

Re: [Mod] Sprint [sprint]

by Vazon » Post

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

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

Re: [Mod] Sprint [sprint]

by BrandonReese » Post

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.

User avatar
GunshipPenguin
Member
Posts: 94
Joined: Tue Jan 28, 2014 00:38
GitHub: GunshipPenguin
IRC: GunshipPenguin
In-game: GunshipPenguin
Location: Vancouver, BC

Re: [Mod] Sprint [sprint]

by GunshipPenguin » Post

Thanks for all the feedback everybody.

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

Re: [Mod] Sprint [sprint]

by Calinou » Post

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.

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

Re: [Mod] Sprint [sprint]

by Evergreen » Post

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.
Last edited by Jordach on Thu Jul 03, 2014 14:23, edited 1 time in total.
Reason: spell check next time (there isn't supposed to be two "it")

User avatar
GunshipPenguin
Member
Posts: 94
Joined: Tue Jan 28, 2014 00:38
GitHub: GunshipPenguin
IRC: GunshipPenguin
In-game: GunshipPenguin
Location: Vancouver, BC

Re: [Mod] Sprint [sprint]

by GunshipPenguin » Post

Took your guys's advice, project is now on GitHub.

trainwrecktony
Member
Posts: 67
Joined: Sun Jun 08, 2014 05:24
In-game: trainwrecktony
Location: NJ USA

Re: [Mod] Sprint [sprint]

by trainwrecktony » Post

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>

Server Owner trainwrecktony.serveminecraft.net:30000 irc.freenode.net ##minetest-trainwrecktony

User avatar
GunshipPenguin
Member
Posts: 94
Joined: Tue Jan 28, 2014 00:38
GitHub: GunshipPenguin
IRC: GunshipPenguin
In-game: GunshipPenguin
Location: Vancouver, BC

Re: [Mod] Sprint [sprint]

by GunshipPenguin » Post

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.

trainwrecktony
Member
Posts: 67
Joined: Sun Jun 08, 2014 05:24
In-game: trainwrecktony
Location: NJ USA

Re: [Mod] Sprint [sprint]

by trainwrecktony » Post

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
Server Owner trainwrecktony.serveminecraft.net:30000 irc.freenode.net ##minetest-trainwrecktony

User avatar
Minetestforfun
Member
Posts: 940
Joined: Tue Aug 05, 2014 14:09
GitHub: MinetestForFun
IRC: MinetestForFun
In-game: MinetestForFun
Location: On earth
Contact:

Re: [Mod] Sprint [sprint]

by Minetestforfun » Post

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 ... ?)

User avatar
GunshipPenguin
Member
Posts: 94
Joined: Tue Jan 28, 2014 00:38
GitHub: GunshipPenguin
IRC: GunshipPenguin
In-game: GunshipPenguin
Location: Vancouver, BC

Re: [Mod] Sprint [sprint]

by GunshipPenguin » Post

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.

User avatar
Minetestforfun
Member
Posts: 940
Joined: Tue Aug 05, 2014 14:09
GitHub: MinetestForFun
IRC: MinetestForFun
In-game: MinetestForFun
Location: On earth
Contact:

Re: [Mod] Sprint [sprint]

by Minetestforfun » Post

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"

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Sprint [sprint]

by 4aiman » Post

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?

User avatar
GunshipPenguin
Member
Posts: 94
Joined: Tue Jan 28, 2014 00:38
GitHub: GunshipPenguin
IRC: GunshipPenguin
In-game: GunshipPenguin
Location: Vancouver, BC

Re: [Mod] Sprint [sprint]

by GunshipPenguin » Post

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.

User avatar
Minetestforfun
Member
Posts: 940
Joined: Tue Aug 05, 2014 14:09
GitHub: MinetestForFun
IRC: MinetestForFun
In-game: MinetestForFun
Location: On earth
Contact:

Re: [Mod] Sprint [sprint]

by Minetestforfun » Post

@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
Last edited by Minetestforfun on Mon Sep 01, 2014 22:32, edited 1 time in total.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: [Mod] Sprint [sprint]

by 4aiman » Post

@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!

User avatar
GunshipPenguin
Member
Posts: 94
Joined: Tue Jan 28, 2014 00:38
GitHub: GunshipPenguin
IRC: GunshipPenguin
In-game: GunshipPenguin
Location: Vancouver, BC

Re: [Mod] Sprint [sprint]

by GunshipPenguin » Post

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.

User avatar
GunshipPenguin
Member
Posts: 94
Joined: Tue Jan 28, 2014 00:38
GitHub: GunshipPenguin
IRC: GunshipPenguin
In-game: GunshipPenguin
Location: Vancouver, BC

Re: [Mod] Sprint [sprint]

by GunshipPenguin » Post

Added particle effect while sprinting and made sprinting a bit smoother.

User avatar
GunshipPenguin
Member
Posts: 94
Joined: Tue Jan 28, 2014 00:38
GitHub: GunshipPenguin
IRC: GunshipPenguin
In-game: GunshipPenguin
Location: Vancouver, BC

Re: [Mod] Sprint [sprint]

by GunshipPenguin » Post

Cleaned up the code, updated the readme, and added the ablility to limit how much players can sprint via the SPRINT_STAMINA variable.

User avatar
Don
Member
Posts: 1643
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: [Mod] Sprint [sprint]

by Don » Post

Nice work!
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here

Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests