Aurorus Posted June 28, 2019 Share Posted June 28, 2019 Hi I want make character with fast picking ability and i found code for this but when this character is on server then all characters get this ability. Anyone can help? pirqoo.lua Link to comment https://forums.kleientertainment.com/forums/topic/108041-fast-picking-ability/ Share on other sites More sharing options...
ShinyMoogle Posted June 28, 2019 Share Posted June 28, 2019 (edited) Every character uses the base Wilson stategraph (SGWilson) by default. It sounds like you're somehow managing to create a reference to SGWilson and then completely overwriting the ActionHandler for ACTIONS.PICK, which then affects every other character which uses the stategraph. There's no need to go crazy with modifying stategraphs, though, since the existing ActionHandler already has the functionality you need. ActionHandler(ACTIONS.PICK, function(inst, action) return action.target ~= nil and action.target.components.pickable ~= nil and ( (action.target.components.pickable.jostlepick and "dojostleaction") or (action.target.components.pickable.quickpick and "doshortaction") or (inst:HasTag("fastpicker") and "doshortaction") or (inst:HasTag("quagmire_fasthands") and "domediumaction") or "dolongaction" ) or nil end), What this ActionHandler does is it takes your instruction - in this case, a PICK action - and returns the appropriate animation state depending on various factors. All you need to do is add either the "fastpicker" tag to your character prefab to make all picking actions take minimal time (think carrots), or the "quagmire_fasthands" tag to have your character harvest quickly but not instantly. Edited June 28, 2019 by ShinyMoogle Link to comment https://forums.kleientertainment.com/forums/topic/108041-fast-picking-ability/#findComment-1215567 Share on other sites More sharing options...
Aurorus Posted June 28, 2019 Author Share Posted June 28, 2019 wow it works thanks for this <3 Link to comment https://forums.kleientertainment.com/forums/topic/108041-fast-picking-ability/#findComment-1215583 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