Thor7 Posted September 14, 2014 Author Share Posted September 14, 2014 Hi,Just a quick question as I'm a bit stuck on how to add a auto attack. So that it checks that a target has been selected and will auto attack (instead of holding down CTRL) depending on if target is in range. I'm after adding a value to weapons (between 1 and 2, this is for tile distance from player). 1 tile for short blades, and 2 tiles for poles / large blades.If the tile check distance is too much, even if it checks that the target is next to the player and will auto attack.Im using Eclipse Worlds 1.2.4Any help would be much appreciated as I'm still learning :).Thanks in advance! Link to comment Share on other sites More sharing options...
Mal Posted September 14, 2014 Share Posted September 14, 2014 You've already come up with the answer yourself. :) If x distance < required distance to hit then auto attack. You'll have to hunt down the method that handles proximity checks (aabb collision, I'm assuming) and add the above algorithm.I'm sure someone will stop by and add an addendum sooner or later detailing how to go about doing it. Link to comment Share on other sites More sharing options...
Thor7 Posted September 14, 2014 Author Share Posted September 14, 2014 Thanks for the reply Bud :) I will continue to have a try and update as I go, thanks for the point in the right direction. Link to comment Share on other sites More sharing options...
Helladen Posted September 15, 2014 Share Posted September 15, 2014 Set direction client-side, and automate attack server-side. Make sure to send your directional change from client-side, if you set it server-side and send it to client, it will cause issues and desync you. I may have it backwards though.I'll add this in 1.2.5 though, Nin already has it coded in by me. :) Link to comment Share on other sites More sharing options...
Thor7 Posted September 15, 2014 Author Share Posted September 15, 2014 Aeirex nice one mate!! Your custom version is class! :) Been following your updates on it for months, glad your still hacking at it adding cool stuff and cant wait for next version!But Im still gunna have a crack at it this anyways, just for learning purposes for me more than anything. I will update on here as I go (most likely for help lol).Thanks again for your time and responses :) 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