1. The contestants were to create water structures for the 20th Terraining Contest. Choose one in the public poll!
    Dismiss Notice
  2. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  3. The Melee Mapping Contest #4: 2v2 - Results are out! Step by to congratulate the winners!
    Dismiss Notice
  4. We're hosting the 15th Mini-Mapping Contest with YouTuber Abelhawk! The contestants are to create a custom map that uses the hidden content within Warcraft 3 or is inspired by any of the many secrets within the game.
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice

What can i compare the trigger editor "range" to

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

  1. Ecrolls

    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?
     
  2. Adiktuz

    Adiktuz

    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

    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

    Ecrolls

    Joined:
    Dec 22, 2008
    Messages:
    97
    Resources:
    1
    Maps:
    1
    Resources:
    1
    Ok :p 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

    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

    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.