Wc3C.net Offset / Polar Offset
 Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar

10-24-2004, 05:34 AM   #1
Earth-Fury
Two Blue

Join Date: Mar 2003
Posts: 2,179

Submissions (7)

Offset / Polar Offset

Offset is measuring a location based on another location.

In Warcraft 3, all objects on the map have X and Y coordinates. (X being left to right, with Y being up to down at the default camera angle) In most cases, point 0,0 (X,Y) is around the center of the playable map area. In the world editor, you can see which point your cursor is pointing at in the bottom left corner. You will see “Point: (number, number, number)” when you move your mouse around your map. These are your cursors X, Y, and Z coordinates. (Z being how high something is, like a unit's flying height)

The world editor has 3 sizes of grid you can toggle between with the G key. Each one is a power of 2 high and wide. Lets list the exact values:

Small: 32
Medium: 128, or 4 Small
Large: 512, or 4 Medium, or 16 Small

Now, if you are wondering “How does that help me, Mr. Fury?” then let me tell you! Lets say you want a unit to move in the direction he is facing.
Trigger:
Unit - Order (Your unit) to Move To ((Position of (Your unit)) offset by 32.00 towards (Facing of (Your unit)) degrees)
This is called polar offset, which is offsetting something by some distance in some direction. You have your unit, and he is facing a direction. You want to order him to move a distance of 32 in that direction. So, you take the point at which your unit is standing, (A point is an X and a Y coordinate all in one) and you offset it in the direction he is facing by a distance of 32. Very simple.

Now lets say you want to make him move diagonally up and right by 128.
Trigger:
Unit - Order (Your unit) to Move To ((Position of (Your unit)) offset by (128..00, 128..00))
This takes the point of your unit, offsets it by 128 along both the X and Y axis, and orders him to move there. Even simpler!

Now, the problem with this is memory leaks. That is beyond the scope of this tutorial, but let it be noted that using allot of points will cause allot of memory leaks.

Edited because: I've actually spell checked and mostly re-written this tutorial. Boy, posted in '04... My spelling, and hopefully my language skills as a whole, have vastly improved....
__________________
 Useful Links: My Resources: Good Resources: Search Tutorials Ability Guide UnitMaxState BonusMod AutoIndex ARGB TimerUtils

Last edited by Earth-Fury : 03-15-2007 at 01:29 PM. Reason: I've actually spell checked and mostly re-written this tutorial. Boy, posted in '04... My spelling, and hopefully my language skills as a whole, have vastly improved...

 10-24-2004, 03:42 PM #2 dhv User   Join Date: Aug 2004 Posts: 8 Good tutorial... Made my understanding of offsets clearer.
10-30-2004, 08:00 AM   #3
Earth-Fury
Two Blue

Join Date: Mar 2003
Posts: 2,179

Submissions (7)

thx :P its an older tutorial, but nothing has chanced in this area. (and i couldent see it ever chaing dramatically 0.0)
__________________
 Useful Links: My Resources: Good Resources: Search Tutorials Ability Guide UnitMaxState BonusMod AutoIndex ARGB TimerUtils

 02-10-2006, 01:18 PM #4 Ragnarok X User   Join Date: Dec 2003 Posts: 83 The values of the 3 sizes of grid are: Small grid: 32 Medium grid: 128 Large grid: 512 Anyway, good tutorial for people that don't know this.
 02-14-2006, 07:38 PM #5 Meanie User   Join Date: Dec 2005 Posts: 152 Thanks alot i have been trying to read decades long tutorials to find this information again THANKS ALOT ♥♥♥
 02-16-2006, 12:36 AM #6 Miranox User     Join Date: Dec 2005 Posts: 12 The grid values I didn't know very well, but the rest you can learn at school :P
 05-11-2006, 04:38 PM #7 Xios User     Join Date: May 2006 Posts: 85 Submissions (4) yeah thanks, before i was using x=1,y=1.... lol but know i know its x=30 and y=30 thanks alot, this is usefull for flooding an areain my smoke from smoke grenade
10-15-2006, 04:39 PM   #8
alzidaney
User

Join Date: Jul 2006
Posts: 5

Quote:
 Small grid: 32 Medium grid: 128 Large grid: 512

Quote:
 Small - (30 Value) Medium - 4 smalls in a medium (120 Value) Large - 4 medium, or 16 small in one large (480 value)

So which one is the right one?
__________________

 09-10-2009, 02:37 PM #9 lukesmith User     Join Date: Sep 2009 Posts: 2 wow nice tutorial , all i know is just making a + pattern using offset hehe
09-23-2009, 01:13 AM   #10
ToukoAozaki
extends net.wc3c.Jasser

Join Date: Jun 2008
Posts: 336

Submissions (5)

Quote:
 Originally Posted by alzidaney So which one is the right one?

It's always power of 2.