Jump to content

Requesting Help with Modding a New Ability


Recommended Posts

I have been trying my luck with creating new characters for Don't Starve Together by using Dleowolf's "Extended Sample Character" template, so far(and after a lot of effort) I managed to create a couple of characters who simply have readjusted stats, but now I've brought myself into adding an ability for my latest character(pictured below) which is recovering sanity from breaking boulders and chopping down trees. The only issue so far is I lack any form of coding skills and neither have I underwent any programming classes to be able to fully comprehend the lua code, if anything I've surprised myself that I made it this far. And so I've come humbly to this great forum to seek aid with my work.

1392276040_preview_golem1.jpg

Link to comment
Share on other sites

Going to eyeball it and say try this:

local function workcheck(inst)

if inst.AnimState:IsCurrentAnimation("chop_loop") or inst.AnimState:IsCurrentAnimation("pickaxe_loop") then

inst.components.sanity:DoDelta(1) --+1 sanity

end

end

 

inst:DoPeriodicTask(5, workcheck, nil, inst) --check every five seconds

the last piece of code goes into the master_postinit the other outside of it. If it works or not I'm not sure but try it out.

Link to comment
Share on other sites

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
 Share

×
  • Create New...