init.round: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(Created page with "The special variable ''init.round'' holds the current Initiative round beginning at {{code|1}}. '''init.round''' is set to {{code|-1}} if there are no tokens in the Initiative...")
 
No edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 3: Line 3:
==Example==
==Example==
'''Simple Count'''
'''Simple Count'''
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[if(init.current != -1), code: {
[if(init.current != -1), code: {
[h: json = getInitiativeList()]
[h: json = getInitiativeList()]
Line 13: Line 13:
No token with initiative.
No token with initiative.
}]
}]
</source>
</syntaxhighlight>


==Related Pages==
==Related Pages==
Line 20: Line 20:


[[Category:Special Variable]]
[[Category:Special Variable]]
Pages with ignored display titles

Latest revision as of 20:01, 4 July 2023

The special variable init.round holds the current Initiative round beginning at 1. init.round is set to -1 if there are no tokens in the Initiative window.

Example

Simple Count

[if(init.current != -1), code: {
	[h: json = getInitiativeList()]
	[h: tarray = json.get(json,"tokens")]
	[h: tok = json.get(tarray,init.current)]
	Token with Initiative: [r: getName(json.get(tok,"tokenId"))]<br>
	Initiative Round: [r: init.round]
};{
	No token with initiative.
}]

Related Pages

Initiative Functions Pages with ignored display titles