What are the limits of the "override" function?

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

What are the limits of the "override" function?

by TumeniNodes » Tue Jan 10, 2017 12:45

I just threw the start of an experiment together least night, as a WIP mod.

I fully realize what is done in the mod is not a big deal, it was just to get an idea of how override works.

But, the main goal, is to find out if there is a way to implement one of two functions I have been thinking about.
I am not a coder or skilled at it so, I am hoping I will be able to get the attention/help with this of someone who is..., if they think my ideas might be possible.

So, here are two things I have been thinking about...

We can use override in a mod to "override" some functions and textures... The textures part is what I'm interested in.

So, #1. Is it possible to use the same (or similar) form which MC does... using meta.txt, per animated texture within a normal TP folder format, as we use now...
or...
#2. is it possible to create a mod which has some animated textures, with an init.lua set up for those animations functions, and then actually use some code to literally override default/textures folder, with the mods texture folder? Rather than needing to create a mod where you need to use a lot of code to literally override every single texture in default?

I hope my questions make sense the way I wrote them, if not please let me know. And I truly hope that one of these ideas is doable, because I think this would bring a lot of fresh ideas, and really cool packs, TP-wise

There may be other ways I am overlooking which are simpler or doable as well...

That's it... if anyone can shed light for me regarding this, or is interested in exploiting the ideas let me know. Thanks : )
Flick?... Flick who?
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: What are the limits of the "override" function?

by rubenwardy » Tue Jan 10, 2017 13:20

overrides.txt https://github.com/minetest/minetest/bl ... s.txt#L128 although animations are not supported
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: What are the limits of the "override" function?

by TumeniNodes » Tue Jan 10, 2017 13:38

rubenwardy wrote:overrides.txt https://github.com/minetest/minetest/bl ... s.txt#L128 although animations are not supported


Well.., that seems simple enough.... thank you for pointing me too it...
but an animated .png won't work with this? Hmmm, bummer, that is what the premise of this post is about : /

I wonder if anyone will ever fiddle with it to try to add support for them

edit> Oh... wait a seconf rubenwardy... I don't think this is what I am referring to at all... sorry about that.

I am not looking to override texture on a node... but rather, over ride entire default textures, via a TP with animated textures.
Here is a link to the quick, goofy mod I did just to begin testing this idea https://forum.minetest.net/viewtopic.php?f=9&t=16387

In other words, if I create animated textures in my TP, so that a couple of ores twinkle via ani.png... when users download, install, and then select my TP, they will be able to have the ani textures, without them needing to make any changes to their default nodes.lua, it would just be done through the TP or mod/tp. That is the goal
Flick?... Flick who?
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: What are the limits of the "override" function?

by TumeniNodes » Tue Jan 10, 2017 13:52

I also just realized that, yes... it can be added to this info you shared that animated.png's are supported with this form of override function for textures.... because I did it ; )

Although, maybe it only worked because I didn't know it isn't supposed to? :P
Flick?... Flick who?
 

User avatar
Napiophelios
Member
 
Posts: 752
Joined: Mon Jul 07, 2014 01:14
GitHub: Napiophelios
IRC: Nappi
In-game: Nappi

Re: What are the limits of the "override" function?

by Napiophelios » Tue Jan 10, 2017 14:31

One of the hiccups I ran into, is that you can change a texture with your mod
but if another mod uses the material it will use the default textures.

Example: In my Aligned bricks mod, I change textures for all brick nodes;
but when I make stairs from bricks it uses the default textures.
You would then have to override stairs or any other mod you can think of

TBH tho, it seems pointless to go about it the way you are trying to.

EDIT: sorry I think I misunderstood.
if you want to give animated textures to nodes that aren't normally animated,
then yes this is the way to do it I think. But only override the particular parts you want to change.

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
[code]minetest.override_item("default:stone_with_gold", {
tiles = {
      {
         image = "default_stone.png^animod_mineral_gold.png",
         backface_culling = false,
         animation = {
            type = "vertical_frames",
            aspect_w = 16,
            aspect_h = 16,
            length = 1.5
         },
      }
   },
})



Does "default_stone.png^animod_mineral_gold.png" actually work?
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: What are the limits of the "override" function?

by TumeniNodes » Tue Jan 10, 2017 14:54

Napiophelios wrote:One of the hiccups I ran into, is that you can change a texture with your mod
but if another mod uses the material it will use the default textures.

Example: In my Aligned bricks mod, I change textures for all brick nodes;
but when I make stairs from bricks it uses the default textures.
You would then have to override stairs or any other mod you can think of

TBH tho, it seems pointless to go about it the way you are trying to.

EDIT: sorry I think I misunderstood.
if you want to give animated textures to nodes that aren't normally animated,
then yes this is the way to do it I think. But only override the particular parts you want to change.

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
[code]minetest.override_item("default:stone_with_gold", {
tiles = {
      {
         image = "default_stone.png^animod_mineral_gold.png",
         backface_culling = false,
         animation = {
            type = "vertical_frames",
            aspect_w = 16,
            aspect_h = 16,
            length = 1.5
         },
      }
   },
})



Does "default_stone.png^animod_mineral_gold.png" actually work?


Yep... D/L and see. be warned, the animation is shloppy... I literally just whipped it together for this to test

I see your point. didn't even think about the impact on other mods which use these textures... and in this case, being ores... they are used a lot. : /
Hmmmm.... well, poop. Now what? :P
Flick?... Flick who?
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: What are the limits of the "override" function?

by TumeniNodes » Tue Jan 10, 2017 15:49

Actually..., I was just thinking about my own answer regarding over riding nodes which other mods use and... It really comes down to using forethought when overriding a texture with an animated one...

For instance, any "stone_with_mineral" textures would be safe to animated because, only the map uses this feature.

Nodes such as "stone_brick" etc., would not work well but, most "natural" nodes should be fine.... we could have animated leaf nodes so they look like they are rustling..., the default_mineral textures so they twinkle and sparkle... and possibly (if I can spruce up my animating skills...), a special.cool animation for certain nodes when they are punch, maybe they shrink a little, spin, fizzle and then pop... (but that would also need a way to replace the node which was just punched out to be replaced by a completely transparent node with an animation of what I just described, because actual node physics can't do all that.

Of course all of this is, atm, just thought... just trying to look into ways to enhance and bring some new visual excitement to MT via graphics (and coding which I am just not to good at)
Flick?... Flick who?
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 5 guests

cron