Doctor Donna Posted September 1, 2015 Share Posted September 1, 2015 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 Link to comment Share on other sites More sharing options...
UnionGaming Posted September 1, 2015 Share Posted September 1, 2015 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? Link to comment Share on other sites More sharing options...
Doctor Donna Posted September 1, 2015 Author Share Posted September 1, 2015 AnimState... or something. So without animation, the AnimState would be idle? yes its "idle" Link to comment Share on other sites More sharing options...
DarkXero Posted September 2, 2015 Share Posted September 2, 2015 @EulenMarie,local myaction = AddAction(...)myaction.instant = trueThat way the action won't require going to a stategraph state (and so performing an animation). Link to comment Share on other sites More sharing options...
Doctor Donna Posted September 2, 2015 Author Share Posted September 2, 2015 @EulenMarie,local myaction = AddAction(...)myaction.instant = trueThat way the action won't require going to a stategraph state (and so performing an animation). thank you, but where I must add this? XD Link to comment Share on other sites More sharing options...
DarkXero Posted September 3, 2015 Share Posted September 3, 2015 @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? Link to comment Share on other sites More sharing options...
Doctor Donna Posted September 3, 2015 Author Share Posted September 3, 2015 (edited) @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 Edited September 3, 2015 by EulenMarie Link to comment Share on other sites More sharing options...
DarkXero Posted September 4, 2015 Share Posted September 4, 2015 @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 addinst:AddTag("instant_action")on the prefab of the tools you want to make instant. Link to comment Share on other sites More sharing options...
Doctor Donna Posted September 4, 2015 Author Share Posted September 4, 2015 (edited) @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 addinst: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 Edited September 4, 2015 by EulenMarie Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now