Jump to content

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.

post-113185-0-81443800-1532558653.png

post-113185-0-37461300-1532558362.png

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.

post-113185-0-58331000-1532558365.png

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.

post-113185-0-33373000-1532558355.png

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

post-113185-0-35917500-1532558359.png

gamedataicons.png

ingame.png

largeicons.png

sspacker.png

gamedatalargeicon.png

Edited by BMac
update images for forum update
  • Like 7

Share this post


Link to post
Share on other sites

Share this post


Link to post
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 

Share this post


Link to post
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 

Share this post


Link to post
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?

Share this post


Link to post
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?

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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 

Share this post


Link to post
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

Share this post


Link to post
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 

Share this post


Link to post
Share on other sites

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


"Art and song are creations but so are weapons and lies"

"Our worst enemies are inventions of the mind. Pleasure. Fear. When we see them for what they are, we become unstoppable."

Share this post


Link to post
Share on other sites

Thanks!


"Art and song are creations but so are weapons and lies"

"Our worst enemies are inventions of the mind. Pleasure. Fear. When we see them for what they are, we become unstoppable."

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...