appgurueu / texgen

Texture Generator mod for Minetest
7 stars 0 forks source link

doesn't use texture pack from texture_path #1

Closed Lemente closed 1 year ago

Lemente commented 1 year ago

I finally took the time to play with this mod! But something confused me.

I was expecting the mod to use the texture pack provided by texture_path (in my case rpg16) Instead it uses the textures from the mods. And then rpg16 textures simply acted as a normal texturepack.

original with rpg16 (notice the cliff, dirt, stone and grass on the left) Asuna rpg16

with texgen and rpg16 Asuna texgen rpg16

with texgen and blank texture_path (my palette doesn't contain gray/brown, and is more muted than rpg16) minetest_W5CICpjmcv

I am wondering if I am missing some setting, or if this is done on purpose. Or maybe it is a limitation?

I tried this workaround: turn the TP into a mod that depends on the same mods as texgen. And make texgen depends on it. But that doesn't seem to work. I am assuming the textures modified are the one used when an item is registered?

appgurueu commented 1 year ago

I was expecting the mod to use the texture pack provided by texture_path (in my case rpg16) Instead it uses the textures from the mods. And then rpg16 textures simply acted as a normal texturepack.

Yes, that's how it currently works: It searches all mods for textures, then applies overrides based on mod load order. It doesn't take texture packs into account since I was unaware that I could get their paths using texture_path (and mod security will probably block reads from texture packs, but this can be circumvented by using an insecure environment).

However, even if texgen were to use the texture pack textures as a base, the texture pack would still override them; you'd have to leave, turn off the texture pack, turn off texgen, extract the textures into a texture pack, then rejoin with that...

Perhaps I could also use "hacks" like changing the texture_path setting after generating the texture pack and hoping it takes effect...

I tried this workaround: turn the TP into a mod that depends on the same mods as texgen. And make texgen depends on it. But that doesn't seem to work. I am assuming the textures modified are the one used when an item is registered?

That should actually work, but if RPG16 is still enabled, the RPG16 textures will still override the texgen textures. Does it not work if you disable RPG16?

Lemente commented 1 year ago

I did disable the rpg16 texturepack while using the rpg16 mod.

screenshot without texgen and with the rpg16 mod image

screenshot with texgen and the rpg16 mod. None of the rpg16 textures are used (gold ore, ground, snow), as they are replaced by the ones generated by texgen from the source textures. image

And no TP provided image

Here is the rpg16 mod in case you want to test: https://github.com/Lemente/rpg16_mod (you will have to edit dependancies though)

appgurueu commented 1 year ago

Thanks. I think I see the problem now: modlib's media module doesn't deal with subdirectories correctly. Will fix.

appgurueu commented 1 year ago

Fixed in https://github.com/appgurueu/modlib/commit/cc49af0ae6480e49407bf0709af1813a5bb1f4d1 (modlib commit).

Also fixed a related issue in https://github.com/appgurueu/texgen/commit/369b27a57eca404742f063921b8ebc842e441204.

You'll have to upgrade modlib to the newest version (rolling-100).

Note that you'll also have to fix https://github.com/Lemente/rpg16_mod/issues/1 or you'll get a crash with "CRC mismatch" as the error message.

Thanks for the report!