getTokens method, with Area condition not working

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: Azhrei, dorpond, trevor

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
xavram
Dragon
Posts: 808
Joined: Tue Apr 20, 2010 8:22 pm

getTokens method, with Area condition not working

Post by xavram »

I'm passing this as the json Conditions into a getTokens call

{"area":{"offsets":[{"x":0,"y":1},{"x":0,"y":6}],"token":"150DA58A51314F15A1CBFE34835AC70B"},"visible":1,"npc":0,"pc":1}

So on a square map, this works. It returns any tokens in the 6 cells directly to the south of the specified token, that are visible and PCs.

This is called in different ways and seems to work to get any PC/Visible tokens to the North/West/East of the token, assuming the "offsets" are changed accordingly.

But if I call this on an Isometric map...it doesn't work. Even though I can see that there are valid, visible tokens in that area.

Any ideas?

xavram
Dragon
Posts: 808
Joined: Tue Apr 20, 2010 8:22 pm

Re: getTokens method, with Area condition not working

Post by xavram »

Actually...hmmm...it seems taht it does work, but just for the tokens directly next to the one referenced in in the Cond Json. But since that goes from an offset of 1 to an offset of 6, shouldn't that be ALL tokens in that area of 6 cells?

Phergus
Deity
Posts: 7108
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: getTokens method, with Area condition not working

Post by Phergus »

The docs suggest that you have to specify every cell:
offsets - A JSON array of JSON objects that specify each individual cell that make up the area.
Wiki: getTokens()

xavram
Dragon
Posts: 808
Joined: Tue Apr 20, 2010 8:22 pm

Re: getTokens method, with Area condition not working

Post by xavram »

Doh! That would explain it, let me re-write this to include all the cells in the range, in the condition...thanks!

Post Reply

Return to “MapTool”