Jump to content

Can someone help me out with importing my sprites into a mod?


Recommended Posts

Hello everyone, I am new to modding so I apologize in advance. I currently have this code in the modmain:

AddPrefabPostInit("panflute", function(inst) 
    inst.AnimState:SetBank("shell") 
    inst.AnimState:SetBuild("shell")

    if not GLOBAL.TheWorld.ismastersim then 
        return
    end
    
    inst.components.inventoryitem.atlasname = "images/shell.xml"
    inst.components.inventoryitem.imagename = "shell" 
end)

This code is supposed to override the sprites for the Pan Flute, and it does, however it doesn't show my sprites, instead it's just blank. I think the problem is that my sprites don't seem to work. I have a folder called "images" and have two images of my PNG, one TEX and one a XML, both named "shell". I have noticed that every image in a mod has two files, a XML and a TEX file. Can someone explain to me why this is and how I can properly convert my PNG file to both of these? Because my images don't seem to work. Is there something wrong with my code or my PNG? I just want my sprite to properly replace the Pan Flute one as a test. Here is my PNG by the way. Thanks.

Rainy Shell Bell.png

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...