HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help finding degree.

06-12-2004, 11:58 AM#1
volatile
Here's my issue, I want to find a point between two points.


-*---------- <---I want to find the asterisk. This is obviously only one angle, but I need the degree for any angle. I'm trying to make a gravity well, and I want to move the picked unit using polar offset by 5 towards the degree that the two points are. So it creates the effect of the well "pulling" the unit in.

* <-----Here is the gravity well.
/
/
/ <-----I want to move the unit to this point (actually a point on.
* <----Here is the target unit. the line depending on
what angle the unit is)

If someone could help me out I would appreciate it :P Thx :)
06-12-2004, 12:00 PM#2
volatile
Darn, that's not very clear... :/... Let me show u what I have so far.

Gravity Well Effect
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in (Units within 512.00 of GravityPoint) and do (Actions)
Loop - Actions
Set TempUnitPoint = ((Position of (Picked unit)) offset by 5.00 towards 0.00 <----HERE'S THE ISSUE degrees)
Unit - Move (Picked unit) instantly to TempUnitPoint, facing GravityPoint

How do I find the point (offset by 5) on the line (degree) towards the gravitypoint?
06-12-2004, 01:31 PM#3
johnfn
You can find the angle between two points. Its under reals function list. In your case, I think it is the angle between the unit and the gravity well.