[Mod] Simple Sprint [sprint]

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
GitHub: octacian
IRC: octacian
In-game: octacian

[Mod] Simple Sprint [sprint]

by octacian » Sun Jun 18, 2017 17:44

Simple Sprinting
GitHub: https://github.com/octacian/sprint
Download: https://github.com/octacian/sprint/archive/master.zip
Dependencies: player_monoids (optional)

This sprinting mod was inspired by GunshipPenguin's own sprinting mod, however, written for ease of use and simplicity in code including the ability to configure the mod right from the advanced settings menu.

Configuration

The speed and jump multipliers, as well as hotkeys, can be configured directly from the advanced settings menu in the sprint subsection of the top-level Mods section. You can also configure sprint directly from minetest.conf with the settings listed below. View through the Markdown README on GitHub for a nicer layout.

  • sprint_primary - string - aux1 - Primary sprinting key
  • sprint_second - string - up - Secondary sprinting key
  • sprint_enable_second - bool - true - Allow secondary sprint key
  • sprint_speed - float - 1.3 - Speed multiplier
  • sprint_jump - float - 1.1 - Jump multiplier
  • sprint_dir - bool - true - Directional sprinting
  • sprint_particles - int - 1 - Max number of particles

sprint_primary is the codename of the primary sprint key which causes the speed and jump multipliers to be applied to the player while it is held. If sprint_dir is set to true, players can only sprint while moving forward. sprint_second defines a key that if sprint_enable_second is set to true (default) triggers sprinting when pressed twice within 0.8 seconds. sprint_particles causes a configurable number of particles (sprint_particle_num) to be added behind the player as they sprint. While a higher number of particles produces a nicer visual effect, it causes higher load to the server.
Last edited by octacian on Sun Jul 02, 2017 20:30, edited 1 time in total.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 

Azazel
Member
 
Posts: 20
Joined: Sun Dec 13, 2015 18:44
In-game: Omallem
 

Byakuren
Member
 
Posts: 816
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri
In-game: Raymoo + Clownpiece

Re: [Mod] Simple Sprint [sprint]

by Byakuren » Sun Jun 18, 2017 22:46

Does it have to use the same mod name as the other mod?
Does it support player_monoids?
Every time a mod API is left undocumented, a koala dies.
 

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] Simple Sprint [sprint]

by octacian » Sun Jun 18, 2017 23:06

Azazel wrote:What are the dependencies?


At this point, there are none. That's why none are listed :P I do plan on adding support for several hunger mods, though.

Byakuren wrote:Does it have to use the same mod name as the other mod?
Does it support player_monoids?


It doesn't have to use the same name, however, "sprint" is direct and to-the-point, not only that, but they wouldn't be compatible anyways - one or the other would attempt to override the overrides put on by the other. I could rename it to something like "sprintplus" or something though...

No, it doesn't support player_monoids. I wasn't aware of the mod when I wrote this (yesterday, heh). However, it looks like an interesting project, I'll definitely consider adding support.
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 

User avatar
texmex
Member
 
Posts: 1066
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: texmex

Re: [Mod] Simple Sprint [sprint]

by texmex » Mon Jun 19, 2017 06:52

octacian wrote:At this point, there are none. That's why none are listed :P I do plan on adding support for several hunger mods, though.

This is good news, I've been wishing for a good sprint mod to integrate with the hunger system. (I use hb_hunger, for what it's worth)

octacian wrote:I could rename it to something like "sprintplus" or something though...

Don't, I think this mod aptly replaces the featureset of the old one. The old one is not even maintained, seems abandoned.

octacian wrote:No, it doesn't support player_monoids. I wasn't aware of the mod when I wrote this (yesterday, heh). However, it looks like an interesting project, I'll definitely consider adding support.

That would be awesome. Finally a sprint mod compatible with player affecting mods.
 

User avatar
TenPlus1
Member
 
Posts: 2424
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Simple Sprint [sprint]

by TenPlus1 » Mon Jun 19, 2017 14:31

The stamina mod has sprint included which lowers hunger(stamina) when used: https://github.com/minetest-mods/stamina
 

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] Simple Sprint [sprint]

by octacian » Mon Jun 19, 2017 16:16

TenPlus1 wrote:The stamina mod has sprint included which lowers hunger(stamina) when used: https://github.com/minetest-mods/stamina


Yes, that is true, however, my mod:
  • is simpler, serving one main purpose
  • is fully configurable directly from the advanced settings menu (including trigger buttons, particles, speeds, whether sprinting is allowed when not moving forward, and more)
  • also supports double-tapping a key to sprint (typically the "up" key)
  • changes the particle texture depending on what the player is walking on

However, looking through your code reminds me that I should use a particlespawner to add multiple particles rather than a loop -,-
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 

User avatar
Devy
Member
 
Posts: 128
Joined: Sat Jan 21, 2017 02:31
GitHub: CoderForTheBetter
In-game: devy

Re: [Mod] Simple Sprint [sprint]

by Devy » Mon Jun 19, 2017 16:28

This looks great! I haven't had good experiences with other sprint mods, so I hope this one can replace them.
 

User avatar
octacian
Member
 
Posts: 593
Joined: Mon Dec 21, 2015 22:18
Location: BC, Canada
GitHub: octacian
IRC: octacian
In-game: octacian

Re: [Mod] Simple Sprint [sprint]

by octacian » Sun Jul 02, 2017 20:32

Update:
  • player_monoids supported (thanks texmex and Byakuren!)
  • particlespawner used rather than loop to spawn individual particles
  • particle configuration improved (reduced to one config option from two)
MicroExpansion, Working Computers, All Projects - Check out my YouTube channel! (octacian)
 

User avatar
Lone_Wolf
Member
 
Posts: 1984
Joined: Sun Apr 09, 2017 05:50
Location: Hopefully very far from yours, snoop :P
GitHub: LoneWolfHT
IRC: Lone_Wolf
In-game: Lone_Wolf

Re: [Mod] Simple Sprint [sprint]

by Lone_Wolf » Mon Jul 24, 2017 15:59

Nice!
In water you should make the player run out of air faster. Or did you already do that?
 

User avatar
LMD
Member
 
Posts: 687
Joined: Sat Apr 08, 2017 08:16
Location: Somewhere over the Rainbow : Bonn, Germany
GitHub: appgurueu
In-game: LMD + PRO_LMD + Limo
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 4 guests