Adding optional top, bottom, & side tiles to basic blocks

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

Adding optional top, bottom, & side tiles to basic blocks

by Neuromancer » Sat Aug 23, 2014 03:40

One of the things I noticed is that Minecraft has a lot of basic blocks that also have tops and side textures/tiles. This may seem like a subtle difference, but it allows for much more variety in things that are getting built, and buildings just look better. I would like to create a mod that could replace the default mod in minetest_game, and would allow _top, _bottom, and _side textures to be used if they are found in a texture pack, otherwise just use the one texture file that is in the texture pack on all sides so that this mod would be compatible with all texture packs, even if they don't have the _side, _top, and _bottom texture files. Is there an easy way to do this?
Here's the typical line you would see in a register node:
tiles = {"default_furnace_top.png", "default_furnace_bottom.png", "default_furnace_side.png",
"default_furnace_side.png", "default_furnace_side.png", "default_furnace_front.png"},
How do I make these optional?
 

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

Re: Adding optional top, bottom, & side tiles to basic block

by rubenwardy » Sat Aug 23, 2014 05:43

Easy to do this server side, but for client side you would just need to have each side a different texture. You would have redundant textures.

A better way is a new feature. Add a file in the texture pack called overrides.txt which is in the format:

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
modname:itemname:top = modname_itemname_top.png


On server side, it is quite easy, but it only supports server side texture packs. Make a function like auto_texture(mod, item)

Use io in that file to find the texture pack directory, and to see if the files exist. Or use the mod's textures as fallback.
Last edited by rubenwardy on Mon Aug 25, 2014 10:54, edited 1 time in total.
 

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

Re: Adding optional top, bottom, & side tiles to basic block

by Neuromancer » Sat Aug 23, 2014 21:38

rubenwardy wrote:
A better way is a new feature. Add a file in the texture pack called overrides.txt which is in the format:
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
modname:itemname:top = modname_itemname_top.PNG


Thanks for the idea. How new is this feature? I followed these instructions exactly using minetest-0.4.10-dev-win64-e69d660784 and putting an overrides.txt file in my texture folder with the content
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
default:sandstone:top = default_sandstone_top.PNG

But it just ignores it, and leaves the top the same as the sides. I don't have any sub-folders in my textures folder. It's just 1 folder for my texture pack in the textures folder with the file and texture.png files in there.
 

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

Re: Adding optional top, bottom, & side tiles to basic block

by rubenwardy » Sun Aug 24, 2014 14:48

A new feature as in it doesn't exist. Adding a new feature.
 

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

Re: Adding optional top, bottom, & side tiles to basic block

by Neuromancer » Tue Aug 26, 2014 00:17

rubenwardy wrote:A new feature as in it doesn't exist. Adding a new feature.

An overrides.txt file in the texturepack folder would be the perfect way to implement it. How close is this feature to being implemented? Is it a great idea of yours that needs to be championed, or has it already been implemented but will be put into a future release sometime soon?
 

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

Re: Adding optional top, bottom, & side tiles to basic block

by rubenwardy » Tue Aug 26, 2014 16:44

It is an idea of mine.

See IRC chat about it
 

User avatar
Neuromancer
Member
 
Posts: 793
Joined: Tue Jun 12, 2012 22:28
GitHub: Neuromancer56

Re: Adding optional top, bottom, & side tiles to basic block

by Neuromancer » Wed Aug 27, 2014 02:35

Is there a way to do this now from a texture pack, with extra textures? For example if I wanted a top and a bottom on default_sandstone, do I need to create a default_sandstone_top, default_sandstone_bottom, default_sandstone_side, default_sandstone_front, default_sandstone_back? Or do I need a left and right instead of side? Or is this impossible client side in a texture pack? Do I need to create a mod instead?
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 19 guests