removeFromInitiative: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function removeFromInitiative== Removes the Token:Current Token from the Initiative:Initiative Panel. ===Usage=== <source lang="mtmacro" line> [h: removeFromInitiative(n...)
 
No edit summary
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
==Function removeFromInitiative==
{{MacroFunction
|name=removeFromInitiative
|description=
Removes the [[Current Token]] from the [[Introduction to Initiative|Initiative Panel]]. Additional parameters allow you to specify the token.
   
|usage=
<syntaxhighlight lang="mtmacro" line>
removeFromInitiative()
removeFromInitiative(tokenRef)
removeFromInitiative(tokenRef, mapname)
</syntaxhighlight>
 
'''Parameters'''
{{param|tokenRef|Either the token [[getSelected|{{code|id}}]] or [[getTokenName|Token Name]] of the token to be removed from the initiative.  Defaults to the [[Current Token]]. {{TrustedParameter}} }}
{{param|mapname|The name of the map to find the token.  Defaults to the current map.}}
* {{code|return}} - Returns 1 if removed from the initiative, 0 if did not.
{{Note|Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.}}
 
|example=
To remove the token with the name "Dragon" in current map from the [[Introduction to Initiative|initiative panel]].
 
<syntaxhighlight lang="mtmacro" line>
[h: removeFromInitiative("Dragon")]
</syntaxhighlight>


Removes the [[Token:Current Token|Current Token]] from the [[Initiative:Initiative Panel|Initiative Panel]].
|also=
   
[[addToInitiative | addToInitiative()]] [[removeAllFromInitiative | removeAllFromInitiative()]] [[removeAllNPCsFromInitiative | removeAllNPCsFromInitiative()]] [[removeAllPCsFromInitiative | removeAllPCsFromInitiative()]]
 
|changes=
{{change|1.5.7|Added {{code|id}} and {{code|mapname}} parameter options.}}


===Usage===
}}
<source lang="mtmacro" line>
[[Category:Initiative Function]]
[h: removeFromInitiative(num, num, ...)]
</source>

Latest revision as of 21:19, 17 May 2024

removeFromInitiative() Function

Removes the Current Token from the Initiative Panel. Additional parameters allow you to specify the token.

Usage

removeFromInitiative()
removeFromInitiative(tokenRef)
removeFromInitiative(tokenRef, mapname)

Parameters

  • tokenRef - Either the token id or Token Name of the token to be removed from the initiative. Defaults to the Current Token.

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

  • mapname - The name of the map to find the token. Defaults to the current map.
  • return - Returns 1 if removed from the initiative, 0 if did not.
Token IDs are unique, but Token Names can be duplicated. Using Token Name when more than one token has the same name can produce unexpected results.

Example

To remove the token with the name "Dragon" in current map from the initiative panel.
[h: removeFromInitiative("Dragon")]

See Also

Version Changes

  • 1.5.7 - Added id and mapname parameter options.