Blocks Animation, question

Post Reply
User avatar
bosapara
Member
Posts: 637
Joined: Fri Apr 07, 2017 08:49

Blocks Animation, question

by bosapara » Post

Is it possible to use similar effect in Minetest only with 1 png animation file for several nodes?

Image

Checked this variant, in result have this

Image

Code: Select all

minetest.register_node("default:ice", {
	description = "Ice",
	tiles = {
		{
			name = "(default_river_water_source_animated.png)^(default_gravel.png)",
			animation = {
				type = "vertical_frames",
				aspect_w = 16,
				aspect_h = 16,
				length = 2.0,
			},
		},
	},

User avatar
TumeniNodes
Member
Posts: 2943
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: Blocks Animation, question

by TumeniNodes » Post

Not sure what you're trying to achieve here for an end result.

If you are looking to have gravel appear under the water apng, using this method will not work.

Can you give a bit more description of what you are trying to do, visually?
It is rather confusing as you have it set up as ice in both name and desc, then you are trying to use the water apng with gravel?

The animation you show (the book) does not use an overlay, it is all done within each frame of the animation
A Wonderful World

todada
New member
Posts: 5
Joined: Sat Mar 18, 2017 18:49
GitHub: todada

Re: Blocks Animation, question

by todada » Post

You have to create a base image with same size as the animation.
Afaik. there is no easy way to fill an image with a pattern, so you have to combine the static png 16 times.
You can try something like:

Code: Select all

             name = "[combine:16x256:0,0=default_gravel.png"..
                                   ":0,16=default_gravel.png"..
                                   ":0,32=default_gravel.png"..
                                   ":0,48=default_gravel.png"..
                                   ":0,64=default_gravel.png"..
                                   ":0,80=default_gravel.png"..
                                   ":0,96=default_gravel.png"..
                                   ":0,112=default_gravel.png"..
                                   ":0,128=default_gravel.png"..
                                   ":0,144=default_gravel.png"..
                                   ":0,160=default_gravel.png"..
                                   ":0,176=default_gravel.png"..
                                   ":0,192=default_gravel.png"..
                                   ":0,208=default_gravel.png"..
                                   ":0,224=default_gravel.png"..
                                   ":0,240=default_gravel.png^[mask:default_water_source_animated.png",
The result looks not very nice, though. But this can be used as a start...

Edit: looks much better if you remove the "[mask:" operator.
Last edited by todada on Wed Aug 01, 2018 20:34, edited 1 time in total.
Hmmmm.....

User avatar
TumeniNodes
Member
Posts: 2943
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: Blocks Animation, question

by TumeniNodes » Post

or..., one could simply do this

Image

of course then you would have to switch to

Code: Select all

use_texture_alpha = true
this is one of many reasons I wish we could implement a way to use texture properties from within the TP, per texture, without the need to go in and alter the base code.

maybe a bit obnoxious but using rather than '.mcmeta' we could implement .mtmeta or even .texmeta file extension in which we could add such definitions to a texture
Attachments
default_river_water_with_gravel.png
default_river_water_with_gravel.png (7.07 KiB) Viewed 357 times
A Wonderful World

User avatar
bosapara
Member
Posts: 637
Joined: Fri Apr 07, 2017 08:49

Re: Blocks Animation, question

by bosapara » Post

todada wrote:You have to create a base image with same size as the animation.
Afaik. there is no easy way to fill an image with a pattern, so you have to combine the static png 16 times.
You can try something like:

Code: Select all

             name = "[combine:16x256:0,0=default_gravel.png"..
                                   ":0,16=default_gravel.png"..
                                   ":0,32=default_gravel.png"..
                                   ":0,48=default_gravel.png"..
                                   ":0,64=default_gravel.png"..
                                   ":0,80=default_gravel.png"..
                                   ":0,96=default_gravel.png"..
                                   ":0,112=default_gravel.png"..
                                   ":0,128=default_gravel.png"..
                                   ":0,144=default_gravel.png"..
                                   ":0,160=default_gravel.png"..
                                   ":0,176=default_gravel.png"..
                                   ":0,192=default_gravel.png"..
                                   ":0,208=default_gravel.png"..
                                   ":0,224=default_gravel.png"..
                                   ":0,240=default_gravel.png^[mask:default_water_source_animated.png",
The result looks not very nice, though. But this can be used as a start...
Two layers have the sam transparency. Need to make first - isn't transparency, second is transparency that will be animate

Here the result of 'combine' with your variant:

Image
Last edited by bosapara on Wed Aug 01, 2018 19:57, edited 1 time in total.

User avatar
bosapara
Member
Posts: 637
Joined: Fri Apr 07, 2017 08:49

Re: Blocks Animation, question

by bosapara » Post

TumeniNodes wrote:or..., one could simply do this

Image

of course then you would have to switch to

Code: Select all

use_texture_alpha = true
this is one of many reasons I wish we could implement a way to use texture properties from within the TP, per texture, without the need to go in and alter the base code.

maybe a bit obnoxious but using rather than '.mcmeta' we could implement .mtmeta or even .texmeta file extension in which we could add such definitions to a texture
Yep, its easy idea, but it waste a lot of 'mb' that we will spend for 16*256, if we need to animate 50 textures (tools, blocks etc)

User avatar
bosapara
Member
Posts: 637
Joined: Fri Apr 07, 2017 08:49

Re: Blocks Animation, question

by bosapara » Post

at 50% solved

how to make 'right' animation overlay for blocks - found (for tools - no)

Image

Code: Select all

minetest.register_node("default:ice", {
   description = "Ice",
   tiles = {
      {
                    name = "[combine:16x256:0,0=default_stone.png"..
                                   ":0,16=default_stone.png"..
                                   ":0,32=default_stone.png"..
                                   ":0,48=default_stone.png"..
                                   ":0,64=default_stone.png"..
                                   ":0,80=default_stone.png"..
                                   ":0,96=default_stone.png"..
                                   ":0,112=default_stone.png"..
                                   ":0,128=default_stone.png"..
                                   ":0,144=default_stone.png"..
                                   ":0,160=default_stone.png"..
                                   ":0,176=default_stone.png"..
                                   ":0,192=default_stone.png"..
                                   ":0,208=default_stone.png"..
                                   ":0,224=default_stone.png"..
                                   ":0,240=default_stone.png^(default_torch_on_floor_animated.png^[opacity:290)",
         animation = {
            type = "vertical_frames",
            aspect_w = 16,
            aspect_h = 16,
            length = 2.0,
         },
      },
   },
})

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests