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

Refresh GIF each time it's posted in chat

1589353867

Edited 1589354132
Oosh
Sheet Author
API Scripter
OK, so today is the first time I've played around with GIFs. I wanted a nice little animation to play in the chat window when I crit with EB, so I found some random stuff and stitched it together. I set it to loop 3 times and then stop, as I didn't want it to keep going ad infinitum. Then I ran into the problem that each subsequent gif call would only display the last frame, as the page had already loaded the image. Any browser of JS solutions would presumably only work for me, not others. Note that I was looking for a solution as a player, not as a GM. After a bit of jerking around, I found a hacked together solution, if this helps anyone. Here's the thing (5e OGL spell damage template): Roll20 seems to ignore anything after a '?' in an embedded image link, where you find width &amp; height and so forth, so I figured putting a randomised number in there would fool the browser into thinking it was a different file. It works, only I couldn't get anything except a query prompt to work inside the link. So far inside my spell damage template I had: {{desc= [img](<a href="https://x4wpyw.bn.files.1drv.com" rel="nofollow">https://x4wpyw.bn.files.1drv.com</a> ? ?{CRIT!} #.gif) }} so I had to mash a few random keys and hit enter, then it would load the image at the first frame and loop 3 times, exactly as I wanted. Having to type into the query box when I just melted a channel through a goblin's skull isn't ideal, so I kept looking. Then I found this post in a thread about using randomised GIFs. Scott C's suggestion in getting Roll20 to parse a file with a random number generated at the end was exactly what I needed. The syntax is bizzare and not something I ever would have thought of, but it gets inline rolls working inside an image link. His example was for a random picture pulled from a bunch of 4, with a 1d4 roll to pick between the manually named files: [Image[[](<a href="http://tiny.cc/image_swap_demo_[[1d4]]#.gif" rel="nofollow">http://tiny.cc/image_swap_demo_[[1d4]]#.gif</a>) It looks completely wrong to me, but it works. So I just stole this trick and came up with: {{desc = [img[[](<a href="https://x4wpyw.bn.files.1drv.com/embedlink" rel="nofollow">https://x4wpyw.bn.files.1drv.com/embedlink</a> ? [[1d1000]] #.gif ) }} Yes, the brackets look broken, but it works. The random roll needs to go after a ? so it doesn't mess with the actual image link, and before a #.gif to let Roll20 know it's a gif. So, I don't know if this qualifies as a stupid trick, as it's possible no one else will find a use for it, or that there's a much smarter way to do it. Anyways, hopefully I can save someone a few hours of Googling and faffing about in Roll20! Now that I have it working, I'm gonna make some for the rest of the party. One last thing, I tried setting the final frame in the GIF which says CRITICAL HIT to 0 milliseconds, hoping it would be invisible during loop, and only appear as the final frame. It didn't work, apparently browsers ignore values under 2ms. Anyone know if I can achieve this? Happy rolling!
1589357691
GiGs
Pro
Sheet Author
API Scripter
That's really clever. Nice detective work and ingenuity. I'd say it qualifies as a stupid trick.
Well fate has it that a week later and you've already got someone who's looking to do exactly this. I've found some of your same workarounds, but I'm fairly new to Roll20 and haven't fully got there yet. At the moment I've got a separate macro for when I have successfully hit a crit that I have to click. I'm not sure how to have it display only when a crit is landed, I don't know how to use /desc as a player, I don't know how you're putting an image inside a roll template, and frankly I don't know how to even use or access that roll template to begin with. It's the template that comes up when we click actions on our character sheets in Roll20 or through Beyond 20 so I know it's possible. This is what I have so far, and it's not that pretty: &amp;{template:default} {{name=The bell tolls.}} {{[[1d8ro&lt;2 + 1d8ro&lt;2]] critical damage!}} [[ [img](<a href="https://tinyurl.com/epicpooper[[" rel="nofollow">https://tinyurl.com/epicpooper[[</a> 1d9 ]]#.gif)