Thread: Token IDs [5E, FGU]
-
June 5th, 2021, 16:32 #1
Token IDs [5E, FGU]
I override getDistanceBetween in my Token Height extension, but originally was just looking at both arguments being tokens. bmos was kind enough to extend that to handle points as well, but also found that tokenids are valid arguments as well:
Code:function getDistanceBetween(token OR tokenid OR point, token OR tokenid OR point)
-
June 5th, 2021, 16:35 #2
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,561
If the value being passed into the API is:
* A "tokeninstance" data object - Use the data object
* A simple number value - Assume token ID; attempt to look up token ID on current image control; use that token object if found
* A table with two values (or x/y values) - Assume point; use in distance calculation
Regards,
JPG
-
June 5th, 2021, 17:47 #3
Thanks - that's nice and straightforward. I was overthinking it. Do you know off the top of your head anything that would call getDistanceBetween with tokenids so I can test it out in real life?
-
June 7th, 2021, 01:28 #4
Supreme Deity
- Join Date
- Mar 2007
- Posts
- 20,561
It was more of a parameter thrown in to allow information to be stored asynchronously based on token ID; since token instances would only be valid in synchronous scenarios. You can always test by using tokeninstance.getId(); if you really want to try it out.
Regards,
JPG
-
June 7th, 2021, 02:39 #5
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks