[Mod] Thirsty [thirsty] (WIP)

User avatar
programmingchicken
Member
Posts: 540
Joined: Sat Apr 18, 2015 02:20
GitHub: pchicken
IRC: chicken pchicken
Location: not here
Contact:

Re: [Mod] Thirsty [thirsty] (WIP)

by programmingchicken » Post

:3
Yes, maybe snow could be used?
<gamerdude> I apologize for the above content

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Thirsty [thirsty] (WIP)

by Ben » Post

Neat ideas, but ultimately beyond the scope of this mod.

But have a look at Nathan's Survival mod. It makes use of Thirsty, but is already tackling the "water purification angle".

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Thirsty [thirsty] (WIP)

by Ben » Post

Version 0.10.1 released

No new functionality. There were two points I had wanted to refactor before declaring this mod ready to release:
Ben wrote:
  1. A player's hydration level is saved by my attempt at a "shareable mixin", which I've since concluded is not worth it. It won't have any outward effect, but I'd like to get this refactored before declaring 1.0.0 .
  2. I'm not happy with the configuration. Ideally, I'd like to have a single, well-nested configuration file with all the defaults, and players / server admins can copy this file to configure stuff without their changes being clobbered by the next update. The mod code would then simply merge these by top-level key or something.
Both of these have been achieved with this version. Please let me know if you find any problems.

Warning: If you have configured this mod by copying the "thirsty.conf.example" file, then things should probably work by coincidence. But I would recommend copying the "thirsty.default.conf" anew, and recreating your local changes in it. Just remember to use a new, temporary file name for the new config file, so as not to clobber the very "thirsty.conf" whose changes you're trying to save.

User avatar
mahmutelmas06
Member
Posts: 367
Joined: Mon Mar 02, 2015 13:10
GitHub: mahmutelmas06
IRC: mahmutelmas06
In-game: masum

Re: [Mod] Thirsty [thirsty] (WIP)

by mahmutelmas06 » Post

I have released a mod as a main purpose of this mod.

viewtopic.php?f=9&t=13601
My Mods:

Beverage

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Thirsty [thirsty] (WIP)

by Ben » Post

mahmutelmas06 wrote:I have released a mod as a main purpose of this mod.

viewtopic.php?f=9&t=13601
Wow, looks very good! Nice :-D

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: [Mod] Thirsty [thirsty] (WIP)

by Nathan.S » Post

So I'm integrating this mod with the mymonths mod, integrating is probably the wrong word, anyway, I'm wondering does thirsty.set_thirst_factor 2 mean you get thirsty twice as fast or half as fast, I couldn't find anything that said.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Thirsty [thirsty] (WIP)

by Ben » Post

Nathan.S wrote:So I'm integrating this mod with the mymonths mod, integrating is probably the wrong word, anyway, I'm wondering does thirsty.set_thirst_factor 2 mean you get thirsty twice as fast or half as fast, I couldn't find anything that said.
Good point, the docs are probably too thin on this. A factor of 2 makes you thirsty twice as fast; the relevant line is about here: https://github.com/bendeutsch/minetest- ... s.lua#L208

I've been out of the loop a bit; when I get back, though, I'd like to overhaul this system a bit. Instead of changing the factor or flatly adjusting hydration, I'd like to implement a kind of "thirst debt". Dig a block, incur 0.2 hydration debt. Craft an item: 0.3 debt. Cast a fireball: 1.5 debt. This "debt" is then repaid by getting thirsty twice as hard until it is paid off.

Another interesting mechanic: instead of a single factor, have a set of bonuses / maluses (or boni / mali). Sprinting? +30% thirst. Wearing Boots of Rain? -20% thirst. Together +10%, or 110% as opposed to the default 100%. And if you stop sprinting, the sprinting malus drops back to +0%, making the new total 100%-20%=80%. Yes, this can work, as long as I work out what happens at 0%, 100%, 200% etc.

User avatar
Nathan.S
Member
Posts: 1147
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21
Location: Bigsby Texas
Contact:

Re: [Mod] Thirsty [thirsty] (WIP)

by Nathan.S » Post

Thanks for the reply, I probably could have dug through the code myself, but just looked at the documentation.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
Echoes91
Member
Posts: 80
Joined: Thu Feb 19, 2015 13:21
In-game: Echoes
Location: Lombardy, Italy

Re: [Mod] Thirsty [thirsty] (WIP)

by Echoes91 » Post

I've included your mod within my new Minesim subgame and corrected a typo that prevented the bar to be displayed with the correct size.

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Thirsty [thirsty] (WIP)

by Ben » Post

Echoes91 wrote:I've included your mod within my new Minesim subgame
Neat!
Echoes91 wrote:and corrected a typo that prevented the bar to be displayed with the correct size.
Oops! Thanks for catching that, merged (also sorry for the delay).

User avatar
programmingchicken
Member
Posts: 540
Joined: Sat Apr 18, 2015 02:20
GitHub: pchicken
IRC: chicken pchicken
Location: not here
Contact:

Re: [Mod] Thirsty [thirsty] (WIP)

by programmingchicken » Post

I have an idea: Change thirst loss depending on what biome you're in (heat parameter).
If this hasn't been added already, can you add it? (not even sure if the heat parameter in biome settings is even accessible past worldgen)
<gamerdude> I apologize for the above content

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

Re: [Mod] Thirsty [thirsty] (WIP)

by azekill_DIABLO » Post

by detecting sand around for example!
Gone, but not dead. Contact me on discord: azekill_DIABLO#6565
DMs are always open if you want to get in touch!

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [Mod] Thirsty [thirsty] (WIP)

by Desour » Post

sand is also generated in caves and not hot biomes and you can place it
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Thirsty [thirsty] (WIP)

by Ben » Post

You could make a companion mod that sets the thirst_factor (see above) according to the biome, but yes, this sounds like something that makes sense "by default".

I've been occasionally reading something about biomes and temperature maps – does anyone know how "official" this is?

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Thirsty [thirsty] (WIP)

by Ben » Post

Version 0.10.2 released

Contains the bug fix by Echoes91, detailed above. Better late than never :-/

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

Re: [Mod] Thirsty [thirsty] (WIP)

by Don » Post

Ben wrote:You could make a companion mod that sets the thirst_factor (see above) according to the biome, but yes, this sounds like something that makes sense "by default".

I've been occasionally reading something about biomes and temperature maps – does anyone know how "official" this is?
Knowing the different biomes is something I would love to be able to do. I know there was some talk about it. Lets hope it does happen. I check the nodes to get the biome but it is far from perfect.
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

User avatar
Ben
Member
Posts: 160
Joined: Tue Mar 31, 2015 20:09

Re: [Mod] Thirsty [thirsty] (WIP)

by Ben » Post

Don wrote:Knowing the different biomes is something I would love to be able to do. I know there was some talk about it. Lets hope it does happen. I check the nodes to get the biome but it is far from perfect.
I think part of the problem is that there is only a vague notion of "biomes", or whether biomes as such even exist at all. At least I can find no mention of "biome" or "temperature" in the Lua API.

I think that, like "ground height", the concept of biomes and temperature maps is something each map generator decides for itself, not something that can be globally queried.

User avatar
maikerumine
Member
Posts: 1420
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: [Mod] Thirsty [thirsty] (WIP)

by maikerumine » Post

Code: Select all

2016-11-13 09:30:04: ERROR[Main]: ServerError: Lua: Runtime error from mod 'thirsty' in callback on_dieplayer(): ...\aftermath\mods\thirsty/persistent_player_attributes.lua:109: attempt to index a nil value
2016-11-13 09:30:04: ERROR[Main]: stack traceback:
2016-11-13 09:30:04: ERROR[Main]: 	...\aftermath\mods\thirsty/persistent_player_attributes.lua:109: in function 'set_value'
2016-11-13 09:30:04: ERROR[Main]: 	...ALLOUT\bin\..\games\aftermath\mods\thirsty/functions.lua:40: in function <...ALLOUT\bin\..\games\aftermath\mods\thirsty/functions.lua:33>
2016-11-13 09:30:04: ERROR[Main]: 	D:\FALLOUT\bin\..\builtin\game\register.lua:407: in function <D:\FALLOUT\bin\..\builtin\game\register.lua:387>
Please fix, I depend on this sweet mod for one of my servers. :)
Talamh Survival Minetest-->viewtopic.php?f=10&t=12959

User avatar
maikerumine
Member
Posts: 1420
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: [Mod] Thirsty [thirsty] (WIP)

by maikerumine » Post

It must be noted that if a player has a corrupted [during death] player file then when he/she relogs to server the server will crash. The only way to fix this was to delete the mod, or delete all player files, the latter I cannot do.
Talamh Survival Minetest-->viewtopic.php?f=10&t=12959

User avatar
maikerumine
Member
Posts: 1420
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: [Mod] Thirsty [thirsty] (WIP)

by maikerumine » Post

Bump
Is there any more Dev of this MOD?
Talamh Survival Minetest-->viewtopic.php?f=10&t=12959

User avatar
Beerholder
Member
Posts: 199
Joined: Wed Aug 03, 2016 20:23
GitHub: evrooije
In-game: Beerholder

Re: [Mod] Thirsty [thirsty] (WIP)

by Beerholder » Post

Hi maike, have you tried printing the values, or could you try put some print statements in persistent_player_attributes.lua? Like on 109 where it crashes and where it says:

PPA.read_cache[player_name][name] = value

Do:

print(player_name)
print(name)
print(PPA.read_cache[player_name])
print(PPA.read_cache[player_name][name])
print(value)

Maybe a reinitializing when one of these values is nil might be a hacky way to solve this problem for the time being? Better to have DB backed storage, so in case the server crashes because of another mod, at least a rollback is performed on the player persistent data .......

Pablo.R
Member
Posts: 42
Joined: Thu Mar 24, 2016 12:02
Location: Chile

Re: [Mod] Thirsty [thirsty] (WIP)

by Pablo.R » Post

Maike, I had this problem last year, ... I am not absolutely sure to remember how I fix it but I think you must add an if to the thirsty.on_dieplayer function in file functions.lua (next is the version of my computer)

function thirsty.on_dieplayer(player)
local name = player:get_player_name()
local pl = thirsty.players[name]
-- reset after death
if pl ~= nil then
PPA.set_value(player, 'thirsty_hydro', 20)
pl.pending_dmg = 0.0
pl.thirst_factor = 1.0
end
end

User avatar
maikerumine
Member
Posts: 1420
Joined: Mon Aug 04, 2014 14:27
GitHub: maikerumine
In-game: maikerumine

Re: [Mod] Thirsty [thirsty] (WIP)

by maikerumine » Post

Pablo.R wrote:Maike, I had this problem last year, ... I am not absolutely sure to remember how I fix it but I think you must add an if to the thirsty.on_dieplayer function in file functions.lua (next is the version of my computer)

function thirsty.on_dieplayer(player)
local name = player:get_player_name()
local pl = thirsty.players[name]
-- reset after death
if pl ~= nil then
PPA.set_value(player, 'thirsty_hydro', 20)
pl.pending_dmg = 0.0
pl.thirst_factor = 1.0
end
end
Thanks guys, sorry for long delay on reply. I am trying this now. :)
Talamh Survival Minetest-->viewtopic.php?f=10&t=12959

Chibi ghost
Member
Posts: 845
Joined: Fri Jan 08, 2016 21:17
In-game: Ghost

Re: [Mod] Thirsty [thirsty] (WIP)

by Chibi ghost » Post

I need some help in working out this mod like what the functions of the items other than the bowl, canteens and fountain those I worked out on my own but the other stuff not a clue

User avatar
Lord_Vlad
Member
Posts: 112
Joined: Thu Jul 20, 2017 07:58

Re: [Mod] Thirsty [thirsty] (WIP)

by Lord_Vlad » Post

Hey, I think like your Hunger mod, it should disable itself when damages are turned off.

Same can be said for Beware of the dark.

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests