Page 1 of 2

Attention those using glass nodes as liquid tanks

Posted: Thu Mar 30, 2017 06:29
by paramat
Image

The 2 drawtypes 'glasslike_framed' and 'glasslike_framed_optional' have the ability to act as hollow tanks of liquid containing a liquid level with 64 levels defined by param2. This has until now been completely undocumented and was missing a 'paramtype2' for that use of param2.

I have now fixed this, but this means that nodes being used as liquid tanks now need to have this line added to their node definitions:

Code: Select all

paramtype2 = "glasslikeliquidlevel",

Re: Attention those using glass nodes as liquid tanks

Posted: Sat Apr 01, 2017 00:17
by Jordach
Okay then; how do we use this?

Examples for how to set fill level in 1/16ths.

Examples for settings textures to liquid and glass node.

If you don't tell us how to use it, then it's a useless feature as there's no documentation in useful terms.

Re: Attention those using glass nodes as liquid tanks

Posted: Sat Apr 01, 2017 03:48
by paramat
I added some documentation in my commit https://github.com/minetest/minetest/co ... 5a4b404409

Code: Select all

    paramtype2 == "glasslikeliquidlevel"
    ^ Only valid for "glasslike_framed" or "glasslike_framed_optional" drawtypes.
      param2 defines 64 levels of internal liquid.
      Liquid texture is defined using `special_tiles = {"modname_tilename.png"},`
Param2 values 0 to 63 define 64 levels, so for 1/16ths use values 0, 3, 7, 11 ...
Glass and frame textures are as standard glaslike_framed.

Re: Attention those using glass nodes as liquid tanks

Posted: Sat Apr 01, 2017 09:01
by azekill_DIABLO
wow this is awesome! it looks odd though with solid blue color.

Re: Attention those using glass nodes as liquid tanks

Posted: Sat Apr 01, 2017 13:33
by Jordach
paramat wrote:I added some documentation in my commit https://github.com/minetest/minetest/co ... 5a4b404409

Code: Select all

    paramtype2 == "glasslikeliquidlevel"
    ^ Only valid for "glasslike_framed" or "glasslike_framed_optional" drawtypes.
      param2 defines 64 levels of internal liquid.
      Liquid texture is defined using `special_tiles = {"modname_tilename.png"},`
Param2 values 0 to 63 define 64 levels, so for 1/16ths use values 0, 3, 7, 11 ...
Glass and frame textures are as standard glaslike_framed.
~~Is it using param2 = 0-63 or 0-127?~~

^ Ignore that.

Absolutely fabulous.

Re: Attention those using glass nodes as liquid tanks

Posted: Sun Apr 02, 2017 08:53
by ABJ
Does this mean we can fill a window with water?

Re: Attention those using glass nodes as liquid tanks

Posted: Sun Apr 02, 2017 09:06
by azekill_DIABLO
Does this mean we can fill mutiple windows like if it was only one big window?

Re: Attention those using glass nodes as liquid tanks

Posted: Sun Apr 02, 2017 18:02
by GreenXenith
azekill_DIABLO wrote:Does this mean we can fill mutiple windows like if it was only one big window?
That is an interesting idea. How does this interact with glass_like_framed?

Re: Attention those using glass nodes as liquid tanks

Posted: Mon Apr 03, 2017 04:38
by paramat
To be clear, a liquid tank only supports 64 levels, with 64 being 'full', and param2 values 0 to 63 control the level.
So 1/2 full is 31, 1/4 full is 15, 1/8 full is 7 etc.

Re: Attention those using glass nodes as liquid tanks

Posted: Mon Apr 03, 2017 04:50
by paramat
Image

Connected tanks work horizontally only.

Re: Attention those using glass nodes as liquid tanks

Posted: Mon Apr 03, 2017 09:00
by ABJ
So how do I place water inside glass? Do I need to edit the mods?

Re: Attention those using glass nodes as liquid tanks

Posted: Mon Apr 03, 2017 23:42
by MineYoshi
Good Work developers and you Paramat +10

Re: Attention those using glass nodes as liquid tanks

Posted: Fri May 19, 2017 20:57
by wilkgr76
Is it possible to change the colour?

Re: Attention those using glass nodes as liquid tanks

Posted: Fri May 19, 2017 23:06
by maikerumine
Wasn't this an April Fools prank!?

Re: Attention those using glass nodes as liquid tanks

Posted: Sat May 20, 2017 00:08
by wilkgr76
It was posted 30 March, so no

Re: Attention those using glass nodes as liquid tanks

Posted: Sat May 20, 2017 02:38
by ExeterDad
maikerumine wrote:Wasn't this an April Fools prank!?
https://github.com/minetest/minetest/pull/5478

Re: Attention those using glass nodes as liquid tanks

Posted: Sat May 20, 2017 12:34
by paramat
Erm, there are questions in this thread that are all answered in the 3rd post.
Not a prank, it was a feature added by RealBadAngel years ago and never properly documented.

Re: Attention those using glass nodes as liquid tanks

Posted: Sun May 21, 2017 00:23
by wilkgr76
My apologies :)

Re: Attention those using glass nodes as liquid tanks

Posted: Sun May 21, 2017 12:41
by azekill_DIABLO
this is really nice feature

Re: Attention those using glass nodes as liquid tanks

Posted: Tue May 23, 2017 09:20
by texmex
paramat, is it possible to make connected tanks work vertically too, eventually?

Re: Attention those using glass nodes as liquid tanks

Posted: Tue May 23, 2017 09:34
by wilkgr76
texmex, you can set the bottom ones to full and the top ones to empty, which would result in the same result, I'm guessing

Re: Attention those using glass nodes as liquid tanks

Posted: Tue May 23, 2017 14:03
by twoelk
old videos documenting RealBadAngel's experiments with this
Glasslike Framed - Liquid Oxygen tanks
Tanks update

Re: Attention those using glass nodes as liquid tanks

Posted: Tue May 23, 2017 19:27
by texmex
Thank you both.

Re: Attention those using glass nodes as liquid tanks

Posted: Wed May 24, 2017 04:29
by hajo
paramat wrote: The 2 drawtypes 'glasslike_framed' and 'glasslike_framed_optional' have the ability
to act as hollow tanks of liquid containing a liquid level with 64 levels defined by param2.
Can it use negative numbers too, to reverse the placement,
i.e. put the 'liquid' on top, growing down ?

Then it could be used for a window-shade.

And if the liquid could be placed on the left edge, growing to the right,
we could have an ingame-progressbar.

Re: Attention those using glass nodes as liquid tanks

Posted: Thu May 25, 2017 18:27
by paramat
> paramat, is it possible to make connected tanks work vertically too, eventually?

That would be quite complex as you need to search up and down and detect vertical dimensions. Horizontally naturally works with almost no effort.
You could do this with Lua code in a mod setting param2 according to position in the stacked nodes.