Jump to content

[Tutorial] Adding New Icons (v2.0.0+)


Recommended Posts

You should be familiar with the Modding Basic Concepts tutorial before following this one.

 

In this tutorial, I'm going to show you how to add a new icon for a custom ability or item in Pillars of Eternity II: Deadfire. You must have Deadfire version 2.0.0 or later to use this functionality.

I've already created game data objects for two custom items, and I've created two PNG icons for each: a small 42x42 icon, which will be used to show the item in an inventory slot, and a large 100x100 icon, which will be used to show the item when it's being dragged, and in the detailed inspection window.  Items require both icons, but abilities only need the small 42x42 icon.

To allow the game to load my large icon, all I have to do is put it in my mod folder at "/gui/icons/items".  I can then reference it in the IconTextureLarge property of my item's game data.

JSON data showing the ItemTextureLarge property filled in.

Image showing the proper file location for large icons files.

Small icons work a little differently. They need to be packed into an atlas, which is a single image file that has multiple images in it. The free tool SpriteSheetPacker can build an atlas for you from your collection of small icon images.

Download SpriteSheetPacker and run it.  Select "Add Images" and find all the small icon images you want to include in your mod.

Click the "..." next to "Output Image".  Browse to your mod folder.  Create a new folder in it called "atlases".  In this folder, save the image as "ItemIcons.png". If you were adding abilities, the icons for those would need to be in a separate atlas, also in this folder, called "SpellAbilityIcons.png".

Ensure "Generate Map?" is enabled.

Screenshot of the SpriteSheetPacker interface.

Now click "Build Sprite Sheet".  This will create the atlas image, and also a file called "ItemIcons.txt", which tells the game about each separate icon in the atlas.

Finally, I can add a reference to the small icon in the IconTextureSmall property of my item's game data.  Because the icon is in an atlas, this only needs the name of the sprite. It doesn't need any directory information.

JSON data showing the ItemTextureSmall property filled in.

That's it.  My new item now has custom icons to use in-game.

In-game screenshot showing that I have successfully stacked a penguin on top of a sword for some reason.

If you need some great-looking, stylistically-matching icon images for your items and abilities, you can use the ones from the first Pillars of Eternity:

gamedataicons.png

ingame.png

largeicons.png

sspacker.png

gamedatalargeicon.png

  • Like 9
Link to comment
Share on other sites

Link to comment
Share on other sites

Sticky this one

OK Fair warning has been applied

 

I'm gonna move the domain to https://perspak.com early Feb but will keep all content

 

There are reasons behind this move which basically boil down to unifying my release schedule

 

My friends are welcome to play (I'll set you up your own areas if you desire them)

 

Please note that this process is messy so may take a few weeks 

Link to comment
Share on other sites

If I read this correctly I can build a spritesheet and animate it?

 

This is inferred so lets imagine I've got a 256x256 cell spritesheet with 32 frames

 

Would this animate?

 

Don't imagine - I've got exactly that sheet

 

I can't upload as its licensed art

 

I'll give it a go when 2.0 drops then find a freebie to sheet

OK Fair warning has been applied

 

I'm gonna move the domain to https://perspak.com early Feb but will keep all content

 

There are reasons behind this move which basically boil down to unifying my release schedule

 

My friends are welcome to play (I'll set you up your own areas if you desire them)

 

Please note that this process is messy so may take a few weeks 

Link to comment
Share on other sites

@Bmac, is 4k required? If yes, would you consider allowing us to use smaller resolutions to avoid wasting empty space/memory?

 

Also, important question for me - is it possible to create atlas that can be used by multiple mods, separated in folders? Could be a matter of folder structure, for example

 

/override -> tonpix mods -> single icon atlas + folders for different mods, separated in folders?

Link to comment
Share on other sites

The atlas I created with 6 icons truncated down in size and was 6kb.

 

Also, I put the atlas in the folder of mod-one and called them from mod-two and they worked.

Seems like you can share an atlas.

Edited by Armakoir
  • Like 1
Link to comment
Share on other sites

The atlas I created with 6 icons truncated down in size and was 6kb.

 

Also, I put the atlas in the folder of mod-one and called them from mod-two and they worked.

Seems like you can share an atlas.

 

Ah, you told me on slack, sorry I forgot about it. Truncated means what?

Link to comment
Share on other sites

Sticky this one

I've linked it in the Useful Information sticky - just trying (perhaps overzealously) to avoid a ballooning sticky section

 

If I read this correctly I can build a spritesheet and animate it?

 

This is inferred so lets imagine I've got a 256x256 cell spritesheet with 32 frames

 

Would this animate?

No, we don't support animating these icons. We'll only use the single image specified in IconTextureSmall.

 

@Bmac, is 4k required? If yes, would you consider allowing us to use smaller resolutions to avoid wasting empty space/memory?

The 4k value is a maximum.  The atlas that's produced by SpriteSheetPacker will only be as big as it needs to be, as noted by Armakoir.

 

Also, important question for me - is it possible to create atlas that can be used by multiple mods, separated in folders? Could be a matter of folder structure, for example

Yes, you can use icons from other mod folders.  You'll have to make sure the user installs both mods, of course.

  • Like 2
Link to comment
Share on other sites

Using the technique described in #1 is it possible to create icons that can be referenced in .stringtable files using the <sprite> element or is it limited to item/ability icons for now?

 

Edit: Using the Inline atlas (found in the game files) as a template didn't work - i.e. naming the new atlas Inline.png/Inline.txt - so I'm guessing it's not supported at the moment. :(

Edited by Spherical
  • Like 1

Editor and Designer
Enhanced User Interface
Nexus Mods | Steam Workshop

Link to comment
Share on other sites

Using the technique described in #1 is it possible to create icons that can be referenced in .stringtable files using the element or is it limited to item/ability icons for now?

 

Edit: Using the Inline atlas (found in the game files) as a template didn't work - i.e. naming the new atlas Inline.png/Inline.txt - so I'm guessing it's not supported at the moment. :(

Right, unfortunately the inline atlas needs to be packed via a different system (TextMesh Pro) that doesn't support dynamic loading at the moment.

Link to comment
Share on other sites

This needs a sticky!

  • Like 1

OK Fair warning has been applied

 

I'm gonna move the domain to https://perspak.com early Feb but will keep all content

 

There are reasons behind this move which basically boil down to unifying my release schedule

 

My friends are welcome to play (I'll set you up your own areas if you desire them)

 

Please note that this process is messy so may take a few weeks 

Link to comment
Share on other sites

Right, unfortunately the inline atlas needs to be packed via a different system (TextMesh Pro) that doesn't support dynamic loading at the moment.

 

 

A follow up question: would it maybe possible to add a few new icons then? Simple shapes would be nice but just having all available icons in black and white would go a long way. It shouldn't take too long to do, right?

Editor and Designer
Enhanced User Interface
Nexus Mods | Steam Workshop

Link to comment
Share on other sites

Sprite Sheets (they're dead easy)

 

OK - explaining this is NOT easy :(

 

Just tried...

Right

 

See https://apuzzle.net/

 

This shows a dynamic sheet - it's something I have in alpha. This WON'T work on mobile - you need a mouse as it's Drag + Drop

 

Solve the jigsaw!

 

All puzzles involve one big image I split into portions - switch difficultly to make it hard (anything above Easy is hard actually)

 

Note that this is an Alpha - i.e. buggy.

 

That's a SpriteSheet in action...

 

I will do a spite sheet tutorial once I've finished my current obligations

 

Don't worry - I'll make it easy. You won't be able to do what I do with dynamic (complex math) but you'll understand how things work

Someone remind me...

Edited by peardox

OK Fair warning has been applied

 

I'm gonna move the domain to https://perspak.com early Feb but will keep all content

 

There are reasons behind this move which basically boil down to unifying my release schedule

 

My friends are welcome to play (I'll set you up your own areas if you desire them)

 

Please note that this process is messy so may take a few weeks 

Link to comment
Share on other sites

  • 2 weeks later...

Can one replace existing game icons by placing them in the override folder (with the correct name, of course)?

check also OP , cuz they also required atlases not only a raw png

Link to comment
Share on other sites

Hi, I have a problem with the icon for the proficiency, it seems it's not exposed to be used with the atlas.

 

When leveling and I reach the proficiency panel it results in a X.

I also tried putting the image in mod/gui/icons/items/mypng.png, 42x42, but still X.

 

The other ability, the one with the bonuses it works in the other panels.

 

UoEnrQV.jpg

CzSyX91.jpg

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
×
×
  • Create New...