Jump to content

Invisible object/animations


orlyx

Recommended Posts

Not much to go by, go here to post your don't starve together mod problems (judging by the picture it has elements that don't starve doesn't have):

https://forums.kleientertainment.com/forum/79-dont-starve-together-mods-and-tools/

For your item missing in your crafting tab you'd have to declare this diamond like so:

local diamond= Ingredient( "diamond", 1 ) --you need to declare a mod item as a crafting item
diamond.atlas = "images/inventoryimages/diamond.xml" --WARNING part of code is a guess but that diamond part is more or less how you add it
local diamond_cutter_recipe = AddRecipe("diamond_cutter", { Ingredient("gears", 1),  Ingredient("goldnugget", 8), diamond}, nil, TECH.SCIENCE_TWO, nil, nil, nil, nil, nil, "images/inventoryimages/diamond_cutter.xml")

I can't guess for your swap animations cause there's not much to go by.

Link to comment
Share on other sites

Well theres a number of problems besides the swap animations being invisible. So i'll just give a idea more or less on what's missing and such:

local function onequip(inst, owner) --reference
    owner.AnimState:OverrideSymbol("swap_object", "swap_diamond_cutter", "diamond_cutter") --here is the main problem the second argument is for the equip images(aka swap_item), the third argument however is where the build name from the scml file should be.

local function fn(Sim) --reference

local anim = inst.entity:AddAnimState() --reference
    inst.entity:AddNetwork() --this is missing makes the item tradable to other players and npcs if you want to

anim:SetBank("diamond_cutter") --this one should be the build name in the scml
    anim:SetBuild("diamond_cutter") --this one should more or less remain the same as the prefab name

inst:AddTag("sharp")--reference
    if not TheWorld.ismastersim then --used heavily in dst
   return inst
end

inst.entity:SetPristine() --idk what it does but it keeps a lot of the weird errors from poping up

Last notes if it doesn't go through the build name in the scml is different than the scml's name. The build name is when you open spriter up and see the name under animations, there will be the name and a drop down with idle, build or something like that. I only checked the diamond cutter as some of the others aren't included (modmain wise) and well its your mod so your work.

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