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

Copying Monster Created By API

1522646402
Bast L.
Pro
API Scripter
Hello. I'm working on a script for making Rules Cyclopedia monsters more easily. Currently, it checks if the name entered has a matching table item in the MonsterImages table, and if it does, sets that as the avatar. I then drag the token onto the map, and use the !MonsterMashToken command to set some of the stats. However, I discovered that ctrl+c ctrl+v or even right clicking to copy and paste the token only gives an unlinked token. This is whether or not I save it as default. It also happens even if it found no image in the table, and just uses the default image. The issue seems to occur when I use the&nbsp;!MonsterMashToken command. If I copy and paste before doing that, the pasted token is still linked to the character sheet, but afterwards it isn't. To be clear, the token I use it on is linked in either case, but the pasted token is not linked, if I copy it after statting up the token. The script:&nbsp; <a href="https://gist.github.com/Bastlifa/a48176920e671a101" rel="nofollow">https://gist.github.com/Bastlifa/a48176920e671a101</a>... Some pictures: Orc dragged out from character sheet.&nbsp;!MonsterMashToken is not yet used. Is linked to sheet. Copy of that orc,&nbsp;!MonsterMashToken still not used. Both linked to sheet. !MonsterMashToken used, orc is still linked. Copy and paste him, new orc is not linked not are bars given values: So, I'm just not sure what's happening here. The orc I copy is linked, but the pasted orc isn't. One other strange behavior: If I save the orc with filled bars as the default token, I can drag out another orc just like him, but when I try to copy both of them, only one copy gets made, and it's not linked, bars aren't filled.
1522675475
The Aaron
Pro
API Scripter
That's super weird.&nbsp; If you want to invite me to your game and GM me, I'd be happy to come take a look and see if I can figure it out.
1522681114
Bast L.
Pro
API Scripter
Resolved by Aaron, it was a bug in my script where I set a bar link to 'None' instead of to ''. His guess was that during the copy it threw an exception and caused the issue. Anyways, thanks, and feel free to ignore this all.