Jump to content

[Solved] How to add animation (swap build) to existing prefab?


Recommended Posts

I'm working on adding moon shrooms to mushroom planters. I created an anim based on mushroom_farm_red_build.zip, and am trying to get the planter to display it when moon shrooms are planted. Unfortunately, I haven't had any luck getting it to display. I put this into the prefab postinit:

table.insert(GLOBAL.Prefabs["mushroom_farm"].assets, Asset("ANIM", "anim/mushroom_farm_moon_build.zip"))

And I've confirmed that DoMushroomOverrideSymbol is doing the equivalent of:

inst.AnimState:OverrideSymbol("swap_mushroom", "mushroom_farm_moon_build", "swap_mushroom")

However, the planter continues to look like it's empty. What is actually required here? (And is there a better way to add the asset?)

Edited by Bumber64
Link to comment
Share on other sites

I think there's something wrong with my anim, too. Textures in atlas-0.tex are three times larger than in red_build's, despite using edited files obtained from it by using krane.

Edit: Seems like my anim works. If I name it "mushroom_farm_red_build.zip", it will replace the red version with everything looking good. Still can't figure out how to make it work for moon shrooms.

Issue is "Could not find anim build FROMNUM".

Another Edit: Figured it out. Just put it in a list called Assets in modmain.

Edited by Bumber64
Link to comment
Share on other sites

Hi, Are you still here?

I have same problem when I tried to make animation for my swap item. I still wonder how can you solve the problem when the exist swap_redlantern.zip in the original file isnt have anim.bin so I can't using ktool to convert them into spritter to using like a template. I've tried to, using other anim.bin to convert them but when it done, I don't understand it.

So I do you know about this situation. Thanks!

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