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

Are animated tokens still unsupported in API?

1682291678

Edited 1682291766
I found this old thread:&nbsp; <a href="https://app.roll20.net/forum/post/9141386/create-token-with-a-webm-image" rel="nofollow">https://app.roll20.net/forum/post/9141386/create-token-with-a-webm-image</a> Apparently you can't assign .webm images that you've purchased and are in your library to tokens? Is this limitation still in place? That's pretty rough considering my GM buddy bought some of these specifically to use for spells. I'm hoping maybe I'm just doing something wrong with creating the token, but it works fine with a png url.
It's kind of seeming like I can't add any marketplace assets actually, I need to investigate more. They are in the library too, like the docs say to do.
I see the "imgsrc" for all of these tokens starts with "<a href="https://s3.amazonaws.com/files.d20.io/marketplace/" rel="nofollow">https://s3.amazonaws.com/files.d20.io/marketplace/</a>", not "/images", so I think that may be part of the problem. The docs seem to indicate that the URL needs to be "/images/". If reading "imgsrc" isn't the right way to get the url I need to set "imgsrc" to, is there some other way to get the proper URL? Browser inspection tools are coming up empty when I try to find the token image like the docs say to do, I can't find the image URL at all so I'm not sure if it's buried on some obscure CSS property.
1682293195

Edited 1682293221
I took a different approach and used the network inspection tool to find the URL image via browser tools. That also still has "/marketplace/" in it. Is "You must use an image file that has been uploaded to your Roll20 Library" something different than adding an art asset from the marketplace into your library maybe....? I'm at a loss here lol.
1682295579

Edited 1682295689
David M.
Pro
API Scripter
EDIT - I actually just read all &nbsp;of your posts haha. Yes, you cannot create a token with a marketplace image. You'll have to manually drop it, right click, save image, then re-upload to your personal art library. What I said below about animated tokens still applies, however. You might try this function for your URLs const getCleanImgsrc = function (imgsrc) { let parts = imgsrc.match(/(.*\/images\/.*)(thumb|med|original|max)([^\?]*)(\?[^?]+)?$/); if(parts) { return parts[1]+'thumb'+parts[3]+(parts[4]?parts[4]:`?${Math.round(Math.random()*9999999)}`); } return; }; used like this: &nbsp;&nbsp;&nbsp;&nbsp;let tokObj = { &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;imgsrc: getCleanImgsrc(URL), &nbsp; &nbsp; &nbsp; &nbsp; etc..&nbsp; } However, I think you'll find the implementation of animated tokens created by a mod script to be underwhelming/frustrating. They will sometimes play once and stop, or not play at all. It's been an ongoing issue on Roll20 forever.
1682295764

Edited 1682296288
Thanks!! I'm gonna try that tomorrow; I've banged my head off the wall on this one enough for today and I'm just gonna make dumb mistakes at this point. ☺️ I'll post back with how I make out with that. If the animated tokens don't work well, I'll just have to let my buddy know his assets aren't usable by me. :( But I would like to at least try getting something that doesn't work well going first, just because my current attempts literally don't work at all. (createObj returns nothing) Edit: just saw your edit about my edits. :) Thanks for clarifying. And thanks for reading all the posts, I was just updating as I tried different things.
I'm running into an issue trying to download the marketplace assets so I can re-upload them into the library. When I access the imgsrc url for the marketplace asset directly in my browser, I get an access denied error back. And I'm unclear how to right-click save an image on the map to save it off. There doesn't seem to be any actual HTML image on the page at all but just a canvas..? I'm not sure how everyone else is doing this. :)
Aha, I think I have a solution. Expand the marketplace folder in the library, inspect element on that. That gives me the full list of assets I want to reupload with their names and URLs, so I don't have to look up each one one-by-one. And those URLs seem to&nbsp; actually &nbsp; be accessible for download.
1682364329

Edited 1682364672
Latest update, I can upload the .webm into the library now. When you upload the .webm file, it doesn't show up in the recent uploads. You either have to upload a static image, and then it'll show up in the list, or F5 your browser, and then it'll show up. You can't actually drag this .webm out onto the map, however. You need to copy it into your library from the recent uploads to add to the map, and that seems to turn it into a static image at that point and it's no longer an animated .webm. (P.S. I'm starting to feel like roll20 should have an API incompatibility disclaimer before taking people's money for these assets...)
Looks like I may be running into similar issues as here:&nbsp; <a href="https://app.roll20.net/forum/post/10690922/using-webm-files" rel="nofollow">https://app.roll20.net/forum/post/10690922/using-webm-files</a> I'm taking a break from this again as this is leaving an incredibly sour taste in my mouth, I'll come back fresh another day.
1682365940

Edited 1682366416
I'm curious now too, how do 1-click scripts deal with the marketplace? Like if you wanted to make a 1-click script that uses marketplace assets for people who own the relevant content, how would the 1-click even reference those assets to bring them in? I'm actually curious now if any of the "imgsrc" values that I'm using (even non marketplace) are usable in anyone's games but my buddy's. I don't want to buy a second pro subscription to test this out on an unrelated account. (P.S. and sorry I'm sounding a little angsty here, lol. My buddy was really looking forward to me making some stuff for him with the content he bought, so this I'm kind of sad about this right now. Hopefully there's some way to make this all work and I'm just missing it...)
1682367263
Kraynic
Pro
Sheet Author
I haven't read all your posts fully, but for getting images from the marketplace, simply go to the marketplace page for the art pack.&nbsp; In general, if it shows up in your art library, then the pack is downloadable from the marketplace page.&nbsp; That is the easiest way to get your marketplace content to be able to upload to your personal storage and be able to use it with the api.&nbsp; You can also alter assets as you see fit with an image editor before uploading them if you want something slightly different or multiple versions of an image. The reason the api is restricted from accessing marketplace content is to make piracy a bit more difficult.&nbsp; Inconvenient though it may be, the restriction has a valid business reason for existing.
1682367353
timmaugh
Forum Champion
API Scripter
You can reference URLs for marketplace content, you just can't create something on the VTT game canvas (like a token). For instance, with Fetch and ZeroFrame, I can run: !@(selected.imgsrc){&amp;simple} ...and I get... ...but I can't use that in SpawnDefaultToken unless I re-upload it to my library.
Yeah, I'm just gonna have to learn to live with this I guess. It's unfortunate that I won't be able to share any of my scripts going forward though, since the URLs will all be useless to everyone else. Preventing piracy makes 100% sense, I just wish they'd do that when we set the "imgsrc" and make sure it's something the game actually has access to at that point. I'm guessing it must be allowed somewhere, but downloading the marketplace assets and then reuploading into your own library feels like its own act of piracy. Anyway, I'm obviously disappointed, but will just have to move forward given these restrictions. All I can do is hope it gets addressed some day.
1682368213

Edited 1682368367
David M.
Pro
API Scripter
You can use image URLs from your personal art library in one-click scripts and others will be able to see them. I've done this with the SmartAoE script, for example (the default targeting reticle). You just need to make sure that the image is either original or truly free and open-source. So, sharing something you bought from a marketplace pack would be a ToS violation and piracy. And of course, if you ever deleted it from your art library then it would potentially annoy a bunch of people :)
Oh... that's actually terrifying to me. I've been using URLs from our library and I have no idea if some of those images are actually marketplace images that my buddy already uploaded. So if I had shared these scripts already, I could have been engaging in piracy and gotten his account banned.
I'll have to start documenting my scripts to indicate which scripts are piracy scripts if I ever share them publicly, and which ones can be shared. I'll probably just err on the side of never sharing anything with a URL now, as I take this sort of thing pretty seriously.
1682369318
David M.
Pro
API Scripter
As long as the source images are being used in a game whose owner is the original purchaser of the images or if the game's owner has also purchased them then I think it should be ok. However, I'd worry in the latter case of the script being shared again by the 2nd owner to someone who doesn't own the right to use them. But yeah, sharing to a game that hasn't purchased the art would certainly be problematic.&nbsp; Best practice: only use art that you are sure won't cause problems. Not sure of what your script does, but one alternative might be to reference the default token of a particular named character sheet (or sheets). Then, the end user can source their own art and your hands stay clean. Prior to spawning the default token, you'd need to create a local js object using something like&nbsp; let baseObj = JSON.parse(tokenJSON);&nbsp; where tokenJSON is the&nbsp;_defaulttoken property of the character object.&nbsp; Then edit the other properties of the object prior to using createObj. For example baseObj.height = 70; baseObj.width = 70; etc... spawnObj = createObj("graphic",baseObj);
Thanks, I want my script to do 100% of the setup (especially if I'm creating hundreds of things), so I wanted to have everything pre-built with the correct art. I see now that may not be possible, if I ever want to share my scripts. That means I probably just won't be able to share, for the most part. I see there are lots of workarounds, what terrifies me is that I could have accidentally stolen content without even realizing I was doing it. A lot of my friends are artists and I know it's an issue they deal with constantly, unfortunately. I had some mistaken impressions about URL accessibility for what's in our library. And it seems that the current anti-piracy measures of restricting marketplace URLs (where proper ownership could actually be verified) encourages accidental piracy instead. I'm concerned that I could have stolen other artists content without even realizing it, so I wanna writeup a full experience report now on the current situation and the process I went through. That'll take some time, but I'm hoping it'll at least be useful feedback.
1682379818
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
I wouldn't worry too much about a ban. It's an innocent error, and Roll20 is actually pretty understanding. It's unlikely that it would even be noticed, unless you were writing an insanely popular script referencing large swaths of the marketplace. The way I usually download an image is to place it on the VTT and hit the Z key for the zoomed image. You can right click on that to save. However, I usually choose to open it in a separate tab. Check the URL---depending on the zoom level you were at and the size of the original image, you might be previewing a performance-optimized size. If the URL contains "thumb.png" or "med.png", change it to "original.png" to get the full sized image.
1682381682

Edited 1682381794
It's not just the ban I'm worried about however, it's pirating from artists. So even if I wrote a script that literally only one other person &nbsp;used,&nbsp; outside of my buddy who owns the content, I'm not ok with that level of pirating. (Now that I know how this works and it would no longer be accidental.) Since save-and-reupload is the officially sanctioned (I think?) method, does roll20 &nbsp; at least verify&nbsp; at that point that the reuploaded marketplace content is actually owned by the reuploading user?
1682388070
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
AFAIK, Roll20 does not police uploads. It would literally be impossible to tell if someone uploading a graphic had ownership of the image, unless someone were to complain, or it were re-shared in an egregious manner. Note: I do not speak for Roll20.&nbsp;
Yeah, that's why I was asking about marketplace images specifically. They do know which accounts have bought access to those, so a minimal identical file check would be easy enough to do. If the official method is to download and reupload literally the exact same image as-is, the hash will match. I guess I'm just thoroughly confused on how blocking marketplace images from use by scripts with "imgsrc" is an anti-piracy measure, when access to those URLs could actually be policed according to what accounts have bought. Instead we're supposed to reupload images, which as you say can be difficult to police. This seems less like an anti-piracy measure, and more like "we don't support piracy" *wink* &nbsp;measure. Where roll20 set things up so they can wash their hands of the piracy that happens. That's a pretty uncharitable way to look at things, and I don't think this is what they actually intended, but I'm at a loss to explain the way marketplace URLs currently work (API wise) otherwise. Blocking access to those URLs where they could verify ownership, and pushing it out onto individual users without even checking what they upload feels like playing very fast and loose with other's IP. I dunno, maybe I'm taking this all a little too seriously (I'm brand new here). But software is what I do professionally (and I'm sure plenty of others here are in the same boat), so I can't afford to treat IP willy nilly like that.