- Joined
- May 31, 2008
- Messages
- 698
I am working on a completely customizable projectile system in JASS. I am having some trouble with one part though. I want to make it so the projectile is able to home in on a nearby enemy unit. The problem isnt finding the enemy unit, but actually making the missile go to the unit. I want to make something that does not use global arrays. Also the missiles always travel in their facing direction, so i must make the missile slowly face its target.
Heres the basic idea of what i have:
Loc1 = position of target
Loc2 = position of missile
Angle1 = Facing of missile
Angle2 = Where i want the missile to face
call SetUnitFacing(GetEnumUnit(), Angle2)
...........................^ enum unit is the missile
I pretty much need a formula where i can use these points and angles to determine which way the missile should face. This really has me stumped, i have been trying to make it work for a while now and im not getting too far, so any help would be appreciated.
I will give you rep if you help me
Heres the basic idea of what i have:
Loc1 = position of target
Loc2 = position of missile
Angle1 = Facing of missile
Angle2 = Where i want the missile to face
call SetUnitFacing(GetEnumUnit(), Angle2)
...........................^ enum unit is the missile
I pretty much need a formula where i can use these points and angles to determine which way the missile should face. This really has me stumped, i have been trying to make it work for a while now and im not getting too far, so any help would be appreciated.
I will give you rep if you help me
