Welcome!

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

Sign up now!
RuneMate will permanently shut down on August 7, 2026
due to events outside our control. You can continue using RuneMate until this date after which it will no longer be available. Thank you to everyone that contributed to RuneMate's success and to the community for the opportunity to serve you all these years.

  • Learn about RuneMate Vault and how its zero knowledge local encryption already protects your sensitive information.
  • Edit or delete your RuneMate account from your Account Settings.
  • All account upgrade subscriptions have been cancelled. No action required.

Resolved Custom Web issues

Joined
Sep 30, 2015
Messages
86
EDIT: Included a debug script at the bottom.

I've started creating my own Web for my API, and I cannot get it to work correctly. I'm currently trying to simply get Lodestones working.

2ND EDIT: Everything works perfectly if you switch vertex.addDirectedEdge(v, 25); to v.addDirectedEdge(vertext, 25);

Before:
Code:
    public void addLodestoneVertices() {
        for (Lodestone lodestone : Lodestone.values()) {
            LodestoneVertex vertex = new LodestoneVertex(lodestone);
            Coordinate c = lodestone.getPosition().derive(0, -1);
            WebVertex v = webCustom.getVertexNearestTo(c);
            if (v != null) {
                double dist = Distance.between(c, v.getPosition());
                if (dist < 3) {
                    vertex.addDirectedEdge(v, 25);
                    webCustom.addVertices(vertex);
                    debug("Added: " + lodestone);
                    debug(v.distanceTo(vertex));
                }
            }
        }
    }

After:
Code:
    public void addLodestoneVertices() {
        for (Lodestone lodestone : Lodestone.values()) {
            LodestoneVertex vertex = new LodestoneVertex(lodestone);
            Coordinate c = lodestone.getPosition().derive(0, -1);
            WebVertex v = webCustom.getVertexNearestTo(c);
            if (v != null) {
                double dist = Distance.between(c, v.getPosition());
                if (dist < 3) {
                    v.addDirectedEdge(vertex, 25);
                    webCustom.addVertices(vertex);
                    debug("Added: " + lodestone);
                    debug(v.distanceTo(vertex));
                }
            }
        }
    }

It appears to be using the lodestones like it should now, thanks @Aidden
 

Attachments

  • webCustomDebug.zip
    133.3 KB · Views: 6
Last edited:
Joined
Oct 24, 2015
Messages
7
Well I can't see anything wrong with the code , it's probably just an issue with the current web system.
Maybe an admin could respond and verify?..
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
7,468
Resolved. The edge was in the wrong direction. v.addDirectedEdge(vertex, 25) fixed the issue.
 
Top