Jump to content

Custom Obstacle Handing?


LoudPacks

Recommended Posts

Alright so basically I have each of the mining areas in the motherlode mined defined. I want to be able to walk to one of these areas and handle the rockfall obstacles that are in the way. Right now if a rockfall is present, a path is not able to be generated. If the rockfall is already mined, the path works fine. Im trying to figure out a way to "ignore" obstacles and generate a path so that I can handle the rockfalls myself (when it gets stuck infront of it using the path). 

 

Is there a different approach to doing this?

Link to comment
Share on other sites

The LocalPathfinder has an overload that takes a clipping graph for path generation. Just get the current clipping graph and set the rock positions to be traversible, and use that with the pathfinder. Then add whatever handling you want.

 

OR do as the others said and make your own pathfinder.

Edited by FrostBug
Link to comment
Share on other sites

The LocalPathfinder has an overload that takes a clipping graph for path generation. Just get the current clipping graph and set the rock positions to be traversible, and use that with the pathfinder. Then add whatever handling you want.

 

OR do as the others said and make your own pathfinder.

 

Okay so I came up with this. Now it will try and walk. How do I go about handling the rockfall when its in front of the player?

if(!inZone()){
		LocalPathFinder path = new LocalPathFinder(getBot());
		LinkedList<Position> generatedPath = path.findPath(getRandomZone().zone.getRandomPosition(), generateModifiedClippingData());
		getLocalWalker().walking.walkPath(generatedPath);

	}

In getting the clipping data I also get a List<RS2Object> of all the rockfalls. Should I just iterate through that list and "mine" the closest one? Is there a better way of doing this?

Link to comment
Share on other sites

Okay so I came up with this. Now it will try and walk. How do I go about handling the rockfall when its in front of the player?

if(!inZone()){
		LocalPathFinder path = new LocalPathFinder(getBot());
		LinkedList<Position> generatedPath = path.findPath(getRandomZone().zone.getRandomPosition(), generateModifiedClippingData());
		getLocalWalker().walking.walkPath(generatedPath);

	}

In getting the clipping data I also get a List<RS2Object> of all the rockfalls. Should I just iterate through that list and "mine" the closest one? Is there a better way of doing this?

 

Get the rockfalls located on the generated path. With this you can walk to the tile in front of the next rockfall, mine it, continue.

Edited by FrostBug
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...