# What can i compare the trigger editor "range" to

Discussion in 'Triggers & Scripts' started by Ecrolls, Sep 12, 2010.

1. ### Ecrolls

Joined:
Dec 22, 2008
Messages:
97
Resources:
1
Maps:
1
Resources:
1
I really dont know how far or short the range value is on the trigger editor. Anyone know what i can compare it to?

Joined:
Oct 16, 2008
Messages:
9,674
Resources:
23
Models:
2
Packs:
1
Maps:
1
Spells:
16
Tutorials:
1
JASS:
2
Resources:
23
I cant understand... what range value????

3. ### Tirlititi

Joined:
Jul 11, 2010
Messages:
396
Resources:
12
Models:
6
Maps:
2
Spells:
3
JASS:
1
Resources:
12
I think he's talking about the distance scale.

You can display the grid in the terrain editor (hotkey G) : there is the largest yellow grid which is 512 large, then the medium white grid which is 128 large and the smallest grey grid which is 32 large.

Most of time, destructables and doodads are usually 64x64 sized minimum but you can create custom paths 32x32, regions are 32x32 sized minimum as well and units has a minimum collision radius of 8.

4. ### Ecrolls

Joined:
Dec 22, 2008
Messages:
97
Resources:
1
Maps:
1
Resources:
1
Ok ty
I was referring to the "unit within range" event so i dont know if thats right or not.
EDIT
Not right for me anyway, i used a "unit within range" event with one of those distances and it just triggers it wherever my units are at.

5. ### BoneBreaker

Joined:
Jun 26, 2005
Messages:
247
Resources:
0
Resources:
0
Tirl is right. To check to distance between two Point(x,y)'s, use the distance formula:

Code (vJASS):

function GetDistance takes real x1, real x2, real y1, real y2 returns real
return SquareRoot(((y2-y1)*(y2-y1))+((x2-x1)*(x2-x1)))
endfunction

6. ### Axarion

Joined:
Sep 30, 2009
Messages:
675
Resources:
1
Spells:
1
Resources:
1
Code (vJASS):

function GetDistanceBetweenCoordinatesNoRoot takes real x1, real x2, real y1, real y2 returns real
return ((y2-y1)*(y2-y1))+((x2-x1)*(x2-x1))
endfunction

Would be better for performance because SquareRoot is very slow :/ Just square the compared real then and it will do the same.