[Mod] Fluid API - Fluid Storage and Transfer! [fluid_lib]

Post Reply
User avatar
IcyDiamond
Member
Posts: 175
Joined: Fri Mar 30, 2018 08:55
GitHub: LunaSquee
IRC: IcyDiamond
In-game: IcyDiamond
Location: Estonia
Contact:

[Mod] Fluid API - Fluid Storage and Transfer! [fluid_lib]

by IcyDiamond » Post

Image

This is a Fluid Transfer and Storage API based on node_io for Minetest. It overrides the default bucket mod and adds these features:
  • Nodes can now have "internal buffers" of fluid.
  • Buckets can be registered with a color instead of an image.
  • Buckets have callbacks that can insert and take fluid from certain nodes with internal buffers.
  • Fluid storage tanks!
  • Fluid transfer!
Note: Default storage tanks are registered for all fluids that have a bucket.

API documentation is available in the README.

Direct Download

Source Code: https://gitlab.icynet.eu/evert/fluid_lib
License: MIT
Last edited by IcyDiamond on Sat Jan 05, 2019 18:37, edited 4 times in total.
Web developer | Systems Administrator

User avatar
GamingAssociation39
Member
Posts: 858
Joined: Mon Apr 25, 2016 16:09
GitHub: Gerold55
IRC: Gerold55
In-game: Gerold55
Location: Maryland, USA

Re: [Mod] Fluid API - Fluid Storage and more! [fluid_lib]

by GamingAssociation39 » Post

Does this change the flow mechanic of MT?
Jesus Is Lord and Savior!!!

User avatar
IcyDiamond
Member
Posts: 175
Joined: Fri Mar 30, 2018 08:55
GitHub: LunaSquee
IRC: IcyDiamond
In-game: IcyDiamond
Location: Estonia
Contact:

Re: [Mod] Fluid API - Fluid Storage and more! [fluid_lib]

by IcyDiamond » Post

GamingAssociation39 wrote:Does this change the flow mechanic of MT?
No. It is merely for fluid storage.
Web developer | Systems Administrator

User avatar
GamingAssociation39
Member
Posts: 858
Joined: Mon Apr 25, 2016 16:09
GitHub: Gerold55
IRC: Gerold55
In-game: Gerold55
Location: Maryland, USA

Re: [Mod] Fluid API - Fluid Storage and more! [fluid_lib]

by GamingAssociation39 » Post

Oh :( So we can make water pumping systems and store them in blocks?
Jesus Is Lord and Savior!!!

User avatar
IcyDiamond
Member
Posts: 175
Joined: Fri Mar 30, 2018 08:55
GitHub: LunaSquee
IRC: IcyDiamond
In-game: IcyDiamond
Location: Estonia
Contact:

Re: [Mod] Fluid API - Fluid Storage and more! [fluid_lib]

by IcyDiamond » Post

GamingAssociation39 wrote:Oh :( So we can make water pumping systems and store them in blocks?
Indeed.
Web developer | Systems Administrator

bell07
Member
Posts: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Fluid API - Fluid Storage and more! [fluid_lib]

by bell07 » Post

Some fixes on depends.txt files:

Code: Select all

diff --git a/bucket/depends.txt b/bucket/depends.txt
index a7c6667..d15f7fc 100644
--- a/bucket/depends.txt
+++ b/bucket/depends.txt
@@ -1 +1,2 @@
-default,fluid_lib
+default
+fluid_lib
diff --git a/fluid_tanks/depends.txt b/fluid_tanks/depends.txt
index e43a56a..7434fbc 100644
--- a/fluid_tanks/depends.txt
+++ b/fluid_tanks/depends.txt
@@ -1 +1,2 @@
+fluid_lib
 bucket

Terumoc
Member
Posts: 58
Joined: Thu Dec 28, 2017 20:00
GitHub: Terumoc
In-game: Terumoc

Re: [Mod] Fluid API - Fluid Storage and more! [fluid_lib]

by Terumoc » Post

Perhaps this would be something better for elepower, but its functionality is strictly available by what's provided by fluid_lib: some sort of very basic node that can accept liquid and fill buckets placed inside would be extremely useful for automation. After all there are some mods (*cough*like my own*cough*) that use filled buckets a lot with crafting.

I was thinking of creating something like it myself in Terumetal to assist with automated crafting, but it does seem like a good idea for a basic functional tool in fluid_lib (or elepower). If you want to keep it strictly a code library and without any "gameplay content" I certainly understand though.

EDIT: I decided to implement this in a separate mod anyway. I'll link to it once it's in a usable state :)
Maker of Terumetal and Teruview mods at https://github.com/Terumoc

User avatar
IcyDiamond
Member
Posts: 175
Joined: Fri Mar 30, 2018 08:55
GitHub: LunaSquee
IRC: IcyDiamond
In-game: IcyDiamond
Location: Estonia
Contact:

Re: [Mod] Fluid API - Fluid Storage and more! [fluid_lib]

by IcyDiamond » Post

Terumoc wrote:some sort of very basic node that can accept liquid and fill buckets placed inside would be extremely useful for automation.
That's already implemented in Elepower, it's called the Bucketer.
Web developer | Systems Administrator

Terumoc
Member
Posts: 58
Joined: Thu Dec 28, 2017 20:00
GitHub: Terumoc
In-game: Terumoc

Re: [Mod] Fluid API - Fluid Storage and more! [fluid_lib]

by Terumoc » Post

IcyDiamond wrote:
Terumoc wrote:some sort of very basic node that can accept liquid and fill buckets placed inside would be extremely useful for automation.
That's already implemented in Elepower, it's called the Bucketer.
Oh is it? I must have overlooked it or it was added after last time I checked it out. Great to hear!
Maker of Terumetal and Teruview mods at https://github.com/Terumoc

User avatar
IcyDiamond
Member
Posts: 175
Joined: Fri Mar 30, 2018 08:55
GitHub: LunaSquee
IRC: IcyDiamond
In-game: IcyDiamond
Location: Estonia
Contact:

Re: [Mod] Fluid API - Fluid Storage and more! [fluid_lib]

by IcyDiamond » Post

Terumoc wrote:Oh is it? I must have overlooked it or it was added after last time I checked it out. Great to hear!
Yeah, it was added recently.
Web developer | Systems Administrator

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

Re: [Mod] Fluid API - Fluid Storage and Transfer! [fluid_lib]

by sirrobzeroone » Post

As IcyDiamond has left I've forked fluid_lib and just made a small update so you dont recieve "use_texture_alpha" warnings inside the minetest logfile as it shifted from a boolean to a value field for MT 5.4

Updated fluid_lib
https://github.com/sirrobzeroone/fluid_lib

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

Re: [Mod] Fluid API - Fluid Storage and Transfer! [fluid_lib]

by sirrobzeroone » Post

Cross-posting so people know this mods still be worked on - Some updates about fluid_lib here:

viewtopic.php?f=9&t=20320&p=401426#p401426

Short summary I'm also trying to de-couple fluid_lib more fully from MTG, certainly easier than elepower and I'll do a new version of Fluid_lib with the new version of Elepower when it's ready.

Josselin2
Member
Posts: 102
Joined: Thu May 28, 2020 15:32
GitHub: axcore
In-game: Josselin
Location: Tunnelers' Abyss

Re: [Mod] Fluid API - Fluid Storage and Transfer! [fluid_lib]

by Josselin2 » Post

I spent some time poking around inside fluid_lib, it looked like the code was half-finished, and I couldn't work out what the author's intentions were.

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

Re: [Mod] Fluid API - Fluid Storage and Transfer! [fluid_lib]

by sirrobzeroone » Post

Josselin2 wrote:
Mon Oct 18, 2021 05:24
I spent some time poking around inside fluid_lib, it looked like the code was half-finished, and I couldn't work out what the author's intentions were.
Might be because it was split out of elepower, I cant comment to much as I'm still getting my head fully around it.

From what I can tell really a quicker handy way to register fluids, fluid tanks and buckets, but it needs other mods to make it fully useful :).

User avatar
Rotfuchs-von-Vulpes
New member
Posts: 7
Joined: Sat Apr 23, 2022 17:32
GitHub: Rotfuchs-von-Vulpes
In-game: Rotfuchs-von-Vulpes
Location: Mato Grosso do Sul, Brasil
Contact:

Re: [Mod] Fluid API - Fluid Storage and Transfer! [fluid_lib]

by Rotfuchs-von-Vulpes » Post

the liquid does not appear for me.
Attachments
Sem título.png
Sem título.png (311.76 KiB) Viewed 1637 times

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

Re: [Mod] Fluid API - Fluid Storage and Transfer! [fluid_lib]

by sirrobzeroone » Post

Rotfuchs-von-Vulpes wrote:
Sun Jul 17, 2022 22:26
the liquid does not appear for me.
I'll have to check as I haven't looked at fluid_lib for awhile but you'll need some form of piping into the tank. For the life of me I can't remember if you can fill them with a bucket....

I'll have a look later today

User avatar
j0j0n4th4n
Member
Posts: 249
Joined: Tue Jan 26, 2021 06:45

Re: [Mod] Fluid API - Fluid Storage and Transfer! [fluid_lib]

by j0j0n4th4n » Post

Does this mod works with waterworks?
cdb_894a100ddd76

User avatar
j0j0n4th4n
Member
Posts: 249
Joined: Tue Jan 26, 2021 06:45

Re: [Mod] Fluid API - Fluid Storage and Transfer! [fluid_lib]

by j0j0n4th4n » Post

I'm having the same problem Rotfuchs-von-Vulpes was having. The liquid transfer is working but I don't get to see the fluid level in the node.

I try to add this code into the tank_on_timer function but so far I didn't get it to work:

Code: Select all

local percentage = 25 --100*buffer.amount/node.capacity
local overlaytex = "default_water_source.png^default_glass.png"
local finaltexture = "default_glass.png^[lowpart:".. percentage .. ":" .. overlaytex
		
node.textures = finaltexture
But so far it does nothing. I also suspect it isn't possible to change the texture of a node at runtime
cdb_894a100ddd76

User avatar
j0j0n4th4n
Member
Posts: 249
Joined: Tue Jan 26, 2021 06:45

Re: [Mod] Fluid API - Fluid Storage and Transfer! [fluid_lib]

by j0j0n4th4n » Post

I discover the problem. It only display the fluid when 'Connected Glass' is toggled at the menu setting, that is why the container appear empty before.
cdb_894a100ddd76

Post Reply

Who is online

Users browsing this forum: Google [Bot], imre and 16 guests