setTokenHillVBL
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
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):
DOUGLAS_PEUCKER_SIMPLIFIER
(see Wikipedia),TOPOLOGY_PRESERVING_SIMPLIFIER
(see sample Java implementation notes),VW_SIMPLIFIER
(see Wikipedia), orNONE
.
Parameters
vbl
- A JSON object containing the VBL to be added to the token. Use getTokenVBL(), getTokenHillVBL(), or getTokenPitVBL() to get VBL from another token.id
- OPTIONAL: The tokenid
which becomes the container for the Hill VBL being set. Defaults to the Current Token.
Example
[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)]