transferPitVBL: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page TransferPitVBL to transferPitVBL: Converting page titles to lowercase)
m (Added description; fleshed out the rest of the page)
 
Line 2: Line 2:
{{MacroFunction
{{MacroFunction
|name=transferPitVBL
|name=transferPitVBL
|proposed=false
|trusted=true
|version=1.12
|version=1.12
|description=
|description=
Directly transfers Pit VBL from token to the Pit VBL layer if {{code|true}}; otherwise, it transfers from the Pit VBL layer to the token's Pit VBL.


|usage=
|usage=
<syntaxhighlight lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
transferPitVBL(direction)
transferPitVBL(direction)
transferPitVBL(direction, delete)
transferPitVBL(direction, id)
transferPitVBL(direction, delete, id)
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang="mtmacro" line>
This function can be used to transfer token Pit VBL to normal Pit VBL, or vice versa. Token VBL moves with the token, can be set under the VBL tab on the Token Editor Dialog, and is colored YELLOW.  Normal VBL is static, can be created with the VBL drawing tools, or with the use of the VBL functions, and is colored BLUE.
transferPitVBL(direction, id)
 
'''Parameters'''
{{param| direction |This value can be:
** {{code|0}} transfer normal (blue) Pit VBL to token (yellow) Pit VBL
** {{code|1}} transfer token (yellow) Pit VBL to normal (blue) Pit VBL}}
{{param|delete|Defines if the transferred Pit VBL is deleted from the source.}}
{{param|id|OPTIONAL: The token {{code|id}} of the token being acted upon. Defaults to the [[Current Token]].}}
 
|examples=
''Example: Transfer Pit VBL from Token to Map''
<syntaxhighlight lang="mtmacro">
[h: transferPitVBL(1, "Dragon")]
[h: transferPitVBL(0)]
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang="mtmacro" line>
''Example: Transfer Pit VBL from Map to current Token''
transferPitVBL(direction, delete, id)
<syntaxhighlight lang="mtmacro">
[h: transferPitVBL(0)]
</syntaxhighlight>
</syntaxhighlight>


'''Parameters'''
''Example: Clear Pit VBL from Token after transfer''
{{param|direction|}}
<syntaxhighlight lang="mtmacro">
{{param|delete|}}
[h: transferPitVBL(1, 1)]
{{param|id|}}
</syntaxhighlight>


|also=
[[Introduction to Vision Blocking]], {{func|erasePitVBL}}, {{func|drawPitVBL}}, {{func|setTokenPitVBL}}
}}
}}
[[Category:Miscellaneous Function]]
[[Category:VBL Function]]
[[Category:VBL Function]]

Latest revision as of 03:54, 5 June 2023

 This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.

transferPitVBL() Function

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

Introduced in version 1.12
Directly transfers Pit VBL from token to the Pit VBL layer if true; otherwise, it transfers from the Pit VBL layer to the token's Pit VBL.

Usage

transferPitVBL(direction)
transferPitVBL(direction, delete)
transferPitVBL(direction, id)
transferPitVBL(direction, delete, id)

This function can be used to transfer token Pit VBL to normal Pit VBL, or vice versa. Token VBL moves with the token, can be set under the VBL tab on the Token Editor Dialog, and is colored YELLOW. Normal VBL is static, can be created with the VBL drawing tools, or with the use of the VBL functions, and is colored BLUE.

Parameters

  • direction - This value can be:
    • 0 transfer normal (blue) Pit VBL to token (yellow) Pit VBL
    • 1 transfer token (yellow) Pit VBL to normal (blue) Pit VBL
  • delete - Defines if the transferred Pit VBL is deleted from the source.
  • id - OPTIONAL: The token id of the token being acted upon. Defaults to the Current Token.

Examples

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

Example: Transfer Pit VBL from Map to current Token

[h: transferPitVBL(0)]

Example: Clear Pit VBL from Token after transfer

[h: transferPitVBL(1, 1)]

See Also