tinoesroho wrote:Seems to be broken, it's not loading the overlay. The idea is for these overlays to get slapped on top of the base, because I'm too lazy to make a bunch of files every update. I don't remember the real reason.
"Could not load: "clothing_inv_pants_white.png"
I am sorry, I have no idea what you are trying to acheive with those overlays but I can tell you that is not gonna work as you expect. For one thing there is no 'texture' in minetest item definition so setting that does precisely nothing, image files are derived from the item name (as described in my last post). You could overlay inventory images but I see no sense in that either as you will only ever see the topmost image.
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_craft_item("clothing:pants_"..k, {
description = k:gsub("%a", string.upper, 1).." Pants",
inventory_image = "clothing_inv_pants_"..k..".png",
groups = {clothing=1, no_preview=1},
})
Some other minor points:
minetest.register_craft_item is probably more appropriate than .register_tool unless you want clothing to wear out in some way. If so then you will need to add code to make that happen, registering as a tool is not enough on its own. I guess you could make clothing items wear slightly every time you change them, not sure how folks would like that.
Registering items in a loop like that is clever and saves some typing but (imo) if you want to encourage others to contribute, you may be better off writing them out in full. (less confusing to non-coders that may otherwise be great at making textures)
I appreciate you probably need to use the example images as a reference, I would prefer you took them out of the repo since I cannot supply a valid license for them. They are mostly my own making but parts were taken from a variety of different sources.
On a side note, I think the reason for the error you are getting is because in your code you have "clothing_pants_inv_white.png" while the image file is called "clothing_inv_pants_white.png" see the difference ;-)