How to get the x,y of a untis position

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,497
In GUI?
Set X = X of (Position of (Triggering unit))
Repeat for Y.
Remove the point leak...

Use JASS:
Set Unit = (Triggering unit) (or whatever unit you need)
Custom script: set udg_X = GetUnitX(udg_Unit)
Custom script: set udg_Y = GetUnitY(udg_Unit)

Where X and Y are two global variables of type "real".
 

dannyboydude

Ultra Cool Member
Reaction score
33
Ok thanks AceHart

And i heard somewhere using x,y is quicker than using the position of a unit ?

Correct or wrong ?
 

polo2005

Wana start playing LoL? http://tinyurl.com/369as27
Reaction score
97
dont think it's faster? atleast not if it's a point varible
 

dannyboydude

Ultra Cool Member
Reaction score
33
So why in jass spells i see [ Get blah blah x and y ]

And then refer to the x and y in a position action?

Why not they just use GetLocation of that unit?
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,497
In JASS, it's certainly better to use coordinates.
If nothing else, reals don't need to be taken care of for leaks.

Locations are a pain to use.
They only make sense in GUI.
 

ThePlague

New Member
Reaction score
14
Also for w/e reason, if you change a units location it 'forgets' its current orders. If instead you Set its X Coordiante and Y COordinate it keeps its orders.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top