removeFromInitiative: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
|name=removeFromInitiative | |name=removeFromInitiative | ||
|description= | |description= | ||
Removes the [[Current Token]] from the [[ | Removes the [[Current Token]] from the [[Introduction to Initiative|Initiative Panel]]. Additional parameters allow you to specify the token. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
removeFromInitiative() | removeFromInitiative() | ||
removeFromInitiative( | removeFromInitiative(tokenRef) | ||
removeFromInitiative( | removeFromInitiative(tokenRef, mapRef) | ||
</ | </syntaxhighlight> | ||
'''Parameters''' | '''Parameters''' | ||
{{param| | {{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| | {{param|mapRef|The Name or ID 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. | * {{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= | |example= | ||
To remove the token with the name "Dragon" in current map from the [[ | 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")] | [h: removeFromInitiative("Dragon")] | ||
</ | </syntaxhighlight> | ||
|also= | |also= |
Latest revision as of 23:59, 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, mapRef)
Parameters
tokenRef
- Either the tokenid
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.
mapRef
- The Name or ID 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
addToInitiative() removeAllFromInitiative() removeAllNPCsFromInitiative() removeAllPCsFromInitiative()
Version Changes
- 1.5.7 - Added
id
andmapname
parameter options.