PDA

View Full Version : image.getTokensWithinDistance with point



GKEnialb
January 6th, 2023, 17:43
I was trying to use image.getTokensWithinDistance({x = startX, y = startY}, d) in order to get the tokens on either end of the targeting arrow. I figured I could use a small value for d since the tokens should be spot-on, so started with a fraction, then 1, then 5, and so on, but it kept returning nil. Eventually I used 100 which returned the token furthest away from the coordinates. Finally bumped it to 150, which returned all tokens (and was bigger than the map). I tried using image.getTokensWithinDistance({startX, startY}, d) with identical results.

Just to test, I found the token at those coordinates and used image.getTokensWithinDistance(token, d) - that worked exactly as expected.

Using 5E ruleset, a gridsize of 50, units of 5', and a map that's 150' square.

Moon Wizard
January 8th, 2023, 08:14
Thanks for reporting. I'll look at getting a fix into the next client release.

Regards,
JPG

GKEnialb
January 9th, 2023, 01:37
Awesome. Thanks so much.