Moving Unit towards a Point?

Rinpun

Ex TH Member
Reaction score
105
I'm unsure of how to do this in JASS.

Anyway, I basically want to move a unit towards a specific point. I don't want to accomplish this by ordering the unit anywhere, but I want it to be accomplished by dragging the unit towards the point with SetUnitPosition or something somehow. How would I go about doing this?

This is to be done over a periodic timer, by the way.
 

SFilip

Gone but not forgotten
Reaction score
634
wow what a coincidence...i just made a spell you might find useful here ;)
http://www.thehelper.net/forums/showthread.php?t=34051
off course it needs some minor adjustments for what you want...for example the angle should be set to the angle between casting unit and your point.
and you should also change the if..then so that it will check the unit's position, not the distance (pick units within 100 range of target point...).
 

Rinpun

Ex TH Member
Reaction score
105
Well it uses CSCache. I guess I'll have to convert it to my system, which should be pretty easy. I'm too lazy to move over to CSCache :p

But thank you, I will check it out :)

Edit: I've checked it out. I forgot about this way of doing it. I've already done something similar to this already, but I forgot how I did it. Thanks again, you've been repped.

Last of all, as I look at the trigger in its essence, you have memory leaks with your use of GetUnitLoc. You might want to make some location variables to hold the GetUnitLoc and then RemoveLocation at the appropriate time. Since I will be making my trigger from scratch, I won't have trouble, but I think you might want to update it for those who consider using your template.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top