Jump to content

[GUIDE] About mod icons


Ultroman
 Share

Recommended Posts

What Are Mod Icons?

A mod icon is the image shown in the game when you see your mod in the list of mods.

1473955440_2021-01-2811_57_35-Clipboard.png.bc4b1c4537d0b3f5ac63e5a5a8a843a6.png 

How do I make a Mod Icon texture?

You make a normal PNG image, usually with transparency enabled, but if you want a solid block, nobody is stopping you. In order for the game to be happy, the image MUST be of power-of-two size, and preferably not too small. The most used size is 256x256, but I have also seen 128x128 and 512x512. I don't think it HAS to be square, so it might be possible to make it e.g. 128x256, as long as both values are still power-of-two, but there's no reason to do that. Stick to squares. Save it as a normal PNG.

Now you need to convert your image to a format that the game likes. It wants a DXT5 texture, I believe, but you shouldn't need to worry about that. Ktech in the KTools Package will help you do the conversion between PNG and TEX, both ways.

Name the new .TEX file modicon.tex.

How do I add the mod icon to my mod?

Now that you have your .TEX file, put it in the root of your mod folder, next to your modinfo.lua. Create a new text-file called "modicon.txt". We will be renaming it to modicon.xml after editing it! If you're confident with text editors, you can do whatever you want here, as long as you end up with a file called modicon.xml with one of the following lines of code in it.

It's supposed to look something like this for a 128x128 image:

<Atlas><Texture filename="modicon.tex" /><Elements><Element name="modicon.tex" u1="0.0078125" u2="0.9921875" v1="0.0078125" v2="0.9921875" /></Elements></Atlas>

and like this for a 256x256 image:

<Atlas><Texture filename="modicon.tex" /><Elements><Element name="modicon.tex" u1="0.00390625" u2="0.99609375" v1="0.00390625" v2="0.99609375" /></Elements></Atlas>

and like this for a 512x512 image:

<Atlas><Texture filename="modicon.tex" /><Elements><Element name="modicon.tex" u1="0.001953125" u2="0.998046875" v1="0.001953125" v2="0.998046875" /></Elements></Atlas>

The point is, you tell it which part of the TEX-file (image) it should read. The values are simply e.g. 1/128 and 127/128, respectively, or 1/256 and 255/256, respectively, so we tell it to read the whole image, except a 1-pixel border at the sides. I don't know exactly why. In several other instances when using textures, the atlas files simply use 0 and 1, but everyone seems to do this for mod icons, so...there we go. Now you also do it.

Just copy/paste the text from the example that fits your image size into your text-file, save it, and then rename it modicon.xml.

In your modinfo.lua, make sure to add (or if they're already there, update) these lines to tell the game where to find your mod icon:

icon_atlas = "modicon.xml"
icon = "modicon.tex"

The filenames are important to keep consistent, since they are directly referenced in both the modicon.xml file and the modinfo.lua file. You can name the modicon-files whatever you want, as long as you make sure that the references in those two files match the filenames and the extensions are correct.

That's it. More info on textures and skinning characters with them, check out this guide on the Steam Community or look at the tutorial sections at the top of the two Mods And Tools forums (link to DS Mods And Tools, and link to DST Mods And Tools).
 

Hope this helps. Also, if some of what I wrote is complete hogwash, please do tell me, so I can fix it :D It has been a long time since I worked with textures. This is just an old guide I touched up, because it was about to get archived.

Edited by Ultroman
  • Like 3
Link to comment
Share on other sites

4 hours ago, Leonidas IV said:

Simple tutorial on how to make a modicon:

Create your image in a multiple of 2, like 64, 128, 256, 512...

Create a folder called "images" inside your mod folder, put the image there and run the autocompiler. Is ready :)

Does png only scan inside images?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...