HunterRS Posted September 14, 2017 Share Posted September 14, 2017 Is there a way to get all of the tiles in a certain radius that are valid for lighting fires on them? Quote Link to comment Share on other sites More sharing options...
liverare Posted September 14, 2017 Share Posted September 14, 2017 Yes. Firstly, you need to grab a bunch of tile data to work with. You can do this by creating a new Area object and using the getPositions function to get the tiles in that range. Then, you'll need to check those tiles' flags to see whether they can be walked on or not. You need to do this separately and still be able to filter out the 'bad tiles'. On 04/06/2015 at 4:03 PM, Khaleesi said: Here: static final int UNWALKABLE = 256 | 0x200000 | 0x40000; public static boolean isWalkable(int flag) { return (flag & (UNWALKABLE)) == 0; } XClippingPlane[] clippingPlanes = script.client.accessor.getClippingPlanes(); int[][] map = clippingPlanes[script.myPlayer().getZ()].getTileFlags(); Now just loop through all tiles and check them Khaleesi Not true, if you use the right values the shared flags won't matter. A tile where a door is on is always walkable. but you'll have to check other flags if you can pass from 1 tile to another. Example fence: you can stand on both tiles, 1 tile will hold info if the tile is blocked north,east,south,west. Khaleesi Thirdly, when you have all those 'walkable' tiles, you then need to figure out whether there are objects situated on those tiles. Objects such as cannons, flowers, fires, and others will prevent you from being able to light a fire in that spot. The MethodProvider has MethodProvider.objects, which links you to the Objects object. From there, you can use the Objects.get(x, y) function, or you could use a PositionFilter which filters out tiles that aren't occupied with 'bad objects.' I would chose the former, because your list of good tiles will work better if you can just check for objects at their coordinates. Quote Link to comment Share on other sites More sharing options...
HunterRS Posted September 14, 2017 Author Share Posted September 14, 2017 Looks simple enough, Ty very much Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.