ZupaleX Posted July 23, 2015 Share Posted July 23, 2015 Hello,So I've been trying to create some custom action for a item I created. Basically, I just wanted the character to play a different animation than the default one when using it. Everything works well until the "force attack" button is pressed. I dug up (a lot) in player_controller.lua and found some kind of a solution by using some leftclickoverride etc... but this solution is highly unsatisfying as it is messing up some other basic actions while my item is held by the player. So my question is, how does this "force" button work? Is it something special that has to be added in the component action? On an other note, is there a way to prevent the client from spaming a command? Because for the moment, the force attack has an override which is working but if the key is held, then it repeats the request too fast for the server to handle it properly which leeads to quite some crap. Thanks. Link to comment Share on other sites More sharing options...
DarkXero Posted July 24, 2015 Share Posted July 24, 2015 @ZupaleX, the force attack button is a button that when pressed, makes the playeractionpicker component bring up an attack action. It also changes the scope of the entities to target while issuing the attack command via F, in playercontroller. I assume you want to make a second type of normal attack with your bow and that is messing you up? Link to comment Share on other sites More sharing options...
ZupaleX Posted July 28, 2015 Author Share Posted July 28, 2015 Hello DarkXero, sorry I did not answere before. I actually figured out by myself how to do it and did not come back on the forums since then.But yes, that was the idea Thanks anyway! Link to comment Share on other sites More sharing options...
StarmanUltra Posted July 29, 2015 Share Posted July 29, 2015 (edited) How did you set up your custom attack animations? So far my whole character is going blank when I attack. I added animations to each facing direction of character.scml (in the exported\character folder) and saved it as player_attacks.scml. I know it's compiling because player_attacks.zip is showing up in the \anim folder. This tutorial and mod do very little in the way of implementation, but I couldn't figure out how to repurpose the code for an attack animation. For example,AddStategraphState("wilson", GLOBAL.State(new_idle_state)) is in the mod file. Do I need to write my own attack code? An example of your function would be fantastic Edited July 29, 2015 by StarmanUltra 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