[Mod] Thirsty [thirsty] (WIP)

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

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

by sirrobzeroone » Post

I feel a bit bad with all the spam but I have a bit of time to work on this and need thirsty for my game so it has my focus at the moment.

Update,
I've removed the rest of the player data from the thirsty global table and stored it in player(meta). This was a bigger/tougher change than the hydro value so maybe a bug or two...I havent found any yet.

I've added the amulets of thirst which decrease the players thirst so you use hydration points slower. I have delibratly not included craft recieps, so these can only be given by admin or found as part of dungeon_loot on base MT-game. The idea being to try and encourage a bit of dungeon exploration, to use you have to hold in your inventory. Just noting it really so people know, for my own game which is more tech based these will be craftable :). Normal Thirst rate is 1 so the below are the initial rates but I may tweak these up by 0.05 yet:

Lesser Amulet of Thirst - 0.85
Amulet of Thirst - 0.70
Greater Amulet of Thirst - 0.55

Image

I did some other cleanup, edited and made the sound file nicer and timed better, adjusted the standing in water drinking so the drinking sound didnt sound like a heart beat, cleaned up the texture folder, Cleaned up readme.MD markdown so its a bit nicer/easier to read.
Attachments
tamulets_of_thirst.png
tamulets_of_thirst.png (18.78 KiB) Viewed 1432 times

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

Is there any way for me to tell if somebody is using your fork of thirsty. I wouldn't want to change the drinks mod if that's going to break the functionality for anybody using the original code.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

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

by sirrobzeroone » Post

Nathan.S wrote:
Sun Sep 26, 2021 03:10
Is there any way for me to tell if somebody is using your fork of thirsty. I wouldn't want to change the drinks mod if that's going to break the functionality for anybody using the original code.
Good point Nathan...hmm ironically i've tried to keep all the settings the same for the same reason. I could do something like Tenplus1 did for "farming" (farming.mod == "redo") add a new global table value. thirsty.mod == "revive" or "redo" if Tenplus1 wouldnt mind us borrowing his term :).

The only other way I can think of is to see if thirsty.tobool or one of the other new functions exists soemthing like the below. I picked tobool function as very unlikely Im changing/renaming that :).

Code: Select all

local thirsty_ver = "old"
	if type(thirsty.tobool) == "function" then
		thirsty_ver = "new"
	end

I'm happy to add a global table value or not :)

Edit
I just added a global var to hold version number thirsty.version = 0.103

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

I'll have a look at the changes you've implemented, something with improved canteens wasn't it. Checking for a version number is great, and gives the possibility for future changes to keep backwards compat in my code as well.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website, and brand new Minetest Modding Course

c56
Member
Posts: 307
Joined: Wed Apr 21, 2021 03:05
GitHub: tigercoding56
In-game: bm5 or bemo5 also sell_her_on55

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

by c56 » Post

pls add to contentdb
this is a signature not a place to post messages also if i could change my username i would change it to sell_her_on55

User avatar
kristovish
Member
Posts: 39
Joined: Tue Jul 19, 2022 00:42
GitHub: kristovish
In-game: kristovish

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

by kristovish » Post

sirrobzeroone wrote:
Thu Sep 23, 2021 00:46
I feel a bit bad with all the spam but I have a bit of time to work on this and need thirsty for my game so it has my focus at the moment.

Update,
I've removed the rest of the player data from the thirsty global table and stored it in player(meta). This was a bigger/tougher change than the hydro value so maybe a bug or two...I havent found any yet.

I've added the amulets of thirst which decrease the players thirst so you use hydration points slower. I have delibratly not included craft recieps, so these can only be given by admin or found as part of dungeon_loot on base MT-game. The idea being to try and encourage a bit of dungeon exploration, to use you have to hold in your inventory. Just noting it really so people know, for my own game which is more tech based these will be craftable :). Normal Thirst rate is 1 so the below are the initial rates but I may tweak these up by 0.05 yet:

Lesser Amulet of Thirst - 0.85
Amulet of Thirst - 0.70
Greater Amulet of Thirst - 0.55

Image

I did some other cleanup, edited and made the sound file nicer and timed better, adjusted the standing in water drinking so the drinking sound didnt sound like a heart beat, cleaned up the texture folder, Cleaned up readme.MD markdown so its a bit nicer/easier to read.


hello! I have added your mod after testing it locally to my public server and everything was going great until someone discovered that when someone tried to use an empty bottle the server crashed giving the following error:

2022-08-25 07:19:16: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Runtime error from mod 'vessels' in callback item_OnUse(): .../bin/../worlds/world/worldmods/thirsty/functions.lua:166: attempt to index local 'node' (a nil value)
2022-08-25 07:19:16: ERROR[Main]: stack traceback:
2022-08-25 07:19:16: ERROR[Main]: .../bin/../worlds/world/worldmods/thirsty/functions.lua:166: in function <.../bin/../worlds/world/worldmods/thirsty/functions.lua:159>



I don't know if this mod is still active at all but I leave it just in case. I personally don't know how to fix it.

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

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

by sirrobzeroone » Post

kristovish wrote:
Thu Aug 25, 2022 07:34
I don't know if this mod is still active at all but I leave it just in case. I personally don't know how to fix it.
I'll see if I can fix it up

Edit: Fixed it, null node issue - added a check for node data so bug should be gone now, also crushed a few other bugs and updates needed while I was at it:

https://github.com/sirrobzeroone/thirsty

If any others crop up feel free to quote and I'll have a look :)

User avatar
kristovish
Member
Posts: 39
Joined: Tue Jul 19, 2022 00:42
GitHub: kristovish
In-game: kristovish

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

by kristovish » Post

sirrobzeroone wrote:
Thu Aug 25, 2022 10:43
kristovish wrote:
Thu Aug 25, 2022 07:34
I don't know if this mod is still active at all but I leave it just in case. I personally don't know how to fix it.
I'll see if I can fix it up

Edit: Fixed it, null node issue - added a check for node data so bug should be gone now, also crushed a few other bugs and updates needed while I was at it:

https://github.com/sirrobzeroone/thirsty

If any others crop up feel free to quote and I'll have a look :)

Thank you so much for your help! everthing is working fine for now! If we found another issue or something I will let you know! have a good day

User avatar
kristovish
Member
Posts: 39
Joined: Tue Jul 19, 2022 00:42
GitHub: kristovish
In-game: kristovish

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

by kristovish » Post

Nathan.S wrote:
Sun Sep 26, 2021 03:10
Is there any way for me to tell if somebody is using your fork of thirsty. I wouldn't want to change the drinks mod if that's going to break the functionality for anybody using the original code.
I'm using sirrobzeroone's thristy mod along with your drinks mod on my public server. and both work without problems. when drinking the juices of your mod the characters are hydrated without problems so far

User avatar
csirolli
Member
Posts: 133
Joined: Mon Jan 15, 2018 21:46
GitHub: HeyITGuyFixIt
IRC: CSirolli
In-game: CSirolli
Location: Florida, USA
Contact:

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

by csirolli » Post

c56 wrote:
Thu Aug 04, 2022 05:12
pls add to contentdb
I would love for it to be on contentdb too

Peril
Member
Posts: 40
Joined: Sun Feb 10, 2019 14:11

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

by Peril » Post

sirrobzeroone wrote:
Thu Aug 25, 2022 10:43
kristovish wrote:
Thu Aug 25, 2022 07:34
I don't know if this mod is still active at all but I leave it just in case. I personally don't know how to fix it.
I'll see if I can fix it up

Edit: Fixed it, null node issue - added a check for node data so bug should be gone now, also crushed a few other bugs and updates needed while I was at it:

https://github.com/sirrobzeroone/thirsty

If any others crop up feel free to quote and I'll have a look :)
Would you mind turning "issues" on in your github?

Code: Select all

2023-01-18 20:02:55: ERROR[Main]: ModError: Failed to load and run script from /.minetest/mods/thirsty-master/init.lua:
2023-01-18 20:02:55: ERROR[Main]: /usr/share/minetest/builtin/common/misc_helpers.lua:479: table index is nil
2023-01-18 20:02:55: ERROR[Main]: stack traceback:
2023-01-18 20:02:55: ERROR[Main]: 	/usr/share/minetest/builtin/common/misc_helpers.lua:479: in function 'copy'
2023-01-18 20:02:55: ERROR[Main]: 	/.minetest/mods/thirsty-master/interop_a_functions.lua:33: in function 'register_food_drink'
2023-01-18 20:02:55: ERROR[Main]: 	/.minetest/mods/thirsty-master/interop_ethereal.lua:17: in main chunk
2023-01-18 20:02:55: ERROR[Main]: 	[C]: in function 'dofile'
2023-01-18 20:02:55: ERROR[Main]: 	/.minetest/mods/thirsty-master/init.lua:167: in main chunk
2023-01-18 20:02:55: ERROR[Main]: Check debug.txt for details.
2023-01-18 20:02:55: ACTION[Main]: Server: Shutting down
Forgot my old username/email, it's been a number of years please bear with.
Stats: OS: Manjaro Linux; Using minetest-git via AUR

Peril
Member
Posts: 40
Joined: Sun Feb 10, 2019 14:11

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

by Peril » Post

So currently looking into it myself.

Line 17 in interop_ethereal.lua references Firethorn Jelly, but if I comment out the line it simply increments the line that it has a problem with.

Ethereal has installed just fine with many of the dependencies. Including farming, but sans intllib and lucky_block.

Thirsty has dungeon_loot, vessels, hunger_ng, hudbars, bucket, farming and of course default. It doesn't have hbhunger or mobs_animal.

The ethereal items appear in game.

I have no clue what the misc_helper table.copy is doing, because someone thought it would be a great idea to use single letter variable names *sigh*.

Line 33 is calling the table copy, minetest.registered_items[item_name]

Code: Select all

	local def = table.copy(minetest.registered_items[item_name])
	      def.on_use =  function(itemstack,player,pointed_thing)

						thirsty.drink(player,hyd_value,hyd_max,rtn_item_name)
							
							if minetest.registered_items[item_name]._hunger_ng then
								minetest.sound_play("hunger_ng_eat", {to_player = player:get_player_name(), gain = 2.0 })
								hunger_ng.alter_hunger(player:get_player_name(), satiate_value, "from:thirsty-"..item_name)
								player:set_hp(player:get_hp()+heal_value)								
								itemstack:take_item()
								return itemstack
							else
								minetest.do_item_eat(satiate_value,nil, itemstack:take_item(), player, pointed_thing)
								return itemstack
							end
							
						end
	
	if def.type == "node" then
		minetest.register_node(":"..item_name, def)
	else
		minetest.register_craftitem(":"..item_name, def)
	end
end
Something seems slightly wrong here. As if we're missing an "end"). Should lines 51 (if def.type == "node" then") not be indented with an extra end on between the two ends at the end? (Dead end much). or maybe... since the local appears to be just a declaration does that mean there's an extra confusing indent?

Which is what made me question if the ethereal items existed. They do. Checking on the glass. Worth noting is that interop_ethereal calls E.glass_bottle. So I checked init.lua and then followed that to components_external_nodes_items.lua.

E.glass_bottle = "vessels:glass_bottle", I'm also checked the "ethereal:firethorn_jelly" and that's in the game too, though apparently in the ethereal code it's registered as a craftitem, I suspect this doesn't matter.

which means that exists. I'm not sure what the deal is.

Lemme check something... which Ethereal mod is being referenced?
Forgot my old username/email, it's been a number of years please bear with.
Stats: OS: Manjaro Linux; Using minetest-git via AUR

Peril
Member
Posts: 40
Joined: Sun Feb 10, 2019 14:11

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

by Peril » Post

sirrobzeroone wrote:
Thu Aug 25, 2022 10:43
kristovish wrote:
Thu Aug 25, 2022 07:34
I don't know if this mod is still active at all but I leave it just in case. I personally don't know how to fix it.
I'll see if I can fix it up

Edit: Fixed it, null node issue - added a check for node data so bug should be gone now, also crushed a few other bugs and updates needed while I was at it:

https://github.com/sirrobzeroone/thirsty

If any others crop up feel free to quote and I'll have a look :)
Pull request submitted.
Nathan.S wrote:
You might also be interested in this one.

https://github.com/sirrobzeroone/thirsty/pull/1
Forgot my old username/email, it's been a number of years please bear with.
Stats: OS: Manjaro Linux; Using minetest-git via AUR

User avatar
sirrobzeroone
Member
Posts: 593
Joined: Mon Jul 16, 2018 07:56
GitHub: sirrobzeroone
Contact:

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

by sirrobzeroone » Post

Peril wrote:
Sat Jan 21, 2023 16:56
sirrobzeroone wrote:
Thu Aug 25, 2022 10:43
kristovish wrote:
Thu Aug 25, 2022 07:34
I don't know if this mod is still active at all but I leave it just in case. I personally don't know how to fix it.
I'll see if I can fix it up

Edit: Fixed it, null node issue - added a check for node data so bug should be gone now, also crushed a few other bugs and updates needed while I was at it:

https://github.com/sirrobzeroone/thirsty

If any others crop up feel free to quote and I'll have a look :)
Pull request submitted.
Nathan.S wrote:
You might also be interested in this one.

https://github.com/sirrobzeroone/thirsty/pull/1
Thanks - works been way out of hand over the past few months....

User avatar
duckgo
Member
Posts: 205
Joined: Sun Sep 20, 2020 08:01
In-game: duckgo
Contact:

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

by duckgo » Post

I know this mod isn't complete yet and is in development, but I was wondering if I can add it to a modpack I'm making? , with some other mods, because that's the only mod that adds thirst :)

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests