ranarrthings 0 Share Posted November 28, 2018 Used this: Tool works and the path is added when i look at the web node debug however the path is not connected to the main web. How do i link the nodes to the preexisting web? Also, how is the shortest walking path calculated? is it the least amount of nodes to destination or total length between nodes. Link to comment Share on other sites More sharing options...
Neffarion 485 Share Posted November 28, 2018 If you don't want to check the nodes id's you can use this to get the nearest web-node of a tile, then you just connect to your web Tile tileWithWebNode = new Tile(0,0,0); int searchRadius = 5; AbstractWebNode existingWebNode = ctx.getWalking().getWebPathFinder().getNearest(tileWithWebNode, searchRadius); // Now connect it to your own webnode (myNode) if(existingWebNode != null) { existingWebNode.addConnections(myNode); } // Then add and apply your node (myNode) to the web path finder getWalking().getWebPathFinder().addWebNode(myNode); Shortest walking path is calculated using A* on the web nodes if you are not local to the region you want to go. Otherwise it uses A* on local tiles Link to comment Share on other sites More sharing options...
ranarrthings 0 Author Share Posted November 29, 2018 18 hours ago, Neffarion said: If you don't want to check the nodes id's you can use this to get the nearest web-node of a tile, then you just connect to your web Tile tileWithWebNode = new Tile(0,0,0); int searchRadius = 5; AbstractWebNode existingWebNode = ctx.getWalking().getWebPathFinder().getNearest(tileWithWebNode, searchRadius); // Now connect it to your own webnode (myNode) if(existingWebNode != null) { existingWebNode.addConnections(myNode); } // Then add and apply your node (myNode) to the web path finder getWalking().getWebPathFinder().addWebNode(myNode); Shortest walking path is calculated using A* on the web nodes if you are not local to the region you want to go. Otherwise it uses A* on local tiles AbstractWebNode webNode0 = new BasicWebNode(3032, 3831); AbstractWebNode webNode1 = new BasicWebNode(3034, 3828); AbstractWebNode webNode10 = new BasicWebNode(3122, 3835); AbstractWebNode webNode11 = new BasicWebNode(3130, 3837); AbstractWebNode webNode12 = new BasicWebNode(3137, 3845); AbstractWebNode webNode13 = new BasicWebNode(3149, 3849); AbstractWebNode webNode2 = new BasicWebNode(3040, 3822); AbstractWebNode webNode3 = new BasicWebNode(3050, 3822); AbstractWebNode webNode4 = new BasicWebNode(3059, 3822); AbstractWebNode webNode5 = new BasicWebNode(3069, 3821); AbstractWebNode webNode6 = new BasicWebNode(3080, 3817); AbstractWebNode webNode7 = new BasicWebNode(3089, 3818); AbstractWebNode webNode8 = new BasicWebNode(3095, 3822); AbstractWebNode webNode9 = new BasicWebNode(3112, 3825); webNode0.addConnections(webNode1); webNode1.addConnections(webNode0); webNode1.addConnections(webNode2); webNode10.addConnections(webNode11); webNode10.addConnections(webNode9); webNode11.addConnections(webNode10); webNode11.addConnections(webNode12); webNode12.addConnections(webNode11); webNode12.addConnections(webNode13); webNode13.addConnections(webNode12); webNode2.addConnections(webNode1); webNode2.addConnections(webNode3); webNode3.addConnections(webNode2); webNode3.addConnections(webNode4); webNode4.addConnections(webNode3); webNode4.addConnections(webNode5); webNode5.addConnections(webNode4); webNode5.addConnections(webNode6); webNode6.addConnections(webNode5); webNode6.addConnections(webNode7); webNode7.addConnections(webNode6); webNode7.addConnections(webNode8); webNode8.addConnections(webNode7); webNode8.addConnections(webNode9); webNode9.addConnections(webNode10); webNode9.addConnections(webNode8); AbstractWebNode existingNode0 = getWalking().getWebPathFinder().getNearest(webNode0, 10); AbstractWebNode existingNode1 = getWalking().getWebPathFinder().getNearest(webNode13, 10); existingNode0.addConnections(webNode0); existingNode1.addConnections(webNode13); WebFinder webFinder = getWalking().getWebPathFinder(); AbstractWebNode[] webNodes = {webNode13, webNode12, webNode11, webNode10, webNode9, webNode8, webNode7, webNode6, webNode5, webNode4, webNode3, webNode2, webNode1, webNode0}; for (AbstractWebNode webNode : webNodes) { webFinder.addWebNode(webNode); } The path is added and is connected on the web debug however if i stand my character anywhere on the new path, the bot just idles and does not know where to click. For context, the preexisting web path was taking a much longer route than needed so im attempting to add a shortcut that re connects to the main web on both ends. If i stand the bot anywhere on the main web it will continue to take the longer path even with the new path added. Link to comment Share on other sites More sharing options...
Sicilian7 9 Share Posted November 13, 2019 I'm having this exact same issue. Any experts got any tips about this? Link to comment Share on other sites More sharing options...
Hyper Crusher 4 Share Posted November 13, 2019 12 hours ago, Sicilian7 said: I'm having this exact same issue. Any experts got any tips about this? Have you turned on Debug Web nodes to make sure they are showing up in the mini-map? Also remember that the webWalker only works on Z index of 0 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.