• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Help with icon not showing for item

projectmayhem

New member
Doing a little customizing to tweak the game more towards my preferences and one of the first steps I want to do is cause flint to be mined from rocks and use the flint to make arrow heads, which then are used to make arrows.

I've got all the coding in, but the flint has a white box with a "?" in it for the icon, but the arrow head icon shows up just fine. I'm probably missing something simple, but I've stared at it long enough that I decided to reach out for help.
Here is the main append in the items.xml to add both items. I copy/pasted Oil Shales item and changed the material to Mstone for both. Once in game, the Arrow Head icon shows fine, but the Flint doesnt. I saw in another mod they were using the CustomIcon tag, so I tried that as well and still no dice.
I've got both icons in the \UIAtlases\ItemIconAtlas path. First one is named resourceArrowhead_icon.png and the second one is named resourceFlint_icon.png

Can anyone spot what is causing the flint not to load? I've watched the console while loading and it doesnt give any errors. Both files are 360x360. Arrow Head is 90 kbs and Flint is 20 kbs.
If there is more info you need that I am missing just let me know, I am going to continue staring at it.

Code:
<append xpath="/items">
<item name="resourceFlint">
	<property name="HoldType" value="45"/>
	<property name="CustomIcon" value="resourceFlint_icon"/>
	<property name="Meshfile" value="#Other/Items?Misc/sackPrefab.prefab"/>
	<property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab"/>
	<property name="Material" value="Mstone"/>
	<property name="Stacknumber" value="6000"/> 
	<property name="EconomicValue" value="10"/>
	<property name="EconomicBundleSize" value="10"/>
	<property name="Group" value="Resources"/>
</item>
<item name="resourceArrowhead">
	<property name="HoldType" value="45"/>
	<property name="CustomIcon" value="resourceArrowhead_icon"/>
	<property name="Meshfile" value="#Other/Items?Misc/sackPrefab.prefab"/>
	<property name="DropMeshfile" value="#Other/Items?Misc/sack_droppedPrefab.prefab"/>
	<property name="Material" value="Mstone"/>
	<property name="Stacknumber" value="6000"/> 
	<property name="EconomicValue" value="10"/>
	<property name="EconomicBundleSize" value="10"/>
	<property name="Group" value="Resources"/>
</item>
</append>
 
I figured out a solution, but not the reason behind the problem. I re-named my flint icon, then copy/pasted the arrow head icon. Copied the image from the renamed flint to the copied arrow head. Renamed the copied arrow head to resourceFlint_icon.png and it works fine.
the file size for the flint did jump from 20 kb to 140 kb , so I'm assuming it's something to do with the image file not really being a png even though the file extension was png.

 
Last edited by a moderator:
My number one screw-up with icons has always been failure to note what I typed in upper or lower case in the icon names. This is case sensitive in 7d2d, and if it doesn't match exactly, you don't get the icon. My number two screw-up would probably be failing to set the custom icon and getting a different icon because the item in question extended something that did have an icon set.

If I recall correctly, if your icon name matches your item exactly, it should use that icon by default (in your case, you'd delete the "_icon" part of the filename). I don't really do it, but it's the way things work in the vanilla game.

 
Im currently having the same issue. Changed all image paths for CasinoCoin.png to Zedbucks.png and out image in image icons with exsactly same image propertys. Size, alpha and so on...

Image showing black but everything else works. Dukes now show as ZedBucks but no image. Very annoying.

Ive also tired the back door of making a mod folder like suggested...nothing..

Whats this localisation file because from what i can see its jist quest text? 

 
Im currently having the same issue. Changed all image paths for CasinoCoin.png to Zedbucks.png and out image in image icons with exsactly same image propertys. Size, alpha and so on...

Image showing black but everything else works. Dukes now show as ZedBucks but no image. Very annoying.

Ive also tired the back door of making a mod folder like suggested...nothing..

Whats this localisation file because from what i can see its jist quest text? 


The localization file is just for the game text and the ability to translate it into different languages.

Make sure you have the mod folder structure setup correctly if you are adding new icons.  This is how I had it setup prior to A21.  I haven't added new icons since this mod so I don't know if the structure has changed.

image.png

And this is an example of a custom localization file - this is for my mod where I removed schematics and created new magazines to unlock them

Key,File,Type,UsedInMainMenu,NoTranslate,english,Context / Alternate Text,german,spanish,french,italian,japanese,koreana,polish,brazilian,russian,turkish,schinese,tchinese
craftingMeleeModsName,progression,Attribute,,,Melee Mods,,,,,,,,,,,,,
craftingMeleeModsDesc,progression,Attribute,,,Reading Melee Mods magazines will unlock mods for melee weapons,,,,,,,,,,,,,
craftingRangedModsName,progression,Attribute,,,Ranged Weapon Mods,,,,,,,,,,,,,
craftingRangedModsDesc,progression,Attribute,,,Reading Ranged Weapon Mods magazines will unlock mods for ranged weapons,,,,,,,,,,,,,
craftingToolModsName,progression,Attribute,,,Tool Mods,,,,,,,,,,,,,
craftingToolModsDesc,progression,Attribute,,,Reading Tpp; Mods magazines will unlock mods for tools,,,,,,,,,,,,,
craftingArmorModsName,progression,Attribute,,,Armor Mods,,,,,,,,,,,,,
craftingArmorModsDesc,progression,Attribute,,,Reading Armor Mods magazines will unlock mods for armor,,,,,,,,,,,,,
craftingHighTechName,progression,Attribute,,,High Tech,,,,,,,,,,,,,
craftingHighTechDesc,progression,Attribute,,,Reading High Tech magazines will unlock tech,,,,,,,,,,,,,




If I didn't have this in the mod, the new magazines would display craftingMeleeMods instead of Melee Mods.

 
The localization file is just for the game text and the ability to translate it into different languages.

Make sure you have the mod folder structure setup correctly if you are adding new icons.  This is how I had it setup prior to A21.  I haven't added new icons since this mod so I don't know if the structure has changed.

View attachment 34094

And this is an example of a custom localization file - this is for my mod where I removed schematics and created new magazines to unlock them

Key,File,Type,UsedInMainMenu,NoTranslate,english,Context / Alternate Text,german,spanish,french,italian,japanese,koreana,polish,brazilian,russian,turkish,schinese,tchinese
craftingMeleeModsName,progression,Attribute,,,Melee Mods,,,,,,,,,,,,,
craftingMeleeModsDesc,progression,Attribute,,,Reading Melee Mods magazines will unlock mods for melee weapons,,,,,,,,,,,,,
craftingRangedModsName,progression,Attribute,,,Ranged Weapon Mods,,,,,,,,,,,,,
craftingRangedModsDesc,progression,Attribute,,,Reading Ranged Weapon Mods magazines will unlock mods for ranged weapons,,,,,,,,,,,,,
craftingToolModsName,progression,Attribute,,,Tool Mods,,,,,,,,,,,,,
craftingToolModsDesc,progression,Attribute,,,Reading Tpp; Mods magazines will unlock mods for tools,,,,,,,,,,,,,
craftingArmorModsName,progression,Attribute,,,Armor Mods,,,,,,,,,,,,,
craftingArmorModsDesc,progression,Attribute,,,Reading Armor Mods magazines will unlock mods for armor,,,,,,,,,,,,,
craftingHighTechName,progression,Attribute,,,High Tech,,,,,,,,,,,,,
craftingHighTechDesc,progression,Attribute,,,Reading High Tech magazines will unlock tech,,,,,,,,,,,,,




If I didn't have this in the mod, the new magazines would display craftingMeleeMods instead of Melee Mods.
Im not this clued up and still learning... But let's take a step back a bit.... Ive changed the CasinoCoin.png image to a different image, same sizw,specs and file name and it shows blank?

 
Im not this clued up and still learning... But let's take a step back a bit.... Ive changed the CasinoCoin.png image to a different image, same sizw,specs and file name and it shows blank?


Okay, let me share my code so you can see what I have done and what you need to do (I added the old item back into my game so I would be confident nothing has changed since the last time I added it to the game):

        <item name="drinkJarGrainAlcohol">
            <property name="HoldType" value="3"/>
            <property name="Meshfile" value="@:Other/Items/Food/bottled_waterPrefab.prefab"/>
            <property name="DropMeshfile" value="@:Other/Items/Misc/sack_droppedPrefab.prefab"/>
            <property name="Material" value="Mglass"/>
            <property name="CustomIcon" value="drinkJarGrainAlcohol"/>
            <property name="Weight" value="10"/>
            <property name="Stacknumber" value="10"/> <!-- STK resource -->
            <property name="EconomicValue" value="48"/>
            <property name="Group" value="Chemicals,CFChemicals"/>
        </item>




Since this is not a vanilla item, I need to add a property in there CustomIcon.  The value is the name of the image file it needs to find to apply to this item.

Then I have the image file in the folder structure in my mod and it should show up in the game.

 
Okay, let me share my code so you can see what I have done and what you need to do (I added the old item back into my game so I would be confident nothing has changed since the last time I added it to the game):

        <item name="drinkJarGrainAlcohol">
            <property name="HoldType" value="3"/>
            <property name="Meshfile" value="@:Other/Items/Food/bottled_waterPrefab.prefab"/>
            <property name="DropMeshfile" value="@:Other/Items/Misc/sack_droppedPrefab.prefab"/>
            <property name="Material" value="Mglass"/>
            <property name="CustomIcon" value="drinkJarGrainAlcohol"/>
            <property name="Weight" value="10"/>
            <property name="Stacknumber" value="10"/> <!-- STK resource -->
            <property name="EconomicValue" value="48"/>
            <property name="Group" value="Chemicals,CFChemicals"/>
        </item>




Since this is not a vanilla item, I need to add a property in there CustomIcon.  The value is the name of the image file it needs to find to apply to this item.

Then I have the image file in the folder structure in my mod and it should show up in the game.
First off thank you for sticking with me and helping me with this issue, youre a legend and ill have to get ur server...


IT WORKED!!!!!!!!!!!!!!!

Ok this is the code i did...


 

<item name="oldCash">
    <property name="HoldType" value="45"/>
    <property name="Tags" value="dukes"/>
    <property name="Meshfile" value="@:Other/Items/Misc/sackPrefab.prefab"/>
    <property name="DropMeshfile" value="@:Other/Items/Misc/sack_droppedPrefab.prefab"/>
    <property name="Material" value="MoldCash"/>
    <property name="FuelValue" value="1"/>
<property name="CustomIcon" value="newoldCash"/>
    <property name="Weight" value="1"/>
    <property name="Stacknumber" value="10000"/>
    <property name="EconomicValue" value="7"/>
    <property name="Group" value="Resources"/>
    <property name="SoundPickup" value="oldcash_grab"/>
    <property name="SoundPlace" value="oldcash_place"/>
</item>

<item name="Money">
    <property name="Extends" value="oldCash"/>
    <property name="CustomIcon" value="newoldCash"/>
    <property name="CustomIconTint" value="57,255,20"/>
    <property name="Stacknumber" value="5000"/>
    <property name="Tags" value="dukes"/>
    <property name="SellableToTrader" value="true"/>
</item>




path to Mods > ZYCLON_CASH > ULAtlases > ItenIconAtlases > (newoldCash.png)


Still showing (539) oldCash when i hover over it and is called old cash lol but im sure i can fix that some how

oldCash.png

 
Last edited by a moderator:
Just as a reminder to what Cranberry posted, if you name your icon png file the exact same as the item, you don't have to have the CustomIcon line, the game will just recognize it and use it for the item since the names match. That's why you'll notice a lot of vanilla items don't use it but still have icons.

Only time you have to use that property is if the names don't match, or if extending from an item that has the CustomIcon property and you need to override it.

And also some people see icons in the ItemIcons folder in the game install and try using them but sometimes they don't work. This is because if an item isn't currently using that icon you can't reference it in xml alone without actually copying the icon to your own mod. The icons in that folder aren't actually being used, the game has them baked into an atlas that it loads from. So some of the old icons that still remain like the blessed metal mod and others would have to be copied to your mod in order to reference them.

 
Just as a reminder to what Cranberry posted, if you name your icon png file the exact same as the item, you don't have to have the CustomIcon line, the game will just recognize it and use it for the item since the names match. That's why you'll notice a lot of vanilla items don't use it but still have icons.

Only time you have to use that property is if the names don't match, or if extending from an item that has the CustomIcon property and you need to override it.

And also some people see icons in the ItemIcons folder in the game install and try using them but sometimes they don't work. This is because if an item isn't currently using that icon you can't reference it in xml alone without actually copying the icon to your own mod. The icons in that folder aren't actually being used, the game has them baked into an atlas that it loads from. So some of the old icons that still remain like the blessed metal mod and others would have to be copied to your mod in order to reference them.




Well ive dont it now and its working. I can see the picture.

Problem is its not showing for anyone in the server. Im the only one who can see the icon, its blank to everyone else. Werid 

So annoying!

Any sugestions?

 
Well ive dont it now and its working. I can see the picture.

Problem is its not showing for anyone in the server. Im the only one who can see the icon, its blank to everyone else. Werid 

So annoying!

Any sugestions?
Everyone needs to have the mod installed on their end also

 
Back
Top