hooplako 0 Posted July 23, 2020 Context: I was using the Web Tool script to create a web of custom nodes. I added the variables: WebFinder webFinder AbstractWebNode[] webNodes as public static variables in my class and assigned the appropriate stuff in the onStart() method. I got rid of the "script." part when doing: webFinder = script.getWalking().getWebPathFinder(); in my onStart() method since it was giving me an error there. Problem: But when I call getWalking().walk(new Tile(number, number, number)) in a private method in main class my character doesn't walk anywhere. I checked if it should start walking through getWalking.shouldWalk(); and it's returning true. So idk what is going on.
TheCloakdOne 389 Posted July 23, 2020 The webtool should copy the nodes etc into your clipboard once you stop the script. Use that code and add it to something like below Try this, not sure if it will compile, was done off the top of my head.. private void registerPaths(AbstractScript ctx) { //the node closest to the entrance to our dungeon (edgeville trapdoor) AbstractWebNode node = ctx.getWalking().getWebPathFinder().getNearest(new Tile(3432, 3451), 15); AbstractWebNode webNode0 = new BasicWebNode(3432, 3451); AbstractWebNode webNode1 = new BasicWebNode(3432, 3451); AbstractWebNode webNode10 = new BasicWebNode(3419, 3424); node.addConnections(webNode1); //Join to node network webNode0.addConnections(webNode1); //Add in connections between nodes webNode1.addConnections(webNode10); WebFinder webFinder = ctx.getWalking().getWebPathFinder(); AbstractWebNode[] webNodes = {webNode0, webNode1, webNode10}; for (AbstractWebNode webNode : webNodes) { webFinder.addWebNode(webNode); //Add into web } }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.