Blocks Animation, question

User avatar
bosapara
Member
 
Posts: 341
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara
In-game: Jozet

Blocks Animation, question

by bosapara » Wed Aug 01, 2018 07:40

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: 2470
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: Blocks Animation, question

by TumeniNodes » Wed Aug 01, 2018 16:24

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
My brain, is AES256 encrypted, even I don't know wth I'm thinking...
 

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

Re: Blocks Animation, question

by todada » Wed Aug 01, 2018 17:27

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: 2470
Joined: Fri Feb 26, 2016 19:49
Location: in the dark recesses of the mind
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes

Re: Blocks Animation, question

by TumeniNodes » Wed Aug 01, 2018 18:05

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
(7.07 KiB) Not downloaded yet
My brain, is AES256 encrypted, even I don't know wth I'm thinking...
 

User avatar
bosapara
Member
 
Posts: 341
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara
In-game: Jozet

Re: Blocks Animation, question

by bosapara » Wed Aug 01, 2018 19:53

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: 341
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara
In-game: Jozet

Re: Blocks Animation, question

by bosapara » Wed Aug 01, 2018 19:56

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: 341
Joined: Fri Apr 07, 2017 08:49
GitHub: bosapara
In-game: Jozet

Re: Blocks Animation, question

by bosapara » Sun Aug 05, 2018 16:00

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,
         },
      },
   },
})
 


Return to Feature Discussion



Who is online

Users browsing this forum: No registered users and 3 guests