Attack action nerver return


#1

Hi,

I am using an archer hero and It attack ennemies which are blocked by rock for example. The attack action nerver returns unless the attack has touched the enemy.

This is problematic as it does not loop and I cant move my hero using flags.

Is there a special way to call attack so it does not block ?

Thanks,
Maxime


#2

Do you have the Twilight Glasses? If so, you can use isPathClear to check if the path from you to the enemy is free of obstacles.


#3

The only problem to note is that isPathClear can miss some obstacles which are slightly off the direct line. J_F_B_M@ kindly suggested creating 1 foot vectors on either side of the 2 points and checking isPathClear 9 times or so in the Sir Robin threat on this board.

I have posted the resulting code in my thread on Backwoods Brawl as I was getting an error. (The key to avoiding my error is to not weight using 1/distanceTo but rather use 1/(1+distanceTo) … the error turned out to be accidentally generating an infinite vector. Much thanks to ant@ for identifying that problem.)