• 🏆 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!

Math question

Status
Not open for further replies.
Level 8
Joined
May 27, 2007
Messages
170
Hi all :thumbs_up:

I am need of some assistance with the dreaded maths here, and I am guessing what I am after involves trigonometry, although I'm not too sure. Anyway I'm looking for a way to make a unit move a set distance directly away from another unit, but so said unit ends up as far away from the other unit as possible. Imagine drawing a dead straight line between the two, I basically want to extend that line beyond the unit doing the runnin, then order it to move to the end of that line, in the direction leading away from the second unit. Any help would be greatly appreciated. It's been a long, long time since I had anything to do with trigonometry. :ugly:
 
Last edited:
Level 18
Joined
Aug 23, 2008
Messages
2,319
  • Moving past unit
    • Events
      • Unit - <YOUR UNIT> Is issued an order targeting an object
    • Conditions
    • Actions
      • Set ANGLE = (Angle from (Position of (Triggering unit)) to (Position of (Targeted unit)))
      • Unit - Order <YOUR UNIT> to Move To ((Position of (Targeted unit)) offset by X towards ANGLE degrees)
ANGLE = A Real Variable

Event and target can be changed to what you need them for.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
Well excuse me for posting a possibility. I've posted to solve the problem, I'm not the king of anti-leaking. If something needs to be added to solve the leaking, then he can do that, but the point is: he had a question, I gave him an answer and now he got a trigger basis, which he can modify to prevent leaking.
 
  • Stuff
  • Set TempLocA = position of triggering unit
  • Set TempLocB = position of target of ability being cast
  • Set TempLocC = Point with polar offset (TempLocA offset by 2000 twords
  • angle between TempLocA to TempLocB
  • Unit - Issue triggering unit to move to TempLocC
  • Custom Script: call RemoveLocation(udg_TempLocA)
  • Custom Script: call RemoveLocation(udg_TempLocB)
  • Custom Script: call RemoveLocation(udg_TempLocC)
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Nope, so dealt with.

Well excuse me for posting a possibility. I've posted to solve the problem, I'm not the king of anti-leaking. If something needs to be added to solve the leaking, then he can do that, but the point is: he had a question, I gave him an answer and now he got a trigger basis, which he can modify to prevent leaking.
When most people are asking a basic question, it's because they haven't had that much practice with the editor. They're thus rather unlikely to have heard of leaks, and giving them leaky triggers doesn't exactly help.

Meh.
 
Level 18
Joined
Aug 23, 2008
Messages
2,319
I could give you a nice little story that proves my point. But since I know it will only cause a lot of trouble, bring both of us in a bad mood and makes this place a not so happy place anymore, I'm not.

So would you please drop the subject, assume I have a good reason for my actions as I understand you have a good reason for your actions and keep this friendly environment.
 
Status
Not open for further replies.
Top