Jump to content

Recommended Posts

The guide here - http://forums.kleientertainment.com/topic/28021-getting-started-guides-tutorials-and-examples/ mentions only the following - Getting Started, Art, Creatures, Scripting, Sharing Your Mod, Sound, Translation and Misc. I want to learn how to create a new item. Where can I learn to do so?

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?

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 ) 

Edited by Polariche

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! :)

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.

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