canSeeToken: Difference between revisions
Jump to navigation
Jump to search
Jfrazierjr (talk | contribs) No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{MacroFunction | {{MacroFunction | ||
|name=canSeeToken | |name=canSeeToken | ||
|version=1.3b77 | |version=1.3b77 | ||
|description= | |description= | ||
Returns a json array of the points visible on the token as an enumerated list. | Returns a json array of the points visible on the target token from the source token as an enumerated list. Default source is [[Current Token]]. The enumerated list will contain zero to five of the following values: | ||
*TOP_RIGHT | *TOP_RIGHT | ||
*BOTTOM_RIGHT | *BOTTOM_RIGHT | ||
Line 13: | Line 12: | ||
When a token is not visible, an empty json array is returned: '[]' | When a token is not visible, an empty json array is returned: '[]' | ||
canSeeToken() | |usage= | ||
<source lang="mtmacro"> | |||
canSeeToken(target) | |||
canSeeToken(target, source) | |||
</source> | |||
'''Parameters''' | |||
{{param|target|Either the token ID or name of the target token.}} | |||
{{param|source|Either the token ID or name of the source, i.e. viewing token.}} | |||
|example= | |||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
canSeeToken( | <!-- Dragon token partially hidden by VBL from current token. --> | ||
[r: canSeeToken("Dragon")] | |||
<!-- Troll token completely hidden from Elf token. --> | |||
[r: canSeeToken("Troll","Elf")] | |||
<!-- Troll token visible to Hero token. --> | |||
[r: canSeeToken("Troll","Token")] | |||
</source> | |||
Returns: | |||
<source lang="javascript"> | |||
["TOP_LEFT", "TOP_RIGHT", "CENTER"] | |||
[] | |||
["TOP_LEFT", "BOTTOM_LEFT", "TOP_RIGHT", "BOTTOM_RIGHT", "CENTER"] | |||
</source> | </source> | ||
|also= | |||
|changes= | |||
}} | }} | ||
[[Category:Sight Function]] | [[Category:Sight Function]] | ||
[[Category:Token Function]] | [[Category:Token Function]] |
Revision as of 16:30, 17 August 2019
canSeeToken() Function
• Introduced in version 1.3b77
Returns a json array of the points visible on the target token from the source token as an enumerated list. Default source is Current Token. The enumerated list will contain zero to five of the following values:
- TOP_RIGHT
- BOTTOM_RIGHT
- TOP_LEFT
- BOTTOM_LEFT
- CENTER
Usage
canSeeToken(target)
canSeeToken(target, source)
Parameters
target
- Either the token ID or name of the target token.source
- Either the token ID or name of the source, i.e. viewing token.
Example
<!-- Dragon token partially hidden by VBL from current token. -->
[r: canSeeToken("Dragon")]
<!-- Troll token completely hidden from Elf token. -->
[r: canSeeToken("Troll","Elf")]
<!-- Troll token visible to Hero token. -->
[r: canSeeToken("Troll","Token")]
Returns:
["TOP_LEFT", "TOP_RIGHT", "CENTER"]
[]
["TOP_LEFT", "BOTTOM_LEFT", "TOP_RIGHT", "BOTTOM_RIGHT", "CENTER"]