Jump to content

How would I detect obstacles on a path


lisabe96

Recommended Posts

Imagine that I want to run from lumbridge castle to the cows.

 

IF you try to make a path to inside the cows area, the pathfinder will give you a path through the gate IF it's open.

When the gate is not open, the pathfinder won't be able to get in and get stuck.

 

I want to work out a general approach where the pathfinder would ignore that the gate is closed so I can codewise intercept it and handle it. However the pathfinder doesn't know that there's a gate when it's closed, it just treats it as an area where it can not pass/get in.

 

I'm looking for ideas on how I could get doors/gates and let the pathfinder ignore it.

Not looking for spoonfedding, I can work it out myself if only I had a lead.

 

Thanks in advance for any help towards this.

Link to comment
Share on other sites

i think it's like getWalking().canReach();

or getMap().canReach();

something with canReach...

That won't tell us anything about any object's on the path, only that it can't be reached.

But if you put 4 walls without a door, it won't be able to reach it either, we have no clue about any obstacles on why we can't reach it.

Link to comment
Share on other sites

That won't tell us anything about any object's on the path, only that it can't be reached.

But if you put 4 walls without a door, it won't be able to reach it either, we have no clue about any obstacles on why we can't reach it.

I think he meant, since you clearly now where this obstacle is, You could do a can reach to the middle of the field.

If you can, walk there.

If you can't, walk towards the gate and open it.

Edited by Isolate
Link to comment
Share on other sites

I think he meant, since you clearly now where this obstacle is, You could do a can reach to the middle of the field.

If you can, walk there.

If you can't, walk towards the gate and open it.

That's what I'm doing now, and sure it works great. But for my AI project I want to build a more general approach where we don't need to know the specific situation.

Where I could send my bot to random coordinates and it would handle the obstacles it comes across.

I would be able to write the code for that, I just need to find out what I mentioned in my original post.

How do I let the pathfinder ignore obstacles and how do I know which kind of obstacle it is.

Edited by lisabe96
Link to comment
Share on other sites

I want to find out why we can't reach it, what obstacle is stopping us from reaching the position is what I want to know

 

 

doorHandler.getNextObstacle(Entity or Position); //Returns an RS2Object

 

doorHandler.getObstacles(); //List of RS2Objects

 

Take a look at the api, it's all there ! 

 

http://osbot.org/api/org/osbot/rs07/api/DoorHandler.html#getNextObstacle(org.osbot.rs07.api.model.Entity)

Link to comment
Share on other sites

doorHandler.getNextObstacle(Entity or Position); //Returns an RS2Object

 

doorHandler.getObstacles(); //List of RS2Objects

 

Take a look at the api, it's all there ! 

 

http://osbot.org/api/org/osbot/rs07/api/DoorHandler.html#getNextObstacle(org.osbot.rs07.api.model.Entity)

Thanks! Looks like this might be what I'm looking for at first glance.

Will check it out tomorrow, it's far past bed time im out ph34r.png

Link to comment
Share on other sites

Overcoming obstacles isnt a 5 second scripting task. 

If you want to include a robust obstacle handler in your scripts, it will take quite some time to write. 

You will need to use collision flags and detect the type of obstacle blocking you, and what needs to be done to overcome it. 

There is some old example code to get you started, if I feel unlazy later I will find it and link it here. Otherwise, maybe someone else will. It was a simple obstacle handler written by Maxi. 

Link to comment
Share on other sites

Overcoming obstacles isnt a 5 second scripting task. 

If you want to include a robust obstacle handler in your scripts, it will take quite some time to write. 

You will need to use collision flags and detect the type of obstacle blocking you, and what needs to be done to overcome it. 

There is some old example code to get you started, if I feel unlazy later I will find it and link it here. Otherwise, maybe someone else will. It was a simple obstacle handler written by Maxi.

That's what the door handler class is mainly built out of.
Link to comment
Share on other sites

Overcoming obstacles isnt a 5 second scripting task. 

If you want to include a robust obstacle handler in your scripts, it will take quite some time to write. 

You will need to use collision flags and detect the type of obstacle blocking you, and what needs to be done to overcome it. 

There is some old example code to get you started, if I feel unlazy later I will find it and link it here. Otherwise, maybe someone else will. It was a simple obstacle handler written by Maxi. 

I know it's not a simple task, but I've written whole RSPS's from scratch so I'm confident that I could work something out.

Ill take a look to the doorhandler tonight and see what I can come up with

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...