Jump to content

Recommended Posts

Which is the definition of AnimState.OverrideSymbol?

1.AnimState:OverrideSymbol(symbol, build, overridesymbolname)  -- prefabs/cookpot.lua

2.AnimState:OverrideSymbol(symbol, atlasname, imagename)  -- prefabs/minisign.lua

When I used it to show a non-mod image, it worked:

cookpot.AnimState:OverrideSymbol("swap_cooked", "images/inventoryimages2.xml", "spear.tex")

But when I used it to show a mod image, it did not work:

cookpot.AnimState:OverrideSymbol("swap_cooked", "mods/mymodfolder/images/inventoryimages/mymoditem.xml", "mymoditem.tex")

I drew my mod item on a mini sign, but it was not shown.

6 hours ago, Rickzzs said:

Add this. Asset('ATLAS_BUILD',xml,256)

Maybe I didn't understand it correctly. It still did not work.

Now if my atlas file is "images/inventoryimages/mymoditem.xml", and image file is "images/inventoryimages/mymoditem.tex", what should I do?

Like this?

Asset("ATLAS_BUILD", "images/inventoryimages/mymoditem.xml", 256)

You need to add this asset into your mod'a Assets table in order to tell the Animation Manager to convert the xml into a build. Then minisign will show it. But I don't know how the minisign does so. It is typically like

Assets = {
  Asset("ATLAS_BUILD", "images/xxx_inventoryimages.xml", 256),
  Asset("ATLAS", "images/xxxp_inventoryimages.xml"),

 

Edited by Rickzzs
1 hour ago, Rickzzs said:

You need to add this asset into your mod'a Assets table in order to tell the Animation Manager to convert the xml into a build. Then minisign will show it. But I don't know how the minisign does so. It is typically like

Do I have to put it in the Assets table of modmain.lua? I put it in the assets table of a Prefab, but it was not shown by minisign.

Did you specify any of them?

1.inst.drawimageoverride

2.inst.components.inventoryitem.imagename and inst.components.inventoryitem.atlasname

3.Register it via RegisterInventoryItemAtlas(atlas,tex) and RegisterInventoryItemAtlas(atlas,hash(tex))

 

33 minutes ago, Rickzzs said:

2.inst.components.inventoryitem.imagename and inst.components.inventoryitem.atlasname

Only this. My items can be shown in the inventory bar. By the way, in what case is the 3 used?

3 hours ago, Rickzzs said:

If so, that's weird why minisign didn't show the icons, I might say I cannot know the cause then.

Thank you very much.

I already know why. Neither component drawable nor prefab minisign use resolvefilepath to resolve atlas. Minisign cannot show mod images if we do not modify them.

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