Jump to content

Recommended Posts

Hihi, posting this outside of another post hoping for a bit of help

Me and Chestworth are currently trying to make a mod that adds new materials to the statues(/chesspieces). The code works so far, letting you place 3 new materials onto the potter's wheel, and the new statues are able to be crafted and interacted with.

Only issue is that the new statues and materials when placed on the wheel are invisible. I'm not sure where the problem is stemming from, any help is greatly appreciated!

SculptMaterials.zip

Link to comment
https://forums.kleientertainment.com/forums/topic/168289-invisble-statues/
Share on other sites

image.png.6d309544fa320185c23f3e36ff56345d.png

On 8/24/2025 at 5:52 PM, FerniFrenito said:

If after throwing it you can still pick up the object the yeah, maybe the bank. I'll tell you how (I think) it works.

On your Spriter it should look like this:

image.png.0970059f1ee5b670340742f4119d6e6e.png

then make sure that when you start your don't starve (and don't have the "ANIM" folder) it does this with your scml name file:

image.png.b71f5e4d3d5ea9817c8c6851af003529.png

Next, check that there's a .zip file in the same folder as your scml file. Open it, and it should look like this:

image.png.16e05581cd001dcb1f7c5ec24e42ee7d.png

Then in the code put the name that appears as "root" in the animation.xml file

    inst.AnimState:SetBank("hunterhat_BANK")
    inst.AnimState:PlayAnimation("idle")

and in the game:

image.png.d4bbc4c8f4b9ae6358c0c1a2d05810aa.png

The problem is in 

inst.AnimState:SetBank("chesspiece")
inst.AnimState:SetBuild("swap_chesspiece_"..PIECES[pieceid].name.."_marble")
inst.AnimState:PlayAnimation("idle")

local function SetMaterial(inst, materialid)
	inst.materialid = materialid
	local build = GetBuildName(inst.pieceid, materialid)
    inst.AnimState:SetBuild(build)

	inst.components.lootdropper:SetLoot({MATERIALS[materialid].prefab})

	inst.components.symbolswapdata:SetData(build, "swap_body")

    local inv_image_suffix = (materialid ~= nil and MATERIALS[materialid].inv_suffix) or ""
    inst.components.inventoryitem:ChangeImageName("chesspiece_"..PIECES[inst.pieceid].name..inv_image_suffix)
end

To be honest, I didn't analyze the code much, but what's certain is that they're setting up the banks and builds incorrectly. In SetBuild(), they should specify the name of the .zip file containing the animation, and in SetBank(), specify the animation root (as explained in the quote). Although I don't know if it's necessary to set PlayAnimation("BUILD"), I think it is, but sometimes setting idle has helped.

They should come up with code that sets the correct build and bank for each sculpture (in fact, knowing this, they could put all the new sculptures in a single .scml file and, therefore, in a single .zip; that would solve the SetBuild problem, and they'd only have to worry about SetBank).

  • Thanks 1

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