Dog_ Posted July 6, 2014 Share Posted July 6, 2014 Dunno I just put that there so I wouldn't have to release my own walking method hai corey with an e wuts wrong with corey m8 thats like saying hey swizzbeat with a b hey dog_ with a d 1 Link to comment Share on other sites More sharing options...
Swizzbeat Posted July 6, 2014 Author Share Posted July 6, 2014 wuts wrong with corey m8 thats like saying hey swizzbeat with a b hey dog_ with a d ^ 1 Link to comment Share on other sites More sharing options...
Dog_ Posted July 6, 2014 Share Posted July 6, 2014 ^ 3 Link to comment Share on other sites More sharing options...
Joseph Posted July 11, 2014 Share Posted July 11, 2014 public Position nextTile(Position path[], int skipDist) { int dist = -1, closest = -1; for (int i = path.length - 1; i >= 0; i--) { Position tile = path[i]; int d = script.map.distance(tile); if (d <= 16 && (d < dist || dist == -1)) { //<---- was edited dist = d; closest = i; } } int feasibleTileIndex = -1; for (int i = closest; i < path.length; i++) { if (script.map.distance(path[i]) <= skipDist) { feasibleTileIndex = i; } else { break; } } return (feasibleTileIndex == -1) ? null : path[feasibleTileIndex]; } i added in one line, because for the next tile method it will get the furthest tile in the path, but sometime it picks a tile that maybe like 3-5 time out of minimap rang and just get stuck there so i added a quick boolean that will help check to see if it can reach tile. Link to comment Share on other sites More sharing options...
Swizzbeat Posted July 11, 2014 Author Share Posted July 11, 2014 public Position nextTile(Position path[], int skipDist) { int dist = -1, closest = -1; for (int i = path.length - 1; i >= 0; i--) { Position tile = path[i]; int d = script.map.distance(tile); if (d <= 16 && (d < dist || dist == -1)) { //<---- was edited dist = d; closest = i; } } int feasibleTileIndex = -1; for (int i = closest; i < path.length; i++) { if (script.map.distance(path[i]) <= skipDist) { feasibleTileIndex = i; } else { break; } } return (feasibleTileIndex == -1) ? null : path[feasibleTileIndex]; } i added in one line, because for the next tile method it will get the furthest tile in the path, but sometime it picks a tile that maybe like 3-5 time out of minimap rang and just get stuck there so i added a quick boolean that will help check to see if it can reach tile. You should probably add it to the loop which actually grabs the next tile to walk to. The first loop just gets the closest position to your current position as a starting point. Link to comment Share on other sites More sharing options...
Joseph Posted July 11, 2014 Share Posted July 11, 2014 You should probably add it to the loop which actually grabs the next tile to walk to. The first loop just gets the closest position to your current position as a starting point. Are you talking about the second loop 1 Link to comment Share on other sites More sharing options...