Warcraft III resources & community, 2003–2006 · archived

help with math

6 posts
#1

help with math

Well, i am trying to make an ability called "fear"
E: unit casts an ability
C: ability = fear
A: Pick players[all enemys of casting unit]
unit group pick all units owned by picked player in
300 aoe from units point
disable controlling unit
order picked unit to ..*


*HERE is my problem, i have no idea how to calculate it, i want the units to run away from the casting unit eg:
casting unit pos = 250 / 300 picked unit pos = 400 / 800
order picked unit to 1600 / 6400

BUT! IF
casting unit pos = 10000 / 5000
picked unit pos = 9700/ 4700
order picked unit to 1600 / 6400

The problem is i want the unit to run away, depending on the position of both units, in a line where the picked unit could face the casting unit all the time, i hope you understand it and you can help me!
#2
Point with polar offset:
point: position of picked unit
range: anything you want
angle: math - angle between points - position of triggering unit and position of picked unit
#3
Thank you very much!
#4
Remember to remove the locations and destroy the groupes or else it WILL leak.
#5
When i saw the name of poster i already knew what the comment would be about
#6
same, lol

doesnt mean hes wrong, however.