token.label: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Macros:Special Variables:token.label moved to token.label: Moved to main namespace.)
No edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The variable ''token.label'' allows programmatic querying and setting of the token's [[Token:Token_label|Label]] (the third text field in the screenshot of the Edit Token dialog).  
The variable ''token.label'' allows programmatic querying and setting of the token's [[Introduction to Tokens|Label]] (the third text field in the screenshot of the Edit Token dialog).  


[[Image:Edittoken-name-and-label.jpg]]
[[Image:Edittoken-name-and-label.jpg]]
Line 6: Line 6:


===Getting the Token Label===
===Getting the Token Label===
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
Token Name: [token.label]
Token Name: [token.label]
</source>
</syntaxhighlight>


Outputs the value of ''token.label''.
Outputs the value of ''token.label''.


===Setting the Token Label===
===Setting the Token Label===
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h:token.label = "Random Passerby"]
[h:token.label = "Random Passerby"]
</source>
</syntaxhighlight>


Sets the value of ''token.label'' to "Random Passerby".
Sets the value of ''token.label'' to "Random Passerby".
Line 21: Line 21:
==Related Pages==
==Related Pages==


* [[Macros:Special_Variables:token.gm_name|token.gm_name]]
* [[token.gm_name]]
* [[Macros:Special_Variables:token.name|token.name]]
* [[token.name]]
* [[Macros:Variables:list_of_special_variables|List of Special Variables]]
[[Category:Special Variable]]
[[Category:Macro Function]]

Latest revision as of 23:59, 4 July 2023

The variable token.label allows programmatic querying and setting of the token's Label (the third text field in the screenshot of the Edit Token dialog).

Examples

Getting the Token Label

Token Name: [token.label]

Outputs the value of token.label.

Setting the Token Label

[h:token.label = "Random Passerby"]

Sets the value of token.label to "Random Passerby".

Related Pages