falador1 2 Posted April 26, 2021 I was wondering if there was a quick way to find if a path has an obstacle between start and destination. For example Tile start = getLocalPlayer().getTile() // Start Tile end = new Tile( 10, 10) //Destination Walking.getAStarPathFinder().hasObstacle(start, end) //Returns true if there is an uncompleted obstacle between start and end Is there anything like that?
Vogelbekdier 1 Posted April 28, 2021 Not sure if this is what you mean but the Walking class has a method canWalk that returns a boolean value. Quote Tile end = new Tile( 10, 10, 0); //Destination Walking.canWalk(end); This will return either true or false.
420x69x420 73 Posted May 7, 2021 I am also wondering what OP is. 1. Walking.canWalk(destinationTile) returns false for me, after constructing the Tile with X,Y coords, somehow returned "false if not local or unable to find a path to tile" even though it had a clear path to nearby tile. 2. destinationTile.getFlags() returns integers for various obstacles of a destination tile, but they're not the same as TileFlags Enum https://dreambot.org/javadocs/constant-values.html#org.dreambot.api.methods.walking.pathfinding.data.TileFlags.NULL 3. TileMap and CollisionMap can somehow be constructed from a Reference (??) of Objects, Entities, but not TileReferences (???) and those maps give you a method isWalkable: boolean isWalkable(int x1, int y1, int x2, int y2) Check if the given location is walkable, i.values. no blocked movement. Parameters: x1 - The x coordinate of the start tile to check y1 - The y coordinate of the start tile to check x2 - The x coordinate of the destination tile to check y2 - The y coordinate of the destination tile to check Returns: true, if the destination is walkable. So if anyone could halp plz
Recommended Posts
Archived
This topic is now archived and is closed to further replies.