Jump to content

How to make a new item in Don't Starve


Recommended Posts

So you want advice on scripting.  If only that guide you looked at had a section on this.. if only it had examples..  if only it had an examples link in the scripting section.. 

 

OH WAIT..  it does.

 

prob solved?

 

So API examples is what I'm looking for?

Link to comment
Share on other sites

This guide teaches you how to create hand-held items(axe, pickaxe, shovel, etc) from scratch

 

If you are going to make a generic item without making it equipable, just skip the "creating the swappable build" part and delete these codes:

 

    local function OnEquip(inst, owner)        owner.AnimState:OverrideSymbol("swap_object", "swap_myitem", "swap_myitem")        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 
    inst:AddComponent("equippable")    inst.components.equippable:SetOnEquip( OnEquip )    inst.components.equippable:SetOnUnequip( OnUnequip ) 

Link to comment
Share on other sites

This guide teaches you how to create hand-held items(axe, pickaxe, shovel, etc) from scratch

 

If you are going to make a generic item without making it equipable, just skip the "creating the swappable build" part and delete these codes:

 

    local function OnEquip(inst, owner)        owner.AnimState:OverrideSymbol("swap_object", "swap_myitem", "swap_myitem")        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 
    inst:AddComponent("equippable")    inst.components.equippable:SetOnEquip( OnEquip )    inst.components.equippable:SetOnUnequip( OnUnequip ) 

 

Thanks a lot! Just what I was looking for. Quite helpful! :)

Link to comment
Share on other sites

Try reading the don't starve game directory.

C:\Program Files (x86)\Steam\SteamApps\common\dont_starve\data 

(the path will be something like that.)

The most things are under the "scripts\prfabs" directory.

Maybe read some of those scripts.

Find something in the game that is similar to what you are trying to create and copy it.

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