• 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.

Offset Question

Status
Not open for further replies.
Level 2
Joined
Jun 4, 2007
Messages
22
My question is, is there a grid or something i can go off that shows me where im placing a destructible when using the:

Create a <tree> in region<X> offset (Cords, Cords).

like when i set the cords i know a general location where its gonna be basing the middle is 0,0 but where would there be a tool or a grid that shows more accurate?
 
Level 2
Joined
Jun 4, 2007
Messages
22
im looking for the cords inside a region,

like so i can determine where INSIDE of a region im placing a destructible using either offset or polar offset
 
Level 2
Joined
Jun 4, 2007
Messages
22
I think everyone is misunderstanding me

what im trying to do it.

i have a region correct?

and im trying to basically map out a piece of terrain inside that region, and spawn doodads/destructibles inside that region just by using the offset, but im also a little confused as to using that.

if you ever played old zelda, thats what im trying to do. where the page basiaclly has to load when u reach the side of the screen.
 
Level 2
Joined
Jun 4, 2007
Messages
22
because its more in muliples of 50's instead of 1's, like 0,0 and 1,1 are pretty much on top of each other,

its really odd, hence why im posting this=P
 
Level 2
Joined
Jun 4, 2007
Messages
22
ok ill explain this again

how do i determind where im placing a destructible when i use the action

Create a tree at region wth offset (X,Y).

i want to take a region, and have a custom grid that shows where, for example 50,100 would be, but have a grid thats accurate relating to the region.

sorry if im not communicating properly=/
 
Level 2
Joined
Jun 4, 2007
Messages
22
yes but where can i see the points for a specific area,(a region)

i know the middle is 0,0 but what would be the corners? or the sides? or the points that i cant seem to pick out without alot of trial and error
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Kay, well.

Now, imagine we have a 2d destructable array, GridDestructables.

GridDestructables[0][0] would be the top left, and GridDestructables[49][49] would be the bottom right, on an example of a 50x50 grid.

Now, since we can generally say that with a 2-d array of size [x][y], the 1-d array is [(maxX+1)*y+x], maxX+1 being the max X array slot, or you could just say it's simply maxX if maxX is the total x array size.

Eg:

[0][0] = [50*0+0] = [0]
[0][1] = [50*1+0] = [50]
[1][0] = [50*0+1] = [1]
And so on

Now, let's say your Region is only of size 20x20.

Now, we have two new variables, xOffset and yOffset, which are changed depending on what 20x20 slot in the 50x50 array we wish to represent.

Basically, we just replace y with (y+yOffset) and x with (x+xOffset), leaving us with

[(y+yOffset)*maxX+x+xOffset]

Considering the top left corner (0,0 in the array) of the region is at (a,b), the position of any point should be;

a+x*128
b+y*128

Basically, if you shift the terrain 1 right (moving right in the 2d array), xOffset = xOffset + 1, if you go down yOffset = yOffset + 1, if you go left xOffset = xOffset - 1, and so on, and so forth.


Note that 2d arrays in warcraft do not go beyond 90x90 (or is it 89x89? I can never remember...)


I hope that made sense ;)
 
Level 2
Joined
Jun 4, 2007
Messages
22
sorry purple, i didn't really understand that.

im still a little new to WE, even though i've messed with it for years and understand alot in it, i guess i won't be able to understand this, im more of a visual learner.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Argh =/

Here's a visual representation of what the formulae above are doing;

(bold = region [displayed values], non-bold = non-displayed array values)

I did it for 5x5 (region) and 10x10 (array)

Basically, you're doing something like this;

-Apply formulae;

oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo

-Offset x by 1;

oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo

-Offset y by 1; (on top of the previous offset)

oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo
oooooooooo

(I could continue to do this for other arbitrary values of xOffset and yOffset)

But you'll have to understand the formulas if you want to do this...

I'll probably do a better write-up of it tomorrow, that one was fairly short.
 
Level 2
Joined
Jun 4, 2007
Messages
22
the best way for me to understand if you were to make a demo of this in a map. but im not expecting you to.
 
Level 9
Joined
Jun 26, 2007
Messages
659
i guess he want to get in the WE the coordinate of a point from the center of the region
(i.e. if the region's center in at 10,10 and the point at 11,11; he want 1,1)

and if you doesn't understand offset like purplepoot think:
an offset is a translation, a transation is an addition
if you've the p point which has value (xp,yp)
p with offset (x',y') = (xp+x',yp+y')
so (8,4) with offset (3,9) = (8+3,4+9) = (11,13)

then you've just to know the game referencial:
x go from left to right, y go from down to up
squale is : 512 between yellow grid line, 128 between white ones, 32 between gray ones
 

Attachments

  • WC3ref.png
    WC3ref.png
    399.6 KB · Views: 98
Last edited:
Level 2
Joined
Jun 4, 2007
Messages
22
Wow ty for that picture,

it helps alot. now i understand this stupid puzzle.


thanks a million and for everyone else that tried helping=]
 
Status
Not open for further replies.
Top