setTokenHillVBL: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Added description; fleshed out the rest of the page)
m (Added description; fleshed out the rest of the page)
 
(No difference)

Latest revision as of 23:59, 5 June 2023

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

setTokenHillVBL() Function

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

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

Usage

setTokenHillVBL(jsonarray)
setTokenHillVBL(jsonarray, id)

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

Token VBL of any kind 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.

The method parameter in the JSON object must use one of the following (a link is provided for descriptions of each):

Parameters

Example

Transfer Hill VBL from one token to another:
[h: vbl = getTokenVBL("Door, Steel")]
[h: setTokenHillVBL(vbl, "Door, Wood")]

Erase Hill VBL from a token:

[r: finalVblData = "{'shape':'none'}"]
[r: setTokenHillVBL(finalVblData)]

Auto-generate Hill VBL for the Current Token:

[h: options = json.set("{}", "shape", "auto", "sensitivity", 10, "inverse", 0, "level", 2, "method", "DOUGLAS_PEUCKER_SIMPLIFIER", "r", 0, "g", 0, "b", 0, "a", 255)]
[h: setTokenHillVBL(options)]

See Also