futurepasts Posted January 5, 2016 Share Posted January 5, 2016 Hello so i wanted to draw my path for debugging resons cuz it sometimes doesn't work properly but don't know where to start i know how to draw my current location but how to draw my path? Thanks for help that i will hopefully get Quote Link to comment Share on other sites More sharing options...
progamerz Posted January 5, 2016 Share Posted January 5, 2016 Hello so i wanted to draw my path for debugging resons cuz it sometimes doesn't work properly but don't know where to start i know how to draw my current location but how to draw my path? Thanks for help that i will hopefully get Use explv location assitant or Divine Utility. Quote Link to comment Share on other sites More sharing options...
Explv Posted January 5, 2016 Share Posted January 5, 2016 Hello so i wanted to draw my path for debugging resons cuz it sometimes doesn't work properly but don't know where to start i know how to draw my current location but how to draw my path? Thanks for help that i will hopefully get You can use "Explv's Location Assistant" in the Other section, and just copy-paste your path, it will show on screen. Quote Link to comment Share on other sites More sharing options...
futurepasts Posted January 6, 2016 Author Share Posted January 6, 2016 No no i mean like when im using my own script i need onPaint method to draw my path to some kind of area or something like that Quote Link to comment Share on other sites More sharing options...
Explv Posted January 6, 2016 Share Posted January 6, 2016 (edited) No no i mean like when im using my own script i need onPaint method to draw my path to some kind of area or something like that Do you mean a predefined path? Or colour all the tiles that your player walks to? Edited January 6, 2016 by Explv Quote Link to comment Share on other sites More sharing options...
futurepasts Posted January 6, 2016 Author Share Posted January 6, 2016 Color all tiles to my path Quote Link to comment Share on other sites More sharing options...
Explv Posted January 6, 2016 Share Posted January 6, 2016 (edited) Do you mean a predefined path? Or colour all the tiles that your player walks to? Colouring every tile that your player walks to: private final List<Position> WALKED_POSITIONS = new ArrayList<>(); @Override public void onPaint(Graphics2D g){ updateWalkedPositions(); drawWalkedPositions(g); } private void updateWalkedPositions(){ if(!WALKED_POSITIONS.contains(myPosition())) WALKED_POSITIONS.add(myPosition()); } private void drawWalkedPositions(Graphics2D g){ for(Position position : WALKED_POSITIONS) fillPositionOnScreen(position, g); } private void fillPositionOnScreen(Position position, Graphics2D g){ Polygon polygon = position.getPolygon(script.getBot()); g.fillPolygon(polygon.xpoints, polygon.ypoints, polygon.npoints); } Edited January 6, 2016 by Explv Quote Link to comment Share on other sites More sharing options...
Joseph Posted January 6, 2016 Share Posted January 6, 2016 You can can draw your own position then all you do is the same logic but use a for loop and just loop through your array of position and display them Quote Link to comment Share on other sites More sharing options...