- Joined
- Dec 18, 2014
- Messages
- 398
- Thread Author
- #1
Unfortunately, Defeat3d's tool is exclusively for OSRS.
I have been trying to extend or create a Web for several hours now, and still don't have a grasp of what exactly a Bidirectional Edge is, how it relates to the Web or even to a CoordinateVertex, or how a coordinate's isReachable affects webwalking. And many other things besides.
I and many future coders here would appreciate a conceptual explanation and an example of these things when the default web fails us.
My futile attempts at creating a web:
I have been trying to extend or create a Web for several hours now, and still don't have a grasp of what exactly a Bidirectional Edge is, how it relates to the Web or even to a CoordinateVertex, or how a coordinate's isReachable affects webwalking. And many other things besides.
I and many future coders here would appreciate a conceptual explanation and an example of these things when the default web fails us.
My futile attempts at creating a web:
Code:
private List<Coordinate> list;
private Web web;
private Collection<WebVertex> webList = new ArrayList<WebVertex>();
public void someMethod()
{
Area area = new Area.Polygonal(new Coordinate[]
{
new Coordinate(2779,2999,0),
new Coordinate(2774,3011,0),
new Coordinate(2870,3038,0),
new Coordinate(2875,3016,0)
});
list = area.getCoordinates();
for(Coordinate c : list)
{
CoordinateVertex v = new CoordinateVertex(c);
v.addBidirectionalEdge(new CoordinateVertex(c.derive(1, 0)));
v.addBidirectionalEdge(new CoordinateVertex(c.derive(0, 1)));
v.addBidirectionalEdge(new CoordinateVertex(c.derive(-1, 0)));
v.addBidirectionalEdge(new CoordinateVertex(c.derive(0, -1)));
webList.add(v);
}
web = Traversal.getDefaultWeb();
web.addVertices(webList);
}
@Override
public void onLoop()
{
Execution.delayUntil(() -> web.getPathBuilder().buildTo(Data.OBELISK).step(true));
stop();
}
// results in a NullPointer, most likely because the path specified by buildTo doesn't exist.