Jump to content

Recommended Posts

Hey Guys,

 

I try to create a costum item.

 

The item can mine, digg, hammer but without the default animation and that is the point.

 

I would use no animation for that.

 

Did you have ideas?

 

 

Edit: I can't handle with spriter O.O

 

Greetings

 

Marie

Hey Guys,

 

I try to create a costum item.

 

The item can mine, digg, hammer but without the default animation and that is the point.

 

I would use no animation for that.

 

Did you have ideas?

 

 

Edit: I can't handle with spriter O.O

 

Greetings

 

Marie

 

AnimState... or something. So without animation, the AnimState would be idle?

@EulenMarie, do you want to be able to chop from a distance with the no animation?

Or do you want to get in chopping distance before doing the action?

 

Also, do you want to hold click to perform many instant chops or do you want to click many times?

@EulenMarie, do you want to be able to chop from a distance with the no animation?

Or do you want to get in chopping distance before doing the action?

 

Also, do you want to hold click to perform many instant chops or do you want to click many times?

 

from normal (axe/pickaxe etc) distance with no animation.

 

"Also, do you want to hold click to perform many instant chops or do you want to click many times?"

 

 

Instant chops sounds good :grin:

Edited by EulenMarie

@EulenMarie, put this in modmain:

local ACTIONS = GLOBAL.ACTIONSAddStategraphPostInit("wilson", function(sg)	for k, v in pairs({ ACTIONS.CHOP, ACTIONS.MINE, ACTIONS.DIG, ACTIONS.HAMMER }) do		local old = sg.actionhandlers[v].deststate		sg.actionhandlers[v].deststate = function(inst)			if inst.components.inventory:EquipHasTag("instant_action") then				inst:PerformBufferedAction()				return "idle"			end			return old(inst, action)		end	endend)AddStategraphPostInit("wilson_client", function(sg)	for k, v in pairs({ ACTIONS.CHOP, ACTIONS.MINE, ACTIONS.DIG, ACTIONS.HAMMER }) do		local old = sg.actionhandlers[v].deststate		sg.actionhandlers[v].deststate = function(inst)			if inst.replica.inventory:EquipHasTag("instant_action") then				inst:PerformPreviewBufferedAction()				return "idle"			end			return old(inst, action)		end	endend)

Then add

inst:AddTag("instant_action")

on the prefab of the tools you want to make instant.

@EulenMarie, put this in modmain:

local ACTIONS = GLOBAL.ACTIONSAddStategraphPostInit("wilson", function(sg)	for k, v in pairs({ ACTIONS.CHOP, ACTIONS.MINE, ACTIONS.DIG, ACTIONS.HAMMER }) do		local old = sg.actionhandlers[v].deststate		sg.actionhandlers[v].deststate = function(inst)			if inst.components.inventory:EquipHasTag("instant_action") then				inst:PerformBufferedAction()				return "idle"			end			return old(inst, action)		end	endend)AddStategraphPostInit("wilson_client", function(sg)	for k, v in pairs({ ACTIONS.CHOP, ACTIONS.MINE, ACTIONS.DIG, ACTIONS.HAMMER }) do		local old = sg.actionhandlers[v].deststate		sg.actionhandlers[v].deststate = function(inst)			if inst.replica.inventory:EquipHasTag("instant_action") then				inst:PerformPreviewBufferedAction()				return "idle"			end			return old(inst, action)		end	endend)

Then add

inst:AddTag("instant_action")

on the prefab of the tools you want to make instant.

 

whahahaha thats cool thanks XD

 

But I think from distance is better ^^ I had to see it first.

And the instant slower? Its very very instant :p

 

 

Edited by EulenMarie

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