• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Move Caster Behind Target!

Status
Not open for further replies.
Level 10
Joined
Aug 8, 2004
Messages
562
im having trouble makeing the caster appear behind the target....
not behind the target in facing degrees but like a little bit further then where you targeted the spell.
for those of you that are still confused i will make a diagram:
Key:C=Caster T=Target X=Position i want caster to appear.

C------T-X

or

X-T------C

Or

X
-
T
_
_
_
_
C


Please Help Me!
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Well, you have to think a little trigonometrically, though trigonometry is not really involved here.

Let's take this example. You have the center of a circle (the casting unit) and an unit somewhere on the circle. We can determine where the unit is by the distance and the angle (obviously Polar Projection).

You don't need to know the facing angle. Your aim is to move the unit BEHIND THE TARGET. That means that the caster must move on a circle with the same center, at the same position (angle) but with a bigger distance (about 100 more). And here is the formula of all my blabla. The three fields of the projection are in right position I think. I forgot all the GUI stuff so I kinda made more like a scheme.

Polar Projection - Unit Location (Triggering Unit) - Distance Between Points ((UnitLocation (Triggering Unit)) and (UnitLocation (Target Unit)))+100
- Angle Between Points ((UnitLocation (Triggering Unit)) and (UnitLocation (Target Unit)))

All you have to do is study the problem. Usually such problems with positions can be solved trigonometrically (circles!).

~Daelin
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Well, it depends. I suppose that you will have a (Target Unit of Ability Being Cast) as the target unit. So here is the EXACT Polar Projection:

(Position of (Casting Unit)) offset by (Distance Between (Position of (Casting Unit)) and (Position of (Target Unit of Ability Being Cast))) towards (Angle Between (Position of (Casting Unit)) and (Position of (Target Unit of Ability Being Cast)))

Too many positions eh? Lol, good luck with that! Both Angle Between points and Distance Between Points are Math - Distance/Angle Between Points (so that you find them easier).

~Daelin
 
Level 4
Joined
Nov 3, 2004
Messages
79
I think u can make it much easier. Unit - Move (Casting unit) instantly to ((Position of (Target unit of ability being cast)) offset by 100.00 towards (180.00 - (Facing of (Target unit of ability being cast))) degrees)
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
iplaystarcraft said:
No, that wont change with the caster's facing degree.....

And that is why I came up with something regardless the facing of the unit... Not to mention that your method depends on the facing of the target unit. He didn't need this. If you would've checked the schemes you would've got what he needed. He wanted it to go somehow behind, but not depending on the facing, but of the position of the unit. Read better next time!

~Daelin
 
Level 10
Joined
Aug 8, 2004
Messages
562
GAHHHH IM SO CONFUSED!
i made this trigger based off daelin's post but the caster kepps moving to the same spot!

Unit - Move (Triggering unit) instantly to ((Position of (Triggering unit)) offset by (Distance between (Position of (Triggering unit)) and (Position of Target)) towards (Angle from (Position of (Triggering unit)) to (Position of Target)) degrees), facing (Position of (Triggering unit))

here is an example of what i want: if the caster is facing down he appears below the target. if the caster is facing left he appears to the left of the target. etc.

HELP!


(btw where is The_Raven, i really liked his spells.)
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Let me guess, (Target Unit of Ability Being Cast) after waits? :lol: Be careful at those!!!

And The_Raven is gone, prolly forever. I know his spells were cool and I wish I had time to do any more spells, but I just don't have it. Once my conversion mod is done, I will do my best to get back to my old occupations. But for now, think at it as a super spellpack.

~Daelin
 
Status
Not open for further replies.
Top