Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Script:DupCharToken

From Roll20 Wiki

Revision as of 20:02, 5 December 2018 by Chris D. (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
API ScriptAuthor: Chris D
Version: 01.00
Last Modified: 2018-12-06
Code: DupCharToken
Dependencies: none
Conflicts: none

This script will duplicate a character sheet and tokens giving the new characters and tokens an identifying number and linking each new token to it's own individual new character sheet.
This script is useful for those who want to create multiple copies of monsters because they prefer multiple character sheets to linking tokens as Mooks.
Using an argument of "clean" causes it to clean up (delete) numbered tokens and characters such as this script creates.

Contents

Syntax

!DupCharToken (Number of tokens to create) (Starting number)
(Number to create) is the number of characters and tokens to copy/create. It defaults to 1. (Starting number) is the number to start numbering the tokens and characters from. Defaults to 1.
!DupCharToken clean
Clean up numbered characters and tokens such as this script creates.

Installation and Configuration

Copy the script's code, available from the menu on the right and stored at Roll20's API GitHub Repository. Paste the code into a new script in your campaign's API Script Editor. Save the new script and it will be available inside your campaign.

The following text makes a good macro for using this script.
!dupCharToken ?{How many Duplicates|1} ?{Starting Number|1}

Known bugs/issues

If the avatar image of the character is not in a user library (i.e: it's a marketplace image or from the Monster Manual, or the like), due to limits placed upon the API, it can't set an avatar image. You will have to do that yourself.

Script Use

!DupCharToken 5
If you select a token named "Skel" that is linked to a character named "Skeleton" this will make 5 new characters, identical to the original, named "Skeleton 1" through "Skeleton 5", and make 5 new tokens, identical to the original and stacked in the exact same location, named "Skel 1" through "Skel 5". Each token will be linked to its corresponding character sheet in the exact same manor as the originals were linked.
!DupCharToken 5 3
As above, but would start numbering at 3 ending at number 7.
!DupCharToken clean
If you select any token named "Skel" or "Skel (number)" this will delete all tokens where the name is "Skel (any number)" and all characters named "Skeleton (any number)". The original token and character (without a number) will not be deleted.

Changelog

v01.00 (2018-12-06)

  • Release