Jump to content

Explain this line of code?


Recommended Posts

local handle = inst.sg.sg.actionhandlers[ACTIONS.PICK]handle.deststate = function(inst) return "doshortaction" end

I stumbled upon this line of code searching through old forum posts. It changes the animation of picking grass/twigs to the shorter animation of picking up an object off the ground. I am just wondering if someone could explain how this code does this, and if it could be reversed i.e. changing the picking up animation to the longer one of picking twigs/grass.

Link to comment
Share on other sites

local handle = inst.sg.sg.actionhandlers[ACTIONS.PICK]handle.deststate = function(inst) return "doshortaction" end

I stumbled upon this line of code searching through old forum posts. It changes the animation of picking grass/twigs to the shorter animation of picking up an object off the ground. I am just wondering if someone could explain how this code does this, and if it could be reversed i.e. changing the picking up animation to the longer one of picking twigs/grass.

 

 

"doshortaction" is a quick pickup-animation, "dolongaction" is the fiddley-faddley animation. You can't make it even longer using this method, I don't think.

What I'd do: add a workable component, reset it to "2" every time regrown, requires you to harvest twice. You need moderate madhacking skills to do that.

Link to comment
Share on other sites

local handle = inst.sg.sg.actionhandlers
handle.deststate 

Mostly curious what those two lines mean.

 

The code I posted in the OP makes long actions (grass harvesting), get replaced by the short animation, I am trying to replace the short animation with the longer one.

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