Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Duplicating characters

Is there a way to duplicate characters via the API? Failing that, is there an event that fires when a character is duplicated?
1416233365
The Aaron
Roll20 Production Team
API Scripter
You can't directly duplicate a character from the API. You can get close by creating a character and setting everything on it to the values on an existing character. You won't be able to copy the token that is assigned to it, and you'll only be able to set the portrait image if the image is directly in a user library. You then make copies of all the attributes and abilities and that's as close as you can get. You can register for the create event: on('create:character', function(obj){ // do stuff }); You may want to watch the creates for attributes and abilities as well, depending on your use case.
Yeah, I figured that's how I'd have to go, but thought I'd check if there was an easier way. Thanks much!
1416278250
The Aaron
Roll20 Production Team
API Scripter
No worries!