transferVBL: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Added example that clears VBL from token.)
mNo edit summary
Line 4: Line 4:
|trusted=true
|trusted=true
|version=1.4.2.0
|version=1.4.2.0
|description=directly transfers vbl from token to normal VBL if true, otherwise it transfers from VBL to token
|description=
Directly transfers VBL from token to the VBL layer if true; otherwise, it transfers from the VBL layer to the token.


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


This function can be used to transfer TOKEN VBL to NORMAL VBL or vice versa. 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 can be used to transfer TOKEN VBL to NORMAL VBL or vice versa. 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|value|The value of the setting to set:}}
{{param|value|The value of the setting to set:
{{param|(1)|transfer token (yellow) VBL to normal (blue) VBL}}
** {{code|0}} transfer normal (blue) VBL to token (yellow) VBL}}
{{param|(0)|transfer normal (blue) VBL to token (yellow) VBL}}
** {{code|1}} transfer token (yellow) VBL to normal (blue) VBL
{{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]].}}


 
|examples=
''Example: Transfer VBL from Token to Map''<source lang="mtmacro">
''Example: Transfer VBL from Token to Map''
<source lang="mtmacro">
[h:transferVBL(1, "Dragon")]
[h:transferVBL(1, "Dragon")]
[h:transferVBL(0)]
[h:transferVBL(0)]
</source><br />
</source>


''Example: Transfer VBL from Map to current Token''<source lang="mtmacro">
''Example: Transfer VBL from Map to current Token''
<source lang="mtmacro">
[h:transferVBL(0)]
[h:transferVBL(0)]
</source><br />
</source>


''Example: Clear VBL from Token after transfer''<source lang="mtmacro">
''Example: Clear VBL from Token after transfer''
<source lang="mtmacro">
[h:transferVBL(1)]
[h:transferVBL(1)]
[h: finalVblData = "{'shape':'none'}"]
[h: finalVblData = "{'shape':'none'}"]
[h: setTokenVBL(finalVblData)]  
[h: setTokenVBL(finalVblData)]  
</source><br />
</source>
 


|also=
|also=

Revision as of 04:59, 7 March 2019

transferVBL() Function

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

Introduced in version 1.4.2.0
Directly transfers VBL from token to the VBL layer if true; otherwise, it transfers from the VBL layer to the token.

Usage

transferVBL(value, id)

This function can be used to transfer TOKEN VBL to NORMAL VBL or vice versa. 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

  • value - The value of the setting to set:
    • 0 transfer normal (blue) VBL to token (yellow) VBL
    • 1 transfer token (yellow) VBL to normal (blue) VBL
  • id - OPTIONAL: The token id of the token for which you want to set this setting, defaults to the Current Token.

Examples

Example: Transfer VBL from Token to Map
[h:transferVBL(1, "Dragon")]
[h:transferVBL(0)]

Example: Transfer VBL from Map to current Token

[h:transferVBL(0)]

Example: Clear VBL from Token after transfer

[h:transferVBL(1)]
[h: finalVblData = "{'shape':'none'}"]
[h: setTokenVBL(finalVblData)]

See Also