1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resolved RegionPath is always returning null

Discussion in 'Developer Support' started by KittyMr, May 15, 2018.

  1. KittyMr

    Joined:
    Apr 21, 2017
    Messages:
    14
    Likes Received:
    2
    Hi everyone,
    I am trying to use region path in RS3 but it keeps returning null, I have no idea why. Can someone help me on this? I am not sure what the error even is.
    Thanks in advance.
    Code:
    Code (Text):
    1. riftCoord = new Coordinate(2890,3047,0);
    2. RegionPath regionPath = RegionPath.buildTo(riftCoord);
    3. if(regionPath != null)
    4.          regionPath.step();


     
    #1 KittyMr, May 15, 2018
    Last edited: May 15, 2018
  2. Best Answer:
    Post #4 by Derk, May 15, 2018
  3. auxi

    Joined:
    May 24, 2016
    Messages:
    1,113
    Likes Received:
    990
    You are most likely trying to build a path to a coordinate outside of your current region, hence why it returns null. RegionPath's can only build to coordinates within your current region.
     
  4. KittyMr

    Joined:
    Apr 21, 2017
    Messages:
    14
    Likes Received:
    2
    alright, how do I check my region, because I'm like 15-20 blocks away from the coordinates.
     
  5. Derk

    Derk 12 year old normie

    Joined:
    Jan 8, 2015
    Messages:
    2,766
    Likes Received:
    1,339
    Is it vital that you need region pathing? If it's only a few tiles away you might as well use bresenham path for a faster generation of the path.
     
  6. KittyMr

    Joined:
    Apr 21, 2017
    Messages:
    14
    Likes Received:
    2
    good Idea, don't know why I didn't do this in the first place. Thanks very much.
    EDIT:
    bresenham pathing works, Thanks again.
     
    Derk likes this.

Share This Page

Loading...