Jump to content

Please Help: Having trouble using Don't Starve Mod Tools


Recommended Posts

I am trying to make a mod that adds a custom item into the game. I currently have gotten the animations to work by using pre-existing animations as a base and just changing the art to my item and changing the build name. However, this method limits what kind of animations I can do and creates a lot of hassle if I want to change any are down the road. Because of this, I want to switch to making my own animations with spriter and have don't starve mod tools compile the files into the nice zip files that the game uses for animations. I tried this method before the method that I'm currently using but bailed because the don't starve mod tools was not creating the zip file correctly and I couldn't figure out what to do to fix it.    Attached is the mod file I'm making. the spriter files I tried using and their  respective failed animation zips are located in the exported sub folder.

Thanks in advance 

infinity gauntlet mod.zip

Link to comment
Share on other sites

Well right off the bat I can see one issue. 
image.png.b58df15313b2e8247771488757e50eec.png

There needs to be another folder in this one that contains the powerstone.png
Also remember that if you name the folder ground_powerstone that this

image.png.ffa3ddabb89694d44a2c69bc76061f91.png

and this
image.png.aa9dcd53231226540122dbdc5fec03ea.png

should also be named ground_powerstone instead of powerstone. Although it's not required, it makes it easier when editing this

 

inst.AnimState:SetBank("myprefab")
inst.AnimState:SetBuild("myprefab_build")
inst.AnimState:PlayAnimation("idle", true)

So that both "myprefab" and "myprefab_build" can just be "ground_powerstone"

If you're still having issues I can send you my exported file for something I recently made along with the lines of code referring to it.

Link to comment
Share on other sites

thank you for responding.

I have implemented the fixes that you mentioned in your post, but no luck. I thought that Dont Starve mod tools was supposed to automatically put the .zip it creates into your /anim  folder but it hasn't for me yet, so I moved it into the folder myself. still nothing.  

Screenshot (18).png

Screenshot (17).png

Screenshot (16).png

Screenshot (15).png

Screenshot (20).png

Link to comment
Share on other sites

Oh, no. Don't touch the zip it puts in the same folder as the scml file. I'm not sure what that's for but I don't think it's the same as what it's supposed to put in the anim folder.

Here, put this folder I've attached that's in a zip file in your exported folder and replace the images for the item and swap_item (keeping the names the same), also rename every instance of fehenrybook to powerstone

Then change the code in your prefab file to this

 

local assets =
{
	-- Animation files used for the item.
	Asset("ANIM", "anim/powerstone.zip")

	-- Inventory image and atlas file used for the item.
    Asset("ATLAS", "images/inventoryimages/powerstone.xml"),
    Asset("IMAGE", "images/inventoryimages/powerstone.tex"),
}

local function onequip(inst, owner)
    owner.AnimState:OverrideSymbol("swap_object", -- Symbol to override.
    	"powerstone", -- Animation bank we will use to overwrite the symbol.
    	"swap_item") -- Symbol to overwrite it with.
    owner.AnimState:Show("ARM_carry") 
    owner.AnimState:Hide("ARM_normal") 
end

local function onunequip(inst, owner) 
    owner.AnimState:Hide("ARM_carry") 
    owner.AnimState:Show("ARM_normal") 
end

local function spacegem_reticuletargetfn()
    return Vector3(ThePlayer.entity:LocalToWorldSpace(5, 0.001, 0)) -- raised this off the ground a touch so it wont have any z-fighting with the ground biome transition tiles.
end

local function init()
	local inst = CreateEntity()

	inst.entity:AddTransform()
	inst.entity:AddAnimState()
    inst.entity:AddSoundEmitter()
    inst.entity:AddNetwork()

    MakeInventoryPhysics(inst)

    inst.AnimState:SetBank("powerstone")
    inst.AnimState:SetBuild("powerstone")
    inst.AnimState:PlayAnimation("idle", true)

    inst:AddTag("sharp")

   if not TheWorld.ismastersim then
        return inst
    end

    inst.entity:SetPristine()

    inst:AddComponent("weapon")
    inst.components.weapon:SetDamage(1200)
    
    inst:AddComponent("armor")
    inst.components.armor:InitIndestructible(.9999)
    inst:AddComponent("inspectable")
    
    inst:AddComponent("inventoryitem")
    inst.components.inventoryitem.atlasname = "images/inventoryimages/powerstone.xml"
    inst.components.inventoryitem.imagename = "powerstone"
    
    inst:AddComponent("equippable")
    inst.components.equippable:SetOnEquip(onequip)
    inst.components.equippable:SetOnUnequip(onunequip)
    inst.components.equippable.walkspeedmult = 1.25    
        
	inst:AddComponent("reticule")
    inst.components.reticule.targetfn = spacegem_reticuletargetfn
    inst.components.reticule.ease = true
    
    inst:AddComponent("blinkstaff")

    MakeHauntableLaunch(inst)

    return inst
end
return  Prefab("common/inventory/powerstone", init, assets, prefabs)

 

 

Make sure you let the autocompiler run until it's done and closes itself!

stuff.zip

Link to comment
Share on other sites

Ok I used your .zip in my exported folder and changed every instance of fehenrybook I could find, as well as the code in the places that you pointed out, but still no luck. I did refactor a lot of my code since my original post, but I don't think that is the issue (I could be completely wrong though). Either way I start up the game, let the autocompiler run fully, and load up a world, but it crashes while loading up, saying it didn't find anim/powerstone.zip in any files.  I ran it twice with the same error occurring both times. 

mod.zip

Screenshot (22).png

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...