• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Can't seem to read offset directions (X-Y axis)

Status
Not open for further replies.
Level 9
Joined
Oct 3, 2006
Messages
302
Hello, It's me again...I'm trying to make a trigger involving MOVING OF UNITS IN A FORMATION...I'm having problem with reading the directions as to where he should move. For example, I want the UNIT to move north-west....problem is that northwest are written in numbers in the GUI. And I don't know what coordinates northwest are.

Here's the trigger:
Unit - Order Rifleman 0000 <gen> to Move To ((Position of (Triggering unit)) offset by (?, ?))


Here's the RAW form of the trigger:
Unit - Order Rifleman 0000 <gen> to Move To ((Position of (Triggering unit)) offset by (X, Y))

So X and Y refer to degrees, but is there some kind of method to read them as to what numbers go south, west, north etc.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
So X and Y refer to degrees, but is there some kind of method to read them as to what numbers go south, west, north etc.

X/Y do not refer to degrees. X/Y coordinates are Cartesian, while degrees/radians are a completely different ballpark. North/East/South/West is already represented by X/Y coordinates.

South is negative North.
West is negative East.

This leaves you with North and East, which, in turn, can be used as Cartesian X/Y coordinates.

method to read them as to what numbers go south, west, north etc.

I've got no idea what you're talking about.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,285
The map and X/Y.
The map uses X/Y cordinates to simplify the calcuations of where to position objects. Normally the middle of the map is point 0,0 and anything else is a position vector from that.

Offsetting via fixed X/Y
X axis runs from left to right so positive means move to right of map and negative means move to left (from default view angle).
Y axis runs from bottom to top so positive means move to top of map and negative to move to bottom of map.

Offsetting using trig.
The formulas involved are pretty simple.
newx = x+hypotenuse*cos(angle)
newy = y+hypotenuse*sin(angle)
From maths it is pretty easy to see the position vectors and how they work. 0 (0 degrees) refers to a rightward direction. pi/2 (90 degrees) refers to a upward direction on the map (towards the top map edge). Using the logic of opposite angles (angle + pi or angledegrees + 180) you can get the other directions.

There is no much one needs to know beyond this for offsets unless you plan to do something very complicated.
 
Status
Not open for further replies.
Top