setTokenVBL: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Created page with "{{MacroFunction |name=setTokenVBL |proposed=false |trusted=true |version=1.4.1.6 |description=sets the VBL of a token to that given as a parameter |usage= <source lang="mtmac...")
 
(Expanded on text and links to other VBL funcs.)
Line 4: Line 4:
|trusted=true
|trusted=true
|version=1.4.1.6
|version=1.4.1.6
|description=sets the VBL of a token to that given as a parameter
|description=Sets the VBL of a token to that given in the JSON object parameter.


|usage=
|usage=
Line 11: Line 11:
</source>
</source>


This function can be used to transfer TOKEN VBL to a different token. Token VBL moves with the token, can be set under the VBL tab on the token edit menu 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.
This function is used to attach the TOKEN VBL passed in as a JSON object to a token.  The JSON object may be be created by calling {{func|getTokenVBL}} on a different token and may also be used with {{func|drawVBL}} or {{func|eraseVBL}}.
 
Token VBL moves with the token, can be set under the VBL tab on the token edit menu 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'''
'''Parameters'''
{{param|vbl|A JSON object containing the {{code|vbl}} to be added to the token.  Use {{func|getTokenVBL}} to get VBL from another token. }}
{{param|vbl|A JSON object containing the {{code|vbl}} to be added to the token.  Use {{func|getTokenVBL}} to get VBL from another token. }}
{{param|id|OPTIONAL: The token {{code|id}} of the token for which you want to set this setting, defaults to the [[Current Token]]. }}
{{param|id|OPTIONAL: The token {{code|id}} of the token for which you want to set this setting, defaults to the [[Current Token]]. }}


''Example:''<source lang="mtmacro">
''Example:''<source lang="mtmacro">
Line 25: Line 25:


|also=
|also=
[[Introduction to Vision Blocking ]], {{func|getTokenVBL}}
[[Introduction to Vision Blocking ]], {{func|getTokenVBL}}, {{func|drawVBL}}, {{func|eraseVBL}}
}}
}}
[[Category:Miscellaneous Function]]
[[Category:Miscellaneous Function]]
[[Category:VBL Function]]
[[Category:VBL Function]]

Revision as of 21:29, 20 August 2018

setTokenVBL() Function

 Note: This function can only be used in a Trusted Macro

Introduced in version 1.4.1.6
Sets the VBL of a token to that given in the JSON object parameter.

Usage

setTokenVBL(vbl, id)

This function is used to attach the TOKEN VBL passed in as a JSON object to a token. The JSON object may be be created by calling getTokenVBL() on a different token and may also be used with drawVBL() or eraseVBL().

Token VBL moves with the token, can be set under the VBL tab on the token edit menu 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

  • vbl - A JSON object containing the vbl to be added to the token. Use getTokenVBL() to get VBL from another token.
  • id - OPTIONAL: The token id of the token for which you want to set this setting, defaults to the Current Token.

Example:

[h: vbl = getTokenVBL("Door, Steel")]
[h: setTokenVBL(vbl, "Door, Wood")]



See Also