Jump to content

Help with code for item icon swap mod


Recommended Posts

I'm trying to swap the icons for these potions:

Potion of Merciless Gaze <--> Potion of Major Healing
Potion of Imperfect Arcane Reflection <--> Potion of Miraculous Healing

 

I tried the code below, but the icons are still the same in game. 

What did I do wrong?

{
“GameDataObjects”: [

{
      "$type": "Game.GameData.ConsumableGameData, Assembly-CSharp",
      "DebugName": "L2_Potion_of_merciless_gaze",
      "ID": "d796f43f-3f8b-43de-b872-121aa0fa5976",
      "Components": [
        {
          "$type": "Game.GameData.ItemComponent, Assembly-CSharp",
          "IconTextureSmall": "gui/icons/items/consumable/potion_of_deleterious_s.png",
          "IconTextureLarge": "gui/icons/items/consumable/potion_of_deleterious_l.png",
}]
}


{
      "$type": "Game.GameData.ConsumableGameData, Assembly-CSharp",
      "DebugName": "L4_Potion_of_imperfect_arcane_reflection",
      "ID": "14460e14-899e-4655-aef1-42b1c0557df7",
      "Components": [
        {
          "$type": "Game.GameData.ItemComponent, Assembly-CSharp",
          "IconTextureSmall": "gui/icons/items/consumable/potion_of_spirit_shield_s.png",
          "IconTextureLarge": "gui/icons/items/consumable/potion_of_spirit_shield_l.png",
}]
}


{
      "$type": "Game.GameData.ConsumableGameData, Assembly-CSharp",
      "DebugName": "L7_Potion_of_major_healing",
      "ID": "b1e1dab0-9c6f-4cb4-8a01-139b490ed57f",
      "Components": [
        {
          "$type": "Game.GameData.ItemComponent, Assembly-CSharp",
          "IconTextureSmall": "gui/icons/items/consumable/potion_of_major_recovery_s.png",
          "IconTextureLarge": "gui/icons/items/consumable/potion_of_major_recovery_l.png",
}]
}


{
      "$type": "Game.GameData.ConsumableGameData, Assembly-CSharp",
      "DebugName": "L9_Potion_of_miraculous_healing",
      "ID": "6a2b7318-7dd0-48c2-ad49-315ddfa36d02",
      "Components": [
        {
          "$type": "Game.GameData.ItemComponent, Assembly-CSharp",
          "IconTextureSmall": "gui/icons/items/consumable/potion_of_major_endurance_s.png",
          "IconTextureLarge": "gui/icons/items/consumable/potion_of_major_endurance_l.png",
}]
}


]
}

 

Edited by saltynoodles
  • Hmmm 1
Link to comment
Share on other sites

You seem to be using the wrong quotation mark character in the first line, try changing from

“GameDataObjects”: [

to

"GameDataObjects": [

____

"Components": [
{
          "$type": "Game.GameData.ItemComponent, Assembly-CSharp",
          "IconTextureSmall": "gui/icons/items/consumable/potion_of_deleterious_s.png",
          "IconTextureLarge": "gui/icons/items/consumable/potion_of_deleterious_l.png",
}]

I'm not certain how permissive Obsidian is at loading JSON, but it's good in general to leave out the trailing comma of the last line of an array or object. Like this:

"Components": [
{
          "$type": "Game.GameData.ItemComponent, Assembly-CSharp",
          "IconTextureSmall": "gui/icons/items/consumable/potion_of_deleterious_s.png",
          "IconTextureLarge": "gui/icons/items/consumable/potion_of_deleterious_l.png"
}]

____

 

{
      "$type": "Game.GameData.ConsumableGameData, Assembly-CSharp",
      "DebugName": "L4_Potion_of_imperfect_arcane_reflection",
	  [...]
}

You'll also need commas after each GameDataObject end bracket (except the last one):

{
      "$type": "Game.GameData.ConsumableGameData, Assembly-CSharp",
      "DebugName": "L4_Potion_of_imperfect_arcane_reflection",
	  [...]
},

Hope that does it!

Edited by Noqn
  • Like 1
  • Gasp! 1
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...