Jump to content

[SOLVED] Creating an item with changing/multiple inventory images?


Recommended Posts

Posted (edited)

Hey hey. I'm working on a character mod right now that includes a hat which changes depending on the current nightmare cycle, just like a Thulecite Medallion.

By referencing the medallion's code I've gotten the hat to change appearance when on the ground. However, the hat's inventory icon turns invisible when it tries to switch from its first sprite to the other two.

My guess is that I haven't set up the item's inventory icon atlas correctly to include the other two sprites, but I don't actually know how to do that. Does anyone have a mod with an item like this that I can look at, or know how to set something like this up? I'd prefer not to send my mod files unless absolutely necessary.

Thanks for reading.

Edited by Chesed
Link to comment
Share on other sites

Posted (edited)

After bashing my head against this on and off over a few days I decided to skip trying to understand how the Thulecite Medalion does it, and just used

Quote

inst.components.inventoryitem.atlasname = "images/inventoryimages/myprefab.xml"
    inst.components.inventoryitem:ChangeImageName("myprefab")

in conjuction with some if statements.

It's not as elegant as using the table and probably wasn't how I was supposed to do it, but I'm an artist, not a programmer, and I'm working under a deadline haha.

I'll leave this up in case it helps anyone in the future.

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