Page 1 of 1

Experiment to create air bubbles.

PostPosted: Wed Feb 01, 2017 11:48
by googol
HI.
I have a question.
This is a bug or a feature?
How can I get a stable operating node (bubble_sand) in my mod?
Thank you.

1.png
air bubbles
1.png (280.14 KiB) Viewed 2298 times

2.png
2.png (265.75 KiB) Viewed 2298 times


Video link:
https://youtu.be/sYw6Emfdumg

Sorry for my English

Re: Experiment to create air bubbles.

PostPosted: Wed Feb 01, 2017 14:50
by ExeterDad
Hah! That's pretty cool looking! Liked the video.
You may want to look into the code for the "under sea" mod that's out there. I believe the void was overcome with a fake water?

Re: Experiment to create air bubbles.

PostPosted: Wed Feb 01, 2017 18:46
by googol
In video i demonstrate a piece of code where i'm doing a comment of one line:
liquid_alternative_flowing = "default:water_flowing",

In full code of node:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node("bubble_sand:bubbles", {
        description = "Bubbles",
        drawtype = "plantlike",
        tiles = {{ name = "bubble_basic_flame_animated.png",
                   animation = { type = "vertical_frames",
                                aspect_w = 16,
                                aspect_h = 16,
                                length = 0.5,
                              },
                },},
          -- New-style water source material (mostly unused)
        special_tiles = {{ name = "bubble_basic_flame_animated.png",
                           animation = { type = "vertical_frames",
                                         aspect_w = 16,
                                         aspect_h = 16,
                                         length = 0.5,
                                       },
                          backface_culling = true,
                        },},
        alpha = 255,
        paramtype = "light",
        walkable = false,
        pointable = false,
        diggable = false,
        buildable_to = true,
        is_ground_content = false,
        drop = "",
        drowning = 1, -
        liquidtype = "source",
        liquid_alternative_flowing = "default:water_flowing",
--        liquid_alternative_flowing = "bubble_sand:bubbles",
         liquid_alternative_source = "bubble_sand:bubbles",
--         liquid_alternative_source = "default:water_source",
        liquid_viscosity = 1,
   liquid_renewable = false,
   liquid_range = 0,
        post_effect_color = {a = 103, r = 30, g = 60, b = 90},
        groups = {water = 3, liquid = 3, puts_out_fire = 1, cools_lava = 1},
--       freezemelt = "default:water_source",
})


After this node air bubbles stay flooded
but i lose a possibility to generate new bubbles, it's like blocks are fulling with water (in my opinion)
Who can watch my full code and help me with this situation?

Re: Experiment to create air bubbles.

PostPosted: Wed Feb 01, 2017 19:55
by TenPlus1
Maybe this will help, place bubblesand node underwater around 5 deep and watch :)

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_node("bubble_sand:bubblesand", {
   description = "Bubble Sand",
   tiles = {"default_sand.png"},
   groups = {crumbly = 3, falling_node = 1, sand = 1},
   sounds = default.node_sound_sand_defaults(),

   on_timer = function(pos)

      local offset_x = math.random(-10, 10) / 20
      local offset_z = math.random(-10, 10) / 20
      local pos2 = {
         x = pos.x + offset_x,
         y = pos.y + 0.5,
         z = pos.z + offset_z,
      }

      minetest.add_particle({
         pos = pos2,
         velocity = {x = 0, y = 0, z = 0},
         acceleration = {x = 0, y = 1, z = 0},
         expirationtime = 2,
         collisiondetection = false,
         texture = "bubble.png",
         size = math.random(1, 2),
      })

      minetest.get_node_timer(pos):start(1)
   end,

   on_construct = function(pos)
      minetest.get_node_timer(pos):start(1)
   end,
})

Re: Experiment to create air bubbles.

PostPosted: Thu Feb 02, 2017 07:16
by googol
Thanks, TenPlus1
May be your way is right.

I will not be regarded as a heretic for round objects in minetest?

Easy testing showed me a display problem Particle. I do not see them under water while in the air.
ImageImage

Re: Experiment to create air bubbles.

PostPosted: Thu Feb 02, 2017 08:49
by TenPlus1
Seems minetest has a few display glitches like this, especially when using node transparency in certain cases.

Re: Experiment to create air bubbles.

PostPosted: Thu Feb 02, 2017 09:35
by googol
Ok i will continue experiment.
Maybe this bug need write to the bug reports?

Re: Experiment to create air bubbles.

PostPosted: Sat Feb 04, 2017 05:50
by googol
So
What you think about this?

Video link:
https://youtu.be/vFjiG-FbZSw

------
Discussion move to https://forum.minetest.net/viewtopic.php?f=9&t=16587