copyToken
This article is a stub, you can help the RPTools Wiki project by contributing content to expand this article.
copyToken() Function
Note: This function can only be used in a Trusted Macro
• Introduced in version 1.3b51
Usage
copyToken([i]id)
copyToken([i]id, numCopies)
copyToken([i]id, numCopies, fromMap)
Parameters
id
- The id of the token to copy.numCopies
- The number of copies to create, defaults to1
fromMap
- The name of the map to copy from, defaults to the current map.
If numCopies is 1 then the token id of the newly create token is the return value of the function, If numCopies is greater than 1 then the return is a JSON Array with all of the newly created token ids.
The naming of the tokens follows the cut/paste token method.
Although it says token it can be used for objects etc. Tokens are copied into the same layer as the original token, also with the same x,y co-ordinates, but you get the token ids as a return value so its easy to use other functions to change these.