[Mod] Run & Fast [runfast]

Post Reply
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 » Post

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: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Run & Fast [runfast]

by azekill_DIABLO » Post

good

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 » Post

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
Contact:

Re: [Mod] Run & Fast [runfast]

by MineYoshi » Post

+100!
Oi

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 » Post

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: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Run & Fast [runfast]

by azekill_DIABLO » Post

everamzah wrote: azekill_DIABOLO!
This is persecution.
"ever mah zah"

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 » Post

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: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Run & Fast [runfast]

by azekill_DIABLO » Post

nice but at which speed?

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 » Post

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: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Run & Fast [runfast]

by azekill_DIABLO » Post

ok nice! conflicts with any mod?

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 » Post

No conflicts, no dependencies.

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 » Post

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: 7497
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO
Location: OMICRON
Contact:

Re: [Mod] Run & Fast [runfast]

by azekill_DIABLO » Post

you only try multiplayer? :P

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 » Post

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: 6278
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: United Kingdom
Contact:

Re: [Mod] Run & Fast [runfast]

by rubenwardy » Post

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 » Post

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 » Post

Update: Now with extra crispy *CRUNCH* sound!

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

Re: [Mod] Run & Fast [runfast]

by azekill_DIABLO » Post

for what? :D

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 » Post

azekill_DIABLO wrote:for what? :D
What is the sound for? It plays whenever you consume something.

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

Re: [Mod] Run & Fast [runfast]

by azekill_DIABLO » Post

Cool! Does it burps too?

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

Re: [Mod] Run & Fast [runfast]

by Fixer » Post


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

Re: [Mod] Run & Fast [runfast]

by mase » Post

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
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [Mod] Run & Fast [runfast]

by taikedz » Post

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 » Post

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

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

Re: [Mod] Run & Fast [runfast]

by taikedz » Post

Correct.

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

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests