[Mod] Run & Fast [runfast]

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

[Mod] Run & Fast [runfast]

by everamzah » Wed Aug 31, 2016 15:39

Description: Singular mod to conditionally allow for sprinting, heart regeneration based on food eaten.
License: LGPL v2.1+
Depends: None

Image

Git repository is located at https://github.com/everamzah/runfast
Download

Info:
  • Hold Use (AUX1, Default [E]) to sprint. Sprinting won't work if hungry, stand still to regain stamina.
  • Eating food increases satiation (hunger bar), poison hurts player and reduces satiation by half.
  • Edibles will not be consumed if already sated.
  • Hearts will optionally be regenerated when sated, default true. When false, eating additionally heals hearts.
  • Damage is dealt once starving.
  • HUD can be set to hide meters.
  • The hungrier you are, the faster your stamina drains (sprint time).
  • Sprint meter disappears when full, a la bubble (breath) bar.
Attachments
screenshot_20160903_102642_1.png
(55.08 KiB) Not downloaded yet
Last edited by everamzah on Sat Sep 03, 2016 19:38, edited 4 times in total.
 

User avatar
azekill_DIABLO
Member
 
Posts: 7492
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: [Mod] Run & Fast [runfast]

by everamzah » Thu Sep 01, 2016 15:43

Added a download link to post. Removed chat messages, so that screenshot is outdated. Have yet to persist stamina/satiation values between sessions.

Thanks for the reply, azekill_DIABOLO!
 

User avatar
MineYoshi
Member
 
Posts: 5373
Joined: Wed Jul 08, 2015 13:20

Re: [Mod] Run & Fast [runfast]

by MineYoshi » Thu Sep 01, 2016 22:01

+100!
Happy new Year 2020: let's all aim finally for a clear vision of what we want to make of Minetest!
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: [Mod] Run & Fast [runfast]

by everamzah » Fri Sep 02, 2016 02:35

Satiation amount is saved between server restarts now, by way of set_width(). Sprinting won't work if hungry.
 

User avatar
azekill_DIABLO
Member
 
Posts: 7492
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: [Mod] Run & Fast [runfast]

by everamzah » Sat Sep 03, 2016 14:10

The funny thing is that I originally wrote only "azekill" and went back after to add _DIABOLO, because I wasn't sure your preference. Heh.

As for this mod, I think it's just about done. Sprinting doesn't seem to work with enable_damage = false, though, so that can be fixed.

The sprinting meter (stamina) goes down faster the hungrier you are.
 

User avatar
azekill_DIABLO
Member
 
Posts: 7492
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: [Mod] Run & Fast [runfast]

by everamzah » Sat Sep 03, 2016 15:44

Full satiation = 0.1 stamina drain
Minimum satiation = 1.0 stamina drain

Stamina recharges at 1 point per tick if not moving, and 0.1 point per tick if moving but not sprinting.
 

User avatar
azekill_DIABLO
Member
 
Posts: 7492
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: [Mod] Run & Fast [runfast]

by everamzah » Fri Sep 16, 2016 14:35

The meters are offset when damage is disabled, now. I didn't realize before that this mod didn't work in singleplayer, so I added a note on join.

I don't know why it doesn't work in singleplayer. It's funny I never tried that mode.
 

User avatar
azekill_DIABLO
Member
 
Posts: 7492
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: [Mod] Run & Fast [runfast]

by everamzah » Sat Sep 17, 2016 11:14

Yes, I only try multiplayer. I rarely, if ever, use the singleplayer tab, and have strong reservations against it. If I want to play singleplayer, I still use the server tab.

In my opinion, the singleplayer tab ought to be replaced with a Profiles tab, in order to associate named configurations with their player's profile; turning a single Minetest instance into a multi-user program.
 

User avatar
rubenwardy
Moderator
 
Posts: 5965
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Run & Fast [runfast]

by rubenwardy » Mon Sep 19, 2016 01:06

I can't see any problems, reading the code. It's possible that it's due to the hacky way of using set_width on an inventory to save satiation, but doubtful. If I remember I'll take a look at this when I have time tomorrow
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: [Mod] Run & Fast [runfast]

by everamzah » Mon Sep 19, 2016 01:16

It's my mistake. I was wrong, it's not exclusive to singleplayer. Oddly, it's only when the mod is enabled after the world has already been spawned, that satiation and set_width aren't working.

Edit: So now that I look at it, it almost seems obvious. It's relying on register_on_newplayer, but if the world was already spawned, or rather the player already exists, then that won't occur. Will have to fix this.

Edit2: I fixed it. It had nothing to do with singleplayer, and everything to do with my novice modding. *smile*
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: [Mod] Run & Fast [runfast]

by everamzah » Thu Oct 06, 2016 03:53

Update: Now with extra crispy *CRUNCH* sound!
 

User avatar
azekill_DIABLO
Member
 
Posts: 7492
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
everamzah
Member
 
Posts: 490
Joined: Thu Jan 29, 2015 00:47
GitHub: everamzah
IRC: everamzah
In-game: everamzah

Re: [Mod] Run & Fast [runfast]

by everamzah » Thu Oct 06, 2016 12:45

azekill_DIABLO wrote:for what? :D


What is the sound for? It plays whenever you consume something.
 

User avatar
azekill_DIABLO
Member
 
Posts: 7492
Joined: Wed Oct 29, 2014 20:05
Location: OMICRON
GitHub: azekillDIABLO
In-game: azekill_DIABLO
 

User avatar
Fixer
Member
 
Posts: 894
Joined: Sun Jul 31, 2011 11:23
Location: Ukraine
IRC: Fixer
In-game: Fixer
 

mase
Member
 
Posts: 54
Joined: Tue Feb 21, 2017 20:16
In-game: mase

Re: [Mod] Run & Fast [runfast]

by mase » Sun Feb 26, 2017 16:12

Does it conflict with BlockMen's hungermod? I have 2 different hungerbars if I use both mods.
 

User avatar
taikedz
Member
 
Posts: 692
Joined: Sun May 15, 2016 11:11
Location: Scotland, UK
GitHub: taikedz
IRC: DuCake
In-game: DuCake

Re: [Mod] Run & Fast [runfast]

by taikedz » Sun Feb 26, 2017 16:52

Yes it will conflict.

This mod tries to manage hunger and hp regeneration and so do BlockMen's hunger and tenplus1's hudbars

All 3 allow running

Is there a reason you wanted to use both?
 

mase
Member
 
Posts: 54
Joined: Tue Feb 21, 2017 20:16
In-game: mase

Re: [Mod] Run & Fast [runfast]

by mase » Sun Feb 26, 2017 16:54

So I don't need the hungermod when using this mod?
 

User avatar
taikedz
Member
 
Posts: 692
Joined: Sun May 15, 2016 11:11
Location: Scotland, UK
GitHub: taikedz
IRC: DuCake
In-game: DuCake

Re: [Mod] Run & Fast [runfast]

by taikedz » Sun Feb 26, 2017 16:56

Correct.

However I would also recommend using tenplus1's hudbars mod - tjis mod and BlockMen's mod are no longer maintained.
 


Return to WIP Mods



Who is online

Users browsing this forum: Bastrabun and 2 guests