addAllNPCsToInitiative: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(20 intermediate revisions by 8 users not shown)
Line 1: Line 1:
==Function addAllNPCsToInitiative==
{{Languages|addAllNPCsToInitiative}}
{{GMOnlyFunction}}
{{MacroFunction
Adds all the [[NPC token]]s on the current [[map]] to the [[initiative panel]]. This function returns the number of tokens that were added to the initiative panel.
|name=addAllNPCsToInitiative
|proposed=false
|trusted=true
|description=Adds all [[Introduction_to_Tokens#Token_Type|NPC tokens]] on the Token layer of the current [[Introduction to Mapping|map]] to the [[Introduction to Initiative|initiative panel]]. This function returns the number of [[Token:token|tokens]] that were added to the initiative panel. Tokens already on the initiative panel are not counted.


===Usage===
 
<source lang="mtmacro" line>
This function will not assign any initiative value to the tokens. You can use {{func|setInitiative}} to set the initiative value of a token.
[h: noTokens = addAllNPCsToInitiative()]
 
</source>
|usage=
<syntaxhighlight lang="mtmacro" line>
addAllNPCsToInitiative()
</syntaxhighlight>
 
|example=
<syntaxhighlight lang="mtmacro" line>
[h: numTokens = addAllNPCsToInitiative()]
</syntaxhighlight>
 
<syntaxhighlight lang="mtmacro" line>
Added [r: addAllNPCsToInitiative()] NPCs to the initiative panel.
</syntaxhighlight>
 
|also=
{{func|setInitiative}}, {{func|addAllPCsToInitiative}}, {{func|addAllToInitiative}}
}}
[[Category:Initiative Function]]
{{Languages|addAllNPCsToInitiative}}

Latest revision as of 23:59, 11 May 2024

Languages:  English  • 日本語


addAllNPCsToInitiative() Function

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

Adds all NPC tokens on the Token layer of the current map to the initiative panel. This function returns the number of tokens that were added to the initiative panel. Tokens already on the initiative panel are not counted.


This function will not assign any initiative value to the tokens. You can use setInitiative() to set the initiative value of a token.

Usage

addAllNPCsToInitiative()

Example

[h: numTokens = addAllNPCsToInitiative()]
Added [r: addAllNPCsToInitiative()] NPCs to the initiative panel.

See Also

Languages:  English  • 日本語