W.Williams Posted January 26, 2016 Share Posted January 26, 2016 Hi all, I've a problem with my items icons, they don't display on my inventory but I don't understand why... module MilitaryItems{imports{Base}/*********** Drainable ***********/item CamelbackUCPFull{Type = Drainable,DisplayName = Camelback (UCP),Icon = CamelbackUCP,Weight = 2.5,ReplaceOnDeplete = CamelbackUCPEmpty,UseWhileEquipped = false,UseDelta = 0.03,ReplaceOnUseOn = WaterSource-CamelbackUCPFull,IsWaterSource = true,CanStoreWater = true}item CamelbackUCPEmpty{Type = Normal,DisplayName = Empty Camelback (UCP),Icon = CamelbackUCPEmpty,Weight = 0.2,ReplaceOnUseOn = WaterSource-CamelbackUCPFull,CanStoreWater = true}}All my icons are 32x32 in PNG format in the repository "mymods/media/textures"and named with "Item_" before my object. I think the problem comes from my images because when i take picture from other mod it works... This is an example :http://hpics.li/3bf1b03 Best regards Link to comment Share on other sites More sharing options...
fluffe9911 Posted January 26, 2016 Share Posted January 26, 2016 You got to add item before it for the actual picture name example it would be Item_CamelbackUCPEmpty hope this helps Link to comment Share on other sites More sharing options...
W.Williams Posted January 26, 2016 Author Share Posted January 26, 2016 I try but it doesn't help, when i use original game picture it works, like the Water bottle, but with my image not... May be it's because I use GIMP and not photoshop Link to comment Share on other sites More sharing options...
fluffe9911 Posted January 26, 2016 Share Posted January 26, 2016 you sure cause if you rename the image to item_youritemname it should work just look at the hydrocraft or any mod that adds stuff images for examples Link to comment Share on other sites More sharing options...
W.Williams Posted January 26, 2016 Author Share Posted January 26, 2016 Yes but you only rename the image and i've already do that but i've a big interrogation point in my inventory instead of my image... Link to comment Share on other sites More sharing options...
MountainSage Posted January 26, 2016 Share Posted January 26, 2016 Hi all, I've a problem with my items icons, they don't display on my inventory but I don't understand why... module MilitaryItems{imports{Base}/*********** Drainable ***********/item CamelbackUCPFull{Type = Drainable,DisplayName = Camelback (UCP),Icon = CamelbackUCP,Weight = 2.5,ReplaceOnDeplete = CamelbackUCPEmpty,UseWhileEquipped = false,UseDelta = 0.03,ReplaceOnUseOn = WaterSource-CamelbackUCPFull,IsWaterSource = true,CanStoreWater = true}item CamelbackUCPEmpty{Type = Normal,DisplayName = Empty Camelback (UCP),Icon = CamelbackUCPEmpty,Weight = 0.2,ReplaceOnUseOn = WaterSource-CamelbackUCPFull,CanStoreWater = true}}All my icons are 32x32 in PNG format in the repository "mymods/media/textures"and named with "Item_" before my object. I think the problem comes from my images because when i take picture from other mod it works... This is an example :http://hpics.li/3bf1b03 Best regards You also need to load the texture into memory which may be why you're having issues, while ones from other mods are working fine.Here's an example of doing this in my own mod.--##########--## Init ##--##########require "Items/SuburbsDistributions";--#############--## Sprites ##--#############TTBSprites = {}TTBSprites.getSprites = function() --Reading Traits getTexture("Item_TTBBasicRead.png"); getTexture("Item_TTBIntermediateRead.png"); getTexture("Item_TTBAdvancedRead.png");end--##################--## Distribution ##--################## --Reading Traits table.insert(SuburbsDistributions["all"]["shelves"].items, "TTB.BasicRead"); table.insert(SuburbsDistributions["all"]["shelves"].items, 0.3); table.insert(SuburbsDistributions["all"]["shelves"].items, "TTB.IntermediateRead"); table.insert(SuburbsDistributions["all"]["shelves"].items, 0.2); table.insert(SuburbsDistributions["all"]["shelves"].items, "TTB.AdvancedRead"); table.insert(SuburbsDistributions["all"]["shelves"].items, 0.1); table.insert(SuburbsDistributions["bookstore"]["all"].items, "TTB.BasicRead"); table.insert(SuburbsDistributions["bookstore"]["all"].items, 0.5); table.insert(SuburbsDistributions["bookstore"]["all"].items, "TTB.IntermediateRead"); table.insert(SuburbsDistributions["bookstore"]["all"].items, 0.3); table.insert(SuburbsDistributions["bookstore"]["all"].items, "TTB.AdvancedRead"); table.insert(SuburbsDistributions["bookstore"]["all"].items, 0.1); table.insert(SuburbsDistributions["Schoolbag"].items, "TTB.BasicRead"); table.insert(SuburbsDistributions["Schoolbag"].items, 1.0); table.insert(SuburbsDistributions["Schoolbag"].items, "TTB.IntermediateRead"); table.insert(SuburbsDistributions["Schoolbag"].items, 1.0); table.insert(SuburbsDistributions["Schoolbag"].items, "TTB.AdvancedRead"); table.insert(SuburbsDistributions["Schoolbag"].items, 0.5);Events.OnPreMapLoad.Add(TTBSprites.getSprites);You need to make the game add your sprites into an array that is loaded when starting a game.The reason other images from other mods are working is likely because they are already being loaded into memory by their own respective mods, so they work when your own mod tries to use the image. Try modifying the above example to work with what you need and give this a shot, the bit you're concerned with is the event at the bottom and the section handling sprites. EDIT: This goes by the way into .../media/lua/server/... Link to comment Share on other sites More sharing options...
W.Williams Posted January 26, 2016 Author Share Posted January 26, 2016 I've try your method but it doesn't work either require 'Items/SuburbsDistributions';MISprites = {}MISprites.getSprites = function()getTexture("Item_AsssaultBackpackMulticam.png");getTexture("Item_AsssaultBackpackUCP.png");getTexture("Item_CamelbackMulticam.png");getTexture("Item_CamelbackMulticamEmpty.png");getTexture("Item_CamelbackUCP.png");getTexture("Item_CamelbackUCPEmpty.png");getTexture("Item_CarryallMulticam.png");getTexture("Item_CarryallUCP.png");getTexture("Item_GhillieSuitBottom.png");getTexture("Item_GhillieSuitTop.png");getTexture("Item_HelmetACH.png");getTexture("Item_IOTVMulticam.png");getTexture("Item_IOTVUCP.png");getTexture("Item_KitbagMulticam.png");getTexture("Item_KitbagUCP.png");getTexture("Item_KnifeCaseMulticam.png");getTexture("Item_KnifeCaseUCP.png");getTexture("Item_LegHolsterMulticam.png");getTexture("Item_LegHolsterUCP.png");getTexture("Item_MICH2000HelmetMulticam.png");getTexture("Item_MICH2000HelmetUCP.png");getTexture("Item_MilitaryKnife.png");getTexture("Item_PlateCarrierMulticam.png");getTexture("Item_PlateCarrierUCP.png");getTexture("Item_SFHelmetGreen.png");getTexture("Item_SFHelmetTan.png");getTexture("Item_SharpeningStone.png");getTexture("Item_ShirtMulticam.png");getTexture("Item_ShirtUCP.png");getTexture("Item_TacticalBackpackMulticam.png");getTexture("Item_TacticalBackpackUCP.png");getTexture("Item_TacticalBootsBlack.png");getTexture("Item_TacticalBootsTan.png");getTexture("Item_TrousersMulticam.png");getTexture("Item_TrousersUCP.png");endEvents.OnPreMapLoad.Add(MISprites.getSprites);I have a display like this in my inventory : http://www.hostingpics.net/viewer.php?id=759971test.png Link to comment Share on other sites More sharing options...
MountainSage Posted January 26, 2016 Share Posted January 26, 2016 I've try your method but it doesn't work either I have a display like this in my inventory : http://www.hostingpics.net/viewer.php?id=759971test.png Hmm...What about if the items you're testing have entries in distribution?Throwing stuff at the wall here and seeing what sticks but try this and see if it's still the same?require 'Items/SuburbsDistributions';MISprites = {}MISprites.getSprites = function()getTexture("Item_AsssaultBackpackMulticam.png");getTexture("Item_AsssaultBackpackUCP.png");getTexture("Item_CamelbackMulticam.png");getTexture("Item_CamelbackMulticamEmpty.png");getTexture("Item_CamelbackUCP.png");getTexture("Item_CamelbackUCPEmpty.png");getTexture("Item_CarryallMulticam.png");getTexture("Item_CarryallUCP.png");getTexture("Item_GhillieSuitBottom.png");getTexture("Item_GhillieSuitTop.png");getTexture("Item_HelmetACH.png");getTexture("Item_IOTVMulticam.png");getTexture("Item_IOTVUCP.png");getTexture("Item_KitbagMulticam.png");getTexture("Item_KitbagUCP.png");getTexture("Item_KnifeCaseMulticam.png");getTexture("Item_KnifeCaseUCP.png");getTexture("Item_LegHolsterMulticam.png");getTexture("Item_LegHolsterUCP.png");getTexture("Item_MICH2000HelmetMulticam.png");getTexture("Item_MICH2000HelmetUCP.png");getTexture("Item_MilitaryKnife.png");getTexture("Item_PlateCarrierMulticam.png");getTexture("Item_PlateCarrierUCP.png");getTexture("Item_SFHelmetGreen.png");getTexture("Item_SFHelmetTan.png");getTexture("Item_SharpeningStone.png");getTexture("Item_ShirtMulticam.png");getTexture("Item_ShirtUCP.png");getTexture("Item_TacticalBackpackMulticam.png");getTexture("Item_TacticalBackpackUCP.png");getTexture("Item_TacticalBootsBlack.png");getTexture("Item_TacticalBootsTan.png");getTexture("Item_TrousersMulticam.png");getTexture("Item_TrousersUCP.png");table.insert(SuburbsDistributions["all"]["shelves"].items, "MilitaryItems.CamelbackUCPFull");table.insert(SuburbsDistributions["all"]["shelves"].items, 0.0);table.insert(SuburbsDistributions["all"]["shelves"].items, "MilitaryItems.CamelbackUCPEmpty");table.insert(SuburbsDistributions["all"]["shelves"].items, 0.0);endEvents.OnPreMapLoad.Add(MISprites.getSprites); Link to comment Share on other sites More sharing options...
W.Williams Posted January 26, 2016 Author Share Posted January 26, 2016 I've already this part, but it takes 500 lines, and it's complicated to display this here. What did you use to create your icons ? Link to comment Share on other sites More sharing options...
MountainSage Posted January 26, 2016 Share Posted January 26, 2016 I've already this part, but it takes 500 lines, and it's complicated to display this here.Hmmm, ok.Well I guess let's work down all the possibilities, we'll find the cause eventually. Ok so first up, can you take a screenshot of the contents of the textures folder inside your mod or specifically the icons for two items you linked in your first post as shown inside the folder? Maybe it's a filename thing or perhaps even a folder directory?Your textures folder is: .../ mods/YOUR_MOD_NAME/media/textures/... right?And the filenames are "Item_<name>.png" right? (Item_CamelbackUCP.png for example) Link to comment Share on other sites More sharing options...
W.Williams Posted January 26, 2016 Author Share Posted January 26, 2016 Yes, this is the folder with all the textures 32x32 and Item_myobjectmod http://www.hostingpics.net/viewer.php?id=405239example.png Link to comment Share on other sites More sharing options...
MountainSage Posted January 26, 2016 Share Posted January 26, 2016 Yes, this is the folder with all the textures 32x32 and Item_myobjectmod http://www.hostingpics.net/viewer.php?id=405239example.pngHmm, that looks to be alright.Ok, how about this.Does this happen with all items in your mod? I notice some of the stuff in your mod item list looks like it might be clothing?I could be wrong, but as I understand it Zomboid doesn't have explicit icons for clothing but instead generates one based on stuff like colour settings off a template image it has? Again, a bit off the wall, but since it seems like your textures are set up right, being loaded AND are set right in items, it has to be something a bit unusual. Do you have any non-clothing items in your mod at the moment that we could test an icon on perhaps?If not, try this and see if the same thing happens with a really generic item/************************ITEMS************************/item MIDebugItem { Weight = 0.5, Type = Normal, DisplayName = MI Icon Debug Object, Icon = CamelbackUCP, } Link to comment Share on other sites More sharing options...
W.Williams Posted January 26, 2016 Author Share Posted January 26, 2016 it happens with all items in my mods and yes somes items and clothing and works with this code :item ShirtUCP{BodyLocation = Top,Type = Clothing,SpriteName = Blouse,Palettes = Blouse_White,PalettesStart = Blouse_,Temperature = 12,Weight = 0.8,DisplayName = Shirt (UCP),Icon = ShirtUCP,}And i have several items that are normal like Helmet but they don't work... item HelmetACH{Type = Normal,DisplayName = ACH Helmet,Weight = 0.2,Icon = HelmetACH,}But when i take an icon from an other mod (e.g ORGM), my icons appears on the inventory, i really think, the problem are my icons... Link to comment Share on other sites More sharing options...
MountainSage Posted January 26, 2016 Share Posted January 26, 2016 Damn, was hoping we could try figure this out but I'm all out of ideas.Might be the pictures in the end after all. Your pictures are 32x32 and 32 bit depth PNGs though so those are supposed to work I thought. Sorry I couldn't be of more help Link to comment Share on other sites More sharing options...
W.Williams Posted January 26, 2016 Author Share Posted January 26, 2016 Which software do you have to create your icons ? It's may be GIMP, it's the only possibility... Link to comment Share on other sites More sharing options...
MountainSage Posted January 26, 2016 Share Posted January 26, 2016 Mine were made in photoshop by a friend of mine.32x32, 32 bit depth, png Link to comment Share on other sites More sharing options...
W.Williams Posted January 26, 2016 Author Share Posted January 26, 2016 I created my icons, 32x32 and 72 ppp in png, now i manually create them with 32 ppp. Thanks for your help guys and especially you MoutainSage ! EDIT : It works for one icon... and not anymore MountainSage 1 Link to comment Share on other sites More sharing options...
MountainSage Posted January 26, 2016 Share Posted January 26, 2016 I've finally found the problem !!I created my icons, 32x32 and 72 ppp in png, now i manually create them with 32 ppp. Thanks for your help guys and especially you MoutainSage ! Huzzah!Good luck with the rest of the mod! Link to comment Share on other sites More sharing options...
W.Williams Posted January 26, 2016 Author Share Posted January 26, 2016 Holllllyyyy sh......After many try, it doesn't work.I install Photoshop to see if the problem comes from GIMPIf someone knows how i can create icon perfectly, i take Best regards Link to comment Share on other sites More sharing options...
fluffe9911 Posted January 27, 2016 Share Posted January 27, 2016 Make sure there isn't any faded textures don't think the game supports nonsolid colors Link to comment Share on other sites More sharing options...
W.Williams Posted January 27, 2016 Author Share Posted January 27, 2016 I confirm the problem comes from my icons textures, may be they contains nosolid colors but i don't know how to fix that Link to comment Share on other sites More sharing options...
W.Williams Posted January 27, 2016 Author Share Posted January 27, 2016 Ok i found the solution for ONE icon, when i reduced my image at the size of 32 x 32, i made an cubic interpolation (better quality) but it creates some nonsolid colors... Link to comment Share on other sites More sharing options...
fluffe9911 Posted January 27, 2016 Share Posted January 27, 2016 Np lol Link to comment Share on other sites More sharing options...
W.Williams Posted January 27, 2016 Author Share Posted January 27, 2016 Ok this is the FINAL ANSWER, when you use GIMP for your icons you have to manually set pixel height and width (32 x 32) /!\ EXREMELY IMPORTANT /!\ The resolution as to be 32 pixel/in on the axe "X" and 32 pixel/in on the axe "Y" and you can have a linear interpolation (better quality) or none interpolation. Thank you all ! Link to comment Share on other sites More sharing options...
Berdryn Posted October 12, 2016 Share Posted October 12, 2016 Your issue shouldn't be coming from the graphic program. I've found that 32 width is needed but I am working on a graphic now that has 64 px height. 72 ppi (points per inch) is all you need for screen work. Anything more is wasted, causing file bloat and numerous other issues. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now