Jump to content

[HELP] Custom equippable amulet


Recommended Posts

Hello to anyone who is reading that, so I don't even know where to start to be honest. I've looked trough prefabs and found amulet one, since I haven't looked in modding for years(and when I did it was basically change some values here and there), I have no idea how the file should look for like one custom amulet, the file has a few listed in there.

Anyhow I was wondering if someone can help me with making custom amulet, the one that will lower sanity drain from dusk and night, I'll attach the original file I found.

The other question I have is where exactly and how exactly do I get sprites of amulet(s) from the base game, so I can resprite over them and then pack it back together. Thanks for help beforehand.

 

TL;DR How to make lua file for just a singe amulet and how to make proper anim set for it

 

Dunno if what I've said is understandable but ask questions right away I'll do my best to answer, also sorry for my grammar, English is not my native language 

amulet.lua

Link to comment
Share on other sites

Ok I can get ingame now, so I've made some progress YAY! Thought not without some problems

I have an inventory image, but I cannot see item appearing on character nor see it on ground and minimap...

 

UPD: ok now it is visible only on my character, but I have no idea how to fix it not being visible on ground

Fawkesbetacleared2.rar

Edited by mypp32
Link to comment
Share on other sites

How did you get your amulet to show on the side view of the character?  I could never figure that out and it is only visible when facing down.  I can't unzip any of your files,  it gives me an error.

For your amulet not showing on the ground I assume you have 

inst.AnimState:SetBank("myamulet")
inst.AnimState:SetBuild("myamulet")
inst.AnimState:PlayAnimation("idle")

Not sure if it is needed but I also have a separate anim file for the equipped image and image on ground.

Link to comment
Share on other sites

On 6/24/2018 at 5:16 AM, Wolf_EX said:

How did you get your amulet to show on the side view of the character?  I could never figure that out and it is only visible when facing down.  I can't unzip any of your files,  it gives me an error.

For your amulet not showing on the ground I assume you have 


inst.AnimState:SetBank("myamulet")
inst.AnimState:SetBuild("myamulet")
inst.AnimState:PlayAnimation("idle")

Not sure if it is needed but I also have a separate anim file for the equipped image and image on ground.

Well tbh I just exported the anims from "...\Don't Starve Together\data\anim\amulets.zip" and "...\Don't Starve Together\data\anim\torso_amulets.zip"  with the help of ktools and command line. After I exported em, I edited the scml, to fit only 1 amulet (mine). As far as getting it to work, I had troubles with 

owner.AnimState:OverrideSymbol("swap_body", "torso_fawkesamulet", "swap_body")

and still don't really understand what exactly I have done but I've changed the the last argument to "torso_fawkesamulet" so it became

owner.AnimState:OverrideSymbol("swap_body", "torso_fawkesamulet", "torso_fawkesamulet")

as well as placed exported images on root folder of the mod? and it just worked.

Amuletexported.rar

fawkesamulet.lua

as for item not being shown on ground, I still have no idea, since I do have two separate anims folder and has a code there

    inst.AnimState:SetBank("fawkesamulet")
    inst.AnimState:SetBuild("fawkesamulet")
    inst.AnimState:PlayAnimation("anim")

 

Edited by mypp32
Link to comment
Share on other sites

I don't know if it is just me but I can't extract any of your .rar files.  Gives me error that it's in an unknown format or damaged.  I don't know why the format would be unknown since I use winrar.  Can you try uploading as a .zip?

 

Quote

as for item not being shown on ground, I still have no idea, since I do have two separate anims folder and has a code there

You should only have 1 anim folder with all the .zip created from spriter in it.

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