Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Creating/Extending a Web (RS3)

Joined
Dec 18, 2014
Messages
398
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:
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.
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
The general concept is that the web is a graph. Each vertex is a graph element and to signify that you can move between two elements on the graph you have to connect them in an edge. A bidirectional edge specifies that you can traverse from A to B and B to A, while a single directional edge is simply from A to B.
 
Top