1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  5. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  6. Vote for the best entries in the 13th Music Contest Poll.
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[JASS] Need help on types rect and region and a releated function

Discussion in 'Triggers & Scripts' started by mems, Aug 9, 2005.

  1. mems

    mems

    Joined:
    May 2, 2005
    Messages:
    40
    Resources:
    3
    Icons:
    1
    Maps:
    2
    Resources:
    3
    I was scouting around API Browser and faund a function

    native IsLocationInRegion()
    which takes region, location and returns boolean.

    I wonder what is region type stands for?
    What is the differnce between rect and region?

    I found it when im trying to find a condition.
    I have a unit which moves to random location around itself and it has loctus ability which makes it, can move outside from playable map area.

    I dont want to use Neutral-Wander ability for some reason

    And i was trying to make such a code:
    Code (Text):
        loop
           exitwhen(IsLocationInRegion (CheckPoint,GoToPoint))
           set GoToPoint = GetRandomLocInRect(CenteredRect)
        endloop
    CheckPoint must be a region type variable
    I also found that function releated to region:
    RegionAddRect()
    which takes region, rect and returns nothing

    I have tried to create a region variable and add the playable map area to region and tried the condition above again with this codes but does not worked either:

    Code (Text):
    local region = CreateRegion()
    local rect Map = GetPlayableMapRect()
    call RegionAddRect(CheckPoint,Map)
        loop
           exitwhen(IsLocationInRegion (CheckPoint,GoToPoint))
           set GoToPoint = GetRandomLocInRect(CenteredRect)
        endloop
    Does anyone have something about this problem?
    Ty
     
  2. Vexorian

    Vexorian

    Joined:
    Mar 11, 2004
    Messages:
    649
    Resources:
    1
    Maps:
    1
    Resources:
    1
    rect (what world editor calls region for no reason) It is a rectangle

    region : Can have any shape and is also used for enter/leave events .


    A region is a group of points you can even add a rect to a region or remove a rect from a region, regions are cool because they can have any shape.

    On normal WE you can't use region global variables because blizzard is retarded. But with some modifications you can make WE do so.
     
  3. mems

    mems

    Joined:
    May 2, 2005
    Messages:
    40
    Resources:
    3
    Icons:
    1
    Maps:
    2
    Resources:
    3
    so theorically
    if i create a rect and aasign it forex playable map area and add that rect to a region

    then region becomes playable map area?
    if yes why that function newer returns true?

    exitwhen(IsLocationInRegion (CheckPoint,GoToPoint))

    i have tried it and it loops forever and disables the trigger.