token.initHold: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: The variable ''token.initHold'' is a binary variable that indicates whether a token in the Initiative Panel is on hold, or is part of the normal initiative ...)
 
No edit summary
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The variable ''token.initHold'' is a binary variable that indicates whether a token in the [[Initiative:initiative_panel|Initiative Panel]] is on hold, or is part of the normal initiative cycle. ''token.initHold'' can take a value of 1 (token is on hold) or 0 (token is not on hold).  
The variable ''token.initHold'' is a binary variable that indicates whether a token in the [[Introduction to Initiative|Initiative Panel]] is on hold, or is part of the normal initiative cycle. ''token.initHold'' can take a value of 1 (token is on hold) or 0 (token is not on hold).  


==Usage==
==Usage==


<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
Token's Hold Status: [token.initHold]
[token.initHold = value]
</source>
</syntaxhighlight>


Returns 1 if the token is currently on hold, and 0 if the token is not on hold.
Where ''value'' is either 1 or 0.


==Example==
==Example==


<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h:status=input(
[h:status=input(
     "hold|Yes,No|Put token on hold in initiative order?|RADIO|SELECT=0 ORIENT=H VALUE=STRING"
     "hold|Yes,No|Put token on hold in initiative order?|RADIO|SELECT=0 ORIENT=H VALUE=STRING"
Line 18: Line 18:


[h:token.initHold = if(hold=="Yes", 1, 0)]
[h:token.initHold = if(hold=="Yes", 1, 0)]
</source>
</syntaxhighlight>


Presents the following dialog using the [[Macros:Functions:input|input()]] function:
Presents the following dialog using the [[Macros:Functions:input|input()]] function:
Line 24: Line 24:
[[Image:InitHold-example.jpg]]
[[Image:InitHold-example.jpg]]


and, based on the user's selection, sets ''token.initHold'' to either 1 or 0. When this macro is executed, the token's image or line in the [[Initiative:initiative_panel|Initiative Panel]] will be altered to reflect its new status.  
and, based on the user's selection, sets ''token.initHold'' to either 1 or 0. When this macro is executed, the token's image or line in the [[Introduction to Initiative|Initiative Panel]] will be altered to reflect its new status.  


==Related Pages==
==Related Pages==


* [[Initiative:initiative_panel|Initiative Panel]]
* [[Introduction to Initiative|Initiative Panel]]
* [[Macros:Special_Variables:token.init|token.init]]
* [[token.init]]
* [[Macros:Variables:list_of_special_variables|List of Special Variables]]
[[Category:Special Variable]]
[[Category:Macro Function]]

Latest revision as of 20:07, 4 July 2023

The variable token.initHold is a binary variable that indicates whether a token in the Initiative Panel is on hold, or is part of the normal initiative cycle. token.initHold can take a value of 1 (token is on hold) or 0 (token is not on hold).

Usage

[token.initHold = value]

Where value is either 1 or 0.

Example

[h:status=input(
    "hold|Yes,No|Put token on hold in initiative order?|RADIO|SELECT=0 ORIENT=H VALUE=STRING"
    )]
[h:abort(status)]

[h:token.initHold = if(hold=="Yes", 1, 0)]

Presents the following dialog using the input() function:

and, based on the user's selection, sets token.initHold to either 1 or 0. When this macro is executed, the token's image or line in the Initiative Panel will be altered to reflect its new status.

Related Pages