getTokenVBL: Difference between revisions
Jump to navigation
Jump to search
m (Conversion script moved page GetTokenVBL to getTokenVBL: Converting page titles to lowercase) |
m (Text replacement - "source>" to "syntaxhighlight>") |
||
Line 9: | Line 9: | ||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
getTokenVBL(id) | getTokenVBL(id) | ||
</ | </syntaxhighlight> | ||
This macro function is used used to get a JSON object describing the TOKEN VBL attached to a token. The returned JSON object can then be used with {{func|setTokenVBL}}, {{func|drawVBL}}or {{func|eraseVBL}}. | This macro function is used used to get a JSON object describing the TOKEN VBL attached to a token. The returned JSON object can then be used with {{func|setTokenVBL}}, {{func|drawVBL}}or {{func|eraseVBL}}. | ||
Line 21: | Line 21: | ||
[h: vbl = getTokenVBL("Door, Steel")] | [h: vbl = getTokenVBL("Door, Steel")] | ||
[h: setTokenVBL(vbl, "Door, Wood")] | [h: setTokenVBL(vbl, "Door, Wood")] | ||
</ | </syntaxhighlight><br /> | ||
|also= | |also= |
Revision as of 20:39, 14 March 2023
getTokenVBL() Function
Note: This function can only be used in a Trusted Macro
• Introduced in version 1.4.1.6
Gets the VBL attached to a token as a JSON object.
Usage
<source lang="mtmacro" line> getTokenVBL(id) </syntaxhighlight>
This macro function is used used to get a JSON object describing the TOKEN VBL attached to a token. The returned JSON object can then be used with setTokenVBL(), drawVBL()or eraseVBL().
Token VBL is attached to and moves with the token. It can be set (or cleared) under the VBL tab on the Edit Token dialog and is colored YELLOW. Normal VBL is static, can be created with the VBL drawing tools or with the use of VBL functions and is colored BLUE.
Parameters
id
- OPTIONAL: The tokenid
of the token for which you want to get the VBL. Defaults to the Current Token.
Example:<source lang="mtmacro">
[h: vbl = getTokenVBL("Door, Steel")]
[h: setTokenVBL(vbl, "Door, Wood")]
</syntaxhighlight>