Page 1 of 1

Subfolders for mod media

PostPosted: Fri Jan 16, 2015 10:18
by Kenney
For big mods it would be wise to allow subfolders for mod media, so that all textures/sounds don't have to be added to the /textures and /sounds folder but rather have a possible structure like this:

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
/textures/doors/
/textures/foliage/
/textures/ores/


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
/sounds/wood/
/sounds/metal/
/sounds/foley/


Usage sample:

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
minetest.register_node("default:grass", {
   description = "Grass",
   tiles = {"foliage/grass.png"}
})

Re: Subfolders for mod media

PostPosted: Fri Jan 16, 2015 10:25
by rubenwardy
+1

Not sure about foliage/ though, what about texture packs? I guess they should use folders to, if this is the case.
I'd suggest just grass.png when refering to textures/foilage/..., in order to make it simpler for texture packs and other mods.

Some users use subfolders for alternative media, though.
Maybe Minetest should ignore directories which start with _ or .

Order of checking should be this:

  • Texture packs
  • textures/
  • textures/subfolders in alphabetical order.

Re: Subfolders for mod media

PostPosted: Fri Jan 16, 2015 11:27
by Kenney
Agreed!

Re: Subfolders for mod media

PostPosted: Sat Jan 17, 2015 03:53
by TG-MyinaWD
Yeah and maybe a subfolder, for the models? But would the lua run an "/" and I think maybe possible we can have, the thing to check for ! since seems they don't work well. Also check the folder has "()" Unless already does. I know description doesn't since people do like "(Something)". But now I wonder is how many mods can Minetest load at any given time? Since I heard was limited.

Re: Subfolders for mod media

PostPosted: Sat Jan 17, 2015 04:33
by TriBlade9
I greatly like this idea. Perhaps if all media loading could be done somewhat recursively, that would be great.
Additionally, texture packs could have subfolders which could be organized per-mod or per-type, but with no real restriction on it.

Re: Subfolders for mod media

PostPosted: Sat Jan 17, 2015 08:40
by Calinou
If we had subfolders, we should probably settle on a standard to make it consistent. The subfolders could be per-mod, which is an objective criteria.

Re: Subfolders for mod media

PostPosted: Sat Jan 17, 2015 10:01
by Casimir
Calinou wrote:The subfolders could be per-mod, which is an objective criteria.

I love standards! For texturepacks that is what should be done.

When you need subfolders for your mod, then maybe the mod is just to big. A better solution would be to split it up. That the minetest_game default mod contains so much stuff it a historic thing. In my subgame I don't add things to it any more. Everything has it's own small mod, when there are to many mods I'll organize them in modpacks.
With sub folders inside a mod you end up having the contents of foo distributed in foo.lua texures/foo/ sounds/foo/ and so on. Instead of having everything foo in one mod.

Re: Subfolders for mod media

PostPosted: Sat Jan 17, 2015 13:36
by afflatus
Casimir wrote:I love standards! For texturepacks that is what should be done.

When you need subfolders for your mod, then maybe the mod is just to big. A better solution would be to split it up. That the minetest_game default mod contains so much stuff it a historic thing. In my subgame I don't add things to it any more. Everything has it's own small mod, when there are to many mods I'll organize them in modpacks.
With sub folders inside a mod you end up having the contents of foo distributed in foo.lua texures/foo/ sounds/foo/ and so on. Instead of having everything foo in one mod.


+ 1 on Standards.
You shouldn't have to split up a mod in order to organise its contents more efficiently.