Jump to content

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


Recommended Posts

  • 1 month later...

I tried following this for crew icons on the ship management screen. The only folder under gui in my game data is portraits, so I made the atlas and labelled it "CrewIcons.png" because I wasn't sure what to label it. All the images are 42x42. The images are saved as "crew_male_aumaua_e_s.png" for example. I want Ponamu to have a different picture instead of "crew_male_aumaua_d_s.png" so I change "d" to "e" under "IconTextureSmall" and it doesn't work. I tried it with the directory in the code, then without as above, still red x. Atlas is under override/gui/icons/items/crew/atlases. What am I doing wrong?

Link to comment
Share on other sites

  • 2 weeks later...
On 8/5/2019 at 6:10 PM, Grape_You_In_The_Mouth said:

What is the directory for ability icons when we install as Bmac says?  None of the mods use any atlases so maybe it's impossible?

 

The obvious answer works: 

 

gui/icons/abilities/your_icon_name_here.png

but can there be only one atlas?  Still don't know.

i had mixed results with a folder in my override/my_mod/gui/icons/abilities/my_icon_L.jpg and my_icon_S.jpg
i was using a grimoire as my test and while being dragged between slots, the large icon loads normally.

While accessing the spellbook section, in the upper left corner of the spellbook, the circle image also displays a small version of the icon.

 

HOWEVER, when the grimoire is either slotted on Aloth (or any other wizard) or stuck in inventory (personal or group) the icon reverts to a big red X on white square.

 

This partial success/failure confounds me, though I admit I skipped the Atlas step in this version.

 

my previous attempts with the Atlas method of 2 icons, large and small, were met with no icon at all. I feel as if the fact that at least some of my icons showed up some of the time, means there's more going on than I understand.

  • Like 1
Link to comment
Share on other sites

  • 5 months later...
On 7/25/2018 at 8:31 PM, BMac said:

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

Thank you very much for this. I've no idea what that Sprite Packer does that's special, but it fixed my problem :) WoohoO!

Link to comment
Share on other sites

  • 4 weeks later...
  • 11 months later...

Mintpenguin

I tried following this for crew icons on the ship management screen. The only folder under gui in my game data is portraits, so I made the atlas and labelled it "CrewIcons.png" because I wasn't sure what to label it.

... What am I doing wrong?

Answer: name something like "ItemIcons.png", not "CrewIcons.png" or whatever. The rest is as in the lesson, the size of the icons is 42x42.

Also, don't forget to fix the reference to the image name in the sailor data ("IconTextureSmall":"gui/icons/items/crew/crew_sailor_name_s.png").
Directly in the game file PillarsOfEternityII_Data\exported\design\gamedata\ships.gamedatabundle, or by transferring only its data to a separate file of the form "CRW_sailor_name.gamedatabundle" in the override folder.
For example - this is what the contents of "CRW_Nia.gamedatabundle" look like in my override folder:

Spoiler

{"GameDataObjects":[{"$type":"Game.GameData.ShipCrewMemberData, Assembly-CSharp","DebugName":"CRW_Nia","ID":"6fddcf5c-dfec-494f-9ea9-24dab429fbed","Components":[{"$type":"Game.GameData.ShipCrewMemberDataComponent, Assembly-CSharp","CrewPrefab":"prefabs/characters/poe2_npcs/00_ship/npc_crew_nia.prefab","CharacterStatsID":"1b3130be-924c-4b37-b6bd-01ce0eccc5a7","VisibilityConditions":{"Conditional":{"Operator":0,"Components":[]}},"HireCost":600,"BaseWage":1,"BaseFood":1,"BaseDrink":1,"OverrideSailorTales":0,"DefaultTraits":[{"JobType":"None","CrewTraitID":"abd4a293-6f64-4fac-9f65-a90f64c18942"},{"JobType":"Captain","CrewTraitID":"abd4a293-6f64-4fac-9f65-a90f64c18942"},{"JobType":"Boatswain","CrewTraitID":"d98a17b5-4656-4d46-80bf-4f5fede7baf2"},{"JobType":"Navigator","CrewTraitID":"abd4a293-6f64-4fac-9f65-a90f64c18942"},{"JobType":"Helmsman","CrewTraitID":"d98a17b5-4656-4d46-80bf-4f5fede7baf2"},{"JobType":"Deckhand","CrewTraitID":"d98a17b5-4656-4d46-80bf-4f5fede7baf2"},{"JobType":"Cannoneer","CrewTraitID":"a7b2af32-9891-43c3-92e4-885af959d1e8"},{"JobType":"Cook","CrewTraitID":"abd4a293-6f64-4fac-9f65-a90f64c18942"},{"JobType":"Surgeon","CrewTraitID":"abd4a293-6f64-4fac-9f65-a90f64c18942"},{"JobType":"Reserve","CrewTraitID":"abd4a293-6f64-4fac-9f65-a90f64c18942"}],"PersonalityIDs":["b234acc6-6f9c-451e-a9c0-ffeccffe4828","88a2aa77-9338-41b6-b4eb-b568b5c6b124"],"Portrait":"gui/portraits/player/female/female_human_g_sm.png"},{"$type":"Game.GameData.ItemComponent, Assembly-CSharp","DisplayName":-1,"DescriptionText":-1,"DescriptionTextTactical":-1,"FilterType":"ShipCrew","InventoryAudioEventListID":"6fbbc9f9-24d0-47d0-b6a1-b356c63e04df","IsQuestItem":"false","IsIngredient":"false","IsCurrency":"false","IsAdventuringItem":"false","IsJunk":"false","CanSellForFullValue":"false","MaxStackSize":1,"NeverDropAsLoot":"false","CanBePickpocketed":"true","IsUnique":"false","Value":0,"IconTextureSmall":"gui/icons/items/crew/crew_female_human_g42_s.png","IconTextureLarge":"","PencilSketchTexture":"","InspectOnUseButton":[],"IsPlaceholder":"false"},{"$type":"Game.GameData.DataScriptEventComponent, Assembly-CSharp","Scripts":[{"Event":"OnItemCollected","Script":{"Conditional":{"Operator":0,"Components":[]},"Scripts":[{"Data":{"FullName":"Void IncrementGlobalValue(String, Int32)","Parameters":["n_Crew_Members_Acquired","1"],"Flags":"","UnrealCall":"","FunctionHash":-1523024033,"ParameterHash":-1913166645},"Conditional":{"Operator":0,"Components":[]}}]}},{"Event":"OnItemCollected","Script":{"Conditional":{"Operator":0,"Components":[{"$type":"OEIFormats.FlowCharts.ConditionalCall, OEIFormats","Data":{"FullName":"Boolean IsGlobalValue(String, Operator, Int32)","Parameters":["n_Crew_Members_Acquired","EqualTo","1"],"Flags":"","UnrealCall":"","FunctionHash":901380568,"ParameterHash":-1486594725},"Not":false,"Operator":0}]},"Scripts":[{"Data":{"FullName":"Void TriggerQuestAddendum(Guid, Int32)","Parameters":["e97ceb7b-764d-462c-a5a6-25e51def2cd4","1"],"Flags":"","UnrealCall":"","FunctionHash":-1488074066,"ParameterHash":-932143800},"Conditional":{"Operator":0,"Components":[]}}]}},{"Event":"OnItemCollected","Script":{"Conditional":{"Operator":0,"Components":[{"$type":"OEIFormats.FlowCharts.ConditionalCall, OEIFormats","Data":{"FullName":"Boolean IsGlobalValue(String, Operator, Int32)","Parameters":["n_Crew_Members_Acquired","EqualTo","2"],"Flags":"","UnrealCall":"","FunctionHash":901380568,"ParameterHash":-1486594722},"Not":false,"Operator":0}]},"Scripts":[{"Data":{"FullName":"Void TriggerQuestAddendum(Guid, Int32)","Parameters":["e97ceb7b-764d-462c-a5a6-25e51def2cd4","2"],"Flags":"","UnrealCall":"","FunctionHash":-1488074066,"ParameterHash":-932143797},"Conditional":{"Operator":0,"Components":[]}}]}},{"Event":"OnItemCollected","Script":{"Conditional":{"Operator":0,"Components":[{"$type":"OEIFormats.FlowCharts.ConditionalCall, OEIFormats","Data":{"FullName":"Boolean IsGlobalValue(String, Operator, Int32)","Parameters":["n_Crew_Members_Acquired","EqualTo","3"],"Flags":"","UnrealCall":"","FunctionHash":901380568,"ParameterHash":-1486594723},"Not":false,"Operator":0}]},"Scripts":[{"Data":{"FullName":"Void TriggerQuestAddendum(Guid, Int32)","Parameters":["e97ceb7b-764d-462c-a5a6-25e51def2cd4","3"],"Flags":"","UnrealCall":"","FunctionHash":-1488074066,"ParameterHash":-932143798},"Conditional":{"Operator":0,"Components":[]}}]}},{"Event":"OnItemCollected","Script":{"Conditional":{"Operator":0,"Components":[{"$type":"OEIFormats.FlowCharts.ConditionalCall, OEIFormats","Data":{"FullName":"Boolean IsGlobalValue(String, Operator, Int32)","Parameters":["n_Crew_Members_Acquired","EqualTo","4"],"Flags":"","UnrealCall":"","FunctionHash":901380568,"ParameterHash":-1486594728},"Not":false,"Operator":0}]},"Scripts":[{"Data":{"FullName":"Void TriggerQuestAddendum(Guid, Int32)","Parameters":["e97ceb7b-764d-462c-a5a6-25e51def2cd4","4"],"Flags":"","UnrealCall":"","FunctionHash":-1488074066,"ParameterHash":-932143803},"Conditional":{"Operator":0,"Components":[]}}]}}]}]}]}

 

Edited by Gigaveter
Link to comment
Share on other sites

  • 10 months later...

Hi not sure you are are going to be seeing this comment and can direct me to how to do something similar but with the character creation icons.  

 

I have a draft mod that does not load a PNG file into the "Culture and Backgrounds" section of the character creation menu (everything else functions). 

 

    {
      "$type": "Game.GameData.BackgroundGameData, Assembly-CSharp",
      "DebugName": "Herbalist",
      "ID": "06e1778d-b0f9-4cce-a0e1-119f8c85014c",
      "Components": [
        {
          "$type": "Game.GameData.BackgroundComponent, Assembly-CSharp",
          "DisplayName": 6601,
          "SummaryText": 1225,
          "DescriptionText": 6701,
          "Icon": "gui/icons/gamesystems/background_herbalist_1.png",
          "SkillsList": [
            {
              "SkillID": "1b26af87-fd19-4dc6-9380-4f5cec7aefd5", //alchemy duh
              "Value": 4
            },
            {
              "SkillID": "9c7962b8-bf69-4670-ba67-acc86a09fca8", //survival seems reasonable
              "Value": 2
            }
          ]
        }
      ]
    }

I created a custom PNG, (also attached), but the image does not load into the menu, everything else works though 

background_herbalist_1.png

Link to comment
Share on other sites

On 4/19/2023 at 4:22 AM, Duncra said:

Hi not sure you are are going to be seeing this comment and can direct me to how to do something similar but with the character creation icons.  

 

I have a draft mod that does not load a PNG file into the "Culture and Backgrounds" section of the character creation menu (everything else functions). 

 

    {
      "$type": "Game.GameData.BackgroundGameData, Assembly-CSharp",
      "DebugName": "Herbalist",
      "ID": "06e1778d-b0f9-4cce-a0e1-119f8c85014c",
      "Components": [
        {
          "$type": "Game.GameData.BackgroundComponent, Assembly-CSharp",
          "DisplayName": 6601,
          "SummaryText": 1225,
          "DescriptionText": 6701,
          "Icon": "gui/icons/gamesystems/background_herbalist_1.png",
          "SkillsList": [
            {
              "SkillID": "1b26af87-fd19-4dc6-9380-4f5cec7aefd5", //alchemy duh
              "Value": 4
            },
            {
              "SkillID": "9c7962b8-bf69-4670-ba67-acc86a09fca8", //survival seems reasonable
              "Value": 2
            }
          ]
        }
      ]
    }

I created a custom PNG, (also attached), but the image does not load into the menu, everything else works though 

background_herbalist_1.png

Unfortunately the atlas for "gamesystems" doesn't seem to be set up for modding in the same as those for "items" and "abilities". 

Which limit the possibilities to the existing sprites.

 

Edited by Kvellen
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...