Welcome!

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

Sign up now!

WebVertex help

Joined
Apr 22, 2015
Messages
21
I am trying to do some simple walking with the default web right now. I have read over the tutorials that cloud has posted about adding vertexs and stuff, but I am still a bit confused and my code does not seem to work right. I am simply trying to walk from Edgeville out into the wilderness. However to do so, there is the wall you have to jump over. This is the code I have so far:

Code:
Coordinate wildernessWallPosition = new Coordinate(3103, 3522, 0);
        BasicObjectVertex wildernessWall = new BasicObjectVertex(wildernessWallPosition, "Wilderness wall", "Cross");
        Traversal.getDefaultWeb().addVertices(wildernessWall);

However this doesn't work when I use the builder to get my path. It doesn't go anywhere close to the new object. I think I have to add a direct edge maybe, but I don't know how to go about doing that.

Thanks for reading and helping
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
There are two problems. One is that you're adding to the default web which is no longer supported. Functionality for that is being removed in the next release. The next problem is that you have to link your object vertex to another vertex that's in the web so that the path finding can connect them.
 
Joined
Apr 22, 2015
Messages
21
Since the default web is not longer supported, what is supported... or should I say how do I go about walking now? Every tutorial and resource I have found uses it so its what I was basing mine off of. I see now that in the debug window it says that it is getting removed.

Keeping with the default web, i tried adding:
wildernessWall.addDirectedEdge(new CoordinateVertex(new Coordinate(3103, 3520, 0)));

That coord is in the web, but it still does not work and tried to walk around the wall instead (which isnt possible)
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
Since the default web is not longer supported, what is supported... or should I say how do I go about walking now? Every tutorial and resource I have found uses it so its what I was basing mine off of. I see now that in the debug window it says that it is getting removed.

Keeping with the default web, i tried adding:
wildernessWall.addDirectedEdge(new CoordinateVertex(new Coordinate(3103, 3520, 0)));

That coord is in the web, but it still does not work and tried to walk around the wall instead (which isnt possible)
The default web can still be used, but it may not have any additions/subtractions made to it. If you want to do custom obstacles and such you must build a local web for the area. The reason that it's no longer supported is because path finding calculations have been moved (or rather are in the process of) being moved server-side. To expand on that, the web is also going to be being revamped soon to support more obstacles and teleports.

Edit: Also, bidirectional is what you should be using. But you also need to add that coordinate vertex to the web and link it to something else in your web.
 
Joined
Apr 22, 2015
Messages
21
Alright that makes sense. I got my walking to work for now. Thanks for the help Cloud!
 
So I am still having trouble with webs. I am trying to create my own web now just to better support the wilderness wall, but I can not get it to work. I used Alpha Web Extender to create a web on both sides of the wall and then saved it to a file. I then am using the following code to connect the two web portions together so the path builder can determine how to walk, but it is failing to create a path no matter where I stand (tried both sides of the wall in portions that should be part of the web). .

Code:
Coordinate wildernessWallPosition = new Coordinate(3103, 3522, 0);
        BasicObjectVertex wildernessWall = new BasicObjectVertex(wildernessWallPosition, "Wilderness wall", "Cross");
        //Spots that are jumped to
        CoordinateVertex v1 = new CoordinateVertex(new Coordinate(3103, 3520, 0)); //Side not in wildy
        CoordinateVertex v2 = new CoordinateVertex(new Coordinate(3103, 3523, 0)); //Side in wildy
        wildernessWall.addBidirectionalEdge(v1);
        wildernessWall.addBidirectionalEdge(v2);
        v1.addBidirectionalEdge(v1);
        v2.addBidirectionalEdge(v2);
        v1.addBidirectionalEdge(web.getVertexNearestTo(v1));
        v2.addBidirectionalEdge(web.getVertexNearestTo(v2));
        web.addVertices(v1, v2, wildernessWall);

I have loaded the web after adding the addition above back into Alpha Web Extender and it shows the connections, but even if I am on the wildy side of the wall it does not generate a path to the abyss mage. I am really at a complete loss as to why it is always returning null when i try to generate a path.
 
Top