Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Auto Attack on Distance


Thor7
 Share

Recommended Posts

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.4

Any help would be much appreciated as I'm still learning :).

Thanks in advance!
Link to comment
Share on other sites

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...