. . . Posted June 17, 2017 Share Posted June 17, 2017 (edited) Hello, I need some help if someone could help me that'd really be great ! So, I'm trying to make a action for my character, & the character can move while preforming it. However, the problem is when my character moves while doing it, it makes my character play the run anim, canceling the the action's anim.. Here's the code! Spoiler local function powerup(act) if act.target.powerup == nil then act.target.AnimState:PlayAnimation("powerup") act.target.powerup = true act.target.stealthsteps:set(true) act.target.components.locomotor:SetExternalSpeedMultiplier(act.target, "powerup", 1.25) act.target:DoTaskInTime(.5, function() ShakeAllCameras(CAMERASHAKE.VERTICAL,.4, .04, .4, act.target, .01) act.target.components.locomotor:RemoveExternalSpeedMultiplier(act.target, "jumping") act.target.stealthsteps:set(false) act.target.powerup = nil end) end end So, is there a way I can make it that no other anim interrupts this anim while this action is being played? Maybe with a certain value or something? Thanks so much for reading my problem & have a great day/night !! Edited June 19, 2017 by SuperDavid Link to comment Share on other sites More sharing options...
Lumina Posted June 17, 2017 Share Posted June 17, 2017 changing stategraph maybe ? Link to comment Share on other sites More sharing options...
. . . Posted June 17, 2017 Author Share Posted June 17, 2017 Maybe I can change the run state to not play any anim with certain value, but how would I edit the run state? If I copypaste SGwilson then edit it then any new states or mod states would crash the game .. Link to comment Share on other sites More sharing options...
Jodlio Posted June 20, 2017 Share Posted June 20, 2017 (edited) I am not sure if that helps you but I had a similar problem on my mod where I needed to increase the speed of an action and ended up hijacking the UpdateState-method and just replaced the current state with my own altered state-table. Maybe you can use that approach for your mod too: local origin_updateState = player.sg.UpdateState player.sg.UpdateState = function(...) if not player.sg.currentstate then return end if YOUR_ACTION_IS_RUNNING_AND_THE_CURRENT_STATE_WILL_CANCEL_IT then player.sg.currentstate = YOUR_OWN_STATE end origin_updateState(...) end You can see the code working in this mod (in scripts/components/DsMMO.lua): http://steamcommunity.com/sharedfiles/filedetails/?id=942328680 The function for creating my own state ( DsMMO:update_actionSpeed ) is at line 924. UpdateState is replaced at line 816 Edited June 20, 2017 by Jodlio 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