Help with animated texture

Post Reply
User avatar
Melkor
Member
Posts: 429
Joined: Sat Sep 24, 2011 01:03
Location: Underground

Help with animated texture

by Melkor » Post

I'm trying to convert a texture pack, but the problem I have is that some of them are a sequence of images and that doesn't work well in Minetest

corasTenthTry suggested that I use override.txt (documentation here: https://github.com/minetest/minetest/bl ... -overrides), but I can't find anything related to animation.

I found some posts that talk about this here:
viewtopic.php?t=18077
viewtopic.php?t=6767
but they don't seem to be the solution to the problem
I think that the animated textures existing in the game are hardcoded into the engine and there is not a option to put others (i hope somebody proves me wrong)

screenshot:
Attachments
texture_animation_problem.jpg
texture_animation_problem.jpg (54.23 KiB) Viewed 1835 times

User avatar
Melkor
Member
Posts: 429
Joined: Sat Sep 24, 2011 01:03
Location: Underground

Re: Help with animated texture

by Melkor » Post

Sorry, i'm a bit frustrated

User avatar
Skamiz Kazzarch
Member
Posts: 655
Joined: Fri Mar 09, 2018 20:34
GitHub: Skamiz
In-game: Skamiz
Location: la lojbaugag.

Re: Help with animated texture

by Skamiz Kazzarch » Post

Melkor wrote:
Thu Sep 12, 2024 22:18
i hope somebody proves me wrong
No, sorry.
Minetests texture pack support is... rather basic.

The only good news I can offer you is that animations are controlled from mods, not from the engine.
Relevant Lua API: https://github.com/minetest/minetest/bl ... in=1#L9039

For anything fancier then straight texture replacement you will probably need to turn you texturepack into a mod, at which point it can't be used when playing on a server.

User avatar
Melkor
Member
Posts: 429
Joined: Sat Sep 24, 2011 01:03
Location: Underground

Re: Help with animated texture

by Melkor » Post

Ok well, is a relief that now i know that there isn't much that i can do about it. Im not going to do a mod. Thanks

User avatar
Krock
Developer
Posts: 4683
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Help with animated texture

by Krock » Post

Which node is affected? And: what is its full texture string? How does your texture look like?
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
Melkor
Member
Posts: 429
Joined: Sat Sep 24, 2011 01:03
Location: Underground

Re: Help with animated texture

by Melkor » Post

Krock wrote:
Sat Sep 14, 2024 06:38
Which node is affected? And: what is its full texture string? How does your texture look like?
Sorry for the delay in replying, but I was gathering information.
This is all I could find so far
I've been converting a texture pack for the other games for a while now.
These screenshots are from the minetest subgame, the furnace works fine here, but not in mineclonia, nor voxellibre, but I guess this is their problem.
the affected nodes are:
default:stone_with_iron
default:stone_with_gold
default:stone_with_diamond
default:ice
But it also happens with animated items in the inventory or on the ground, in this case they are inverted downwards

in the image below you can see how the textures look, probably due to image compression, in the ice node you can't see the same problem as in the others

Sorry but i don't know what is full texture string (i googled it and did not understand it)
Attachments
diamond on ground
diamond on ground
diamond.jpg (38.19 KiB) Viewed 1608 times
from left to right diamond, bucket of lava, bucket of water and river water
from left to right diamond, bucket of lava, bucket of water and river water
items.jpg (16.58 KiB) Viewed 1608 times
from left to right: stone with iron, stone with gold, stone with diamond, ice
from left to right: stone with iron, stone with gold, stone with diamond, ice
blocks.jpg (130.16 KiB) Viewed 1608 times

User avatar
TenPlus1
Member
Posts: 3991
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: Help with animated texture

by TenPlus1 » Post

@Melkor - Those nodes aren't animated by default so when given an animated texture it will appear like in the screenshot. The proper way to animate them is to override the actual node and add a new tiles option e.g.

Code: Select all

minetest.override_item("default:stone_with_iron", {
	tiles = {{
		name = "default_stone_with_iron_animated.png",
		animation = {
			type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 1
		} -- width and height above depend on texture dimensions.
	}},
})

User avatar
Melkor
Member
Posts: 429
Joined: Sat Sep 24, 2011 01:03
Location: Underground

Re: Help with animated texture

by Melkor » Post

TenPlus1 wrote:
Sun Sep 15, 2024 07:05
@Melkor - Those nodes aren't animated by default so when given an animated texture it will appear like in the screenshot. The proper way to animate them is to override the actual node and add a new tiles option e.g.

Code: Select all

minetest.override_item("default:stone_with_iron", {
	tiles = {{
		name = "default_stone_with_iron_animated.png",
		animation = {
			type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 1
		} -- width and height above depend on texture dimensions.
	}},
})

Code: Select all

minetest.override_item("default:stone_with_iron", {
	tiles = {{
		name = "default_mineral_iron.png",
		animation = {
			type = "vertical_frames", aspect_w = 32, aspect_h = 1600, length = 1
		} -- width and height above depend on texture dimensions.
	}},
})
does this go in override.txt? doesn't work

User avatar
TenPlus1
Member
Posts: 3991
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: Help with animated texture

by TenPlus1 » Post

@Melkor - Unfortunately it will only work inside of a mod, one with a dependency on the game you are using in mod.conf

User avatar
Melkor
Member
Posts: 429
Joined: Sat Sep 24, 2011 01:03
Location: Underground

Re: Help with animated texture

by Melkor » Post

ok... thank you

User avatar
TenPlus1
Member
Posts: 3991
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: Help with animated texture

by TenPlus1 » Post

@Melkor - aspect_h is the height of a frame, so it will be 32 same as aspect_w, here's an example mod:

Create a folder called 'animated_ores' and add a 'textures' folder inside containing your new textures.

Create an 'init.lua' file and add this:

Code: Select all

minetest.override_item("default:stone_with_iron", {
	tiles = {{
		name = "default_mineral_iron.png",
		animation = {
			type = "vertical_frames", aspect_w = 32, aspect_h = 32, length = 1
		}
	}},
})
Create a 'mod.conf' file and add this:

Code: Select all

name = animated_ores
description = Animates default ore blocks.
depends = default
Open a new world, enable mod and your iron ore should now be animated :)

User avatar
Melkor
Member
Posts: 429
Joined: Sat Sep 24, 2011 01:03
Location: Underground

Re: Help with animated texture

by Melkor » Post

Ok i will do it :)

Post Reply