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 .
×
Advertisement Create a free account

How to bring in token from another page using API?

1617734519
Jay R.
Pro
Marketplace Creator
Does anyone know a method for bringing in a token with a known id from another page? I'd like to keep often-used, non-character tokens in another location and then summon them in with a pull-down menu when needed. These tokens contain their own macros, so merely dragging them from the image library won't work. Any suggestions are appreciated.
1617736139
Kraynic
Pro
Sheet Author
I don't know if this will do what you want since I haven't messed with it, but this script/thread came to mind from seeing your question.&nbsp; Might be worth a look. <a href="https://app.roll20.net/forum/post/9649899/script-spawn-default-token-thread-2/?pagenum=1" rel="nofollow">https://app.roll20.net/forum/post/9649899/script-spawn-default-token-thread-2/?pagenum=1</a>
1617736785

Edited 1617736860
David M.
Pro
API Scripter
Spawn won't copy tokens from another page, but it will create an instance of the default token for a given character sheet. Note that some aspects of the token can't be replicated due to lack of exposure to the api, such as compact overlapping bar lines. EDIT - Character abilities (with token actions) will still be linked to the spawned tokens, though, so should still work for your application.
1617741108
The Aaron
Forum Champion
API Scripter
Something could be created for that.&nbsp; It wouldn't work for Marketplace Assets (the API can only create images in a User Library), and there is some question of where to put it on the new page.
1617742644
Jay R.
Pro
Marketplace Creator
I see. I think it would only work if it could include Marketplace Assets. Otherwise there's the inevitable confusion about why it fails in some circumstances, and the solution becomes more trouble than it's worth. Thanks!
1617742997
The Aaron
Forum Champion
API Scripter
Yeah.&nbsp; That could be partially mitigated by having a script that would copy the settings of another token with the same image, such that if you drag it from your art library, it finds where you have it already and copies the properties for it from there.&nbsp; That would actually be surprisingly easy. The traditional solution to this problem is probably to make characters to represent the commonly used tokens and just drag them out of the Journal.