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

Inserting images into macros

So one of my players linked me this thread and it's been super helpful. We actually figured out you could use the [text here](url here) format to put images into spells and things listed in the feats and features section as well by putting that format right next to the name of the spell. Except I've encountered a problem - some spells, seemingly at random, will work just fine and look like this;

While others will end up looking like this;

Using the exact same format, all images are .jpg and uploaded to the same site (imgur). If I use that format with weapons as well it gives me the exact same thing. I'm not sure what is causing this, but if anyone has a workaround that'd be great. I would potentially like for all my spells to have attached images and don't understand why some work flawlessly and others seem to give me the strange text bug ):

August 31 (6 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

All images are .jpg, but are some titled .jpeg? I don't think it should matter for an external link, but that has been a problem with internal images. Also, if you could post a working url and a non-working url, it might point out a problem character.

I copy+paste them into Photoshop and manually save them as the .jpg format so I don't think it should differ, but for reference the url for the above acid splash is https://i.imgur.com/AB2PzbI.jpg and the one for the non-working Eldritch Blast is https://i.imgur.com/38okZPt.jpg and the images in my computer are both listed as .jpg files, not .jpeg files according to the notes in the properties.

Does the second example happen every time you use it?
September 01 (6 years ago)
GiGs
Pro
Sheet Author
API Scripter

Also, can you post both macros, just in case there's some subtle difference that isnt apparent.

September 01 (6 years ago)

Edited September 01 (6 years ago)

@ G G

Acid Splash and Eldritch Blast as shown in my one character sheet.

@OldSchoolChris

Yes, every time. Any image I try to put in that spell slot, not just the one shown. And if I put the image into Acid Splash instead it works just fine. I know some of my spells, Eldritch Blast included, are put in manually but other spells I put in manually work just fine and some of the official ones like Chill Touch give me the same error so that's not the problem as far as I can tell.

September 01 (6 years ago)

Edited September 01 (6 years ago)
GiGs
Pro
Sheet Author
API Scripter

For each macro, do the following

1) run the macro

2) put your mouse in the chat bar and press the UP arrow

3) copy the full text of that box, and paste here.

Do that for each macro. It's likely there's some error in the macro, and this is the only way we'll be able to see it.

My guess (but it's only a guess and may be wrong) would be there's something in the Description box that's being parsed incorrectly and messing things up. But we won't know for sure till we can examine the output.

You could also delete the entire description from the faulty macro (copy and save it to notepad or something first, so you can restore it later), then click the button and see if the error still happens.

Decided to try the quick deletion of the description first but that does not appear to have fixed anything.

Here's the text for Eldritch Blast following those steps;

%{-LGXyiedNyf6eFJ0LCcM|repeating_attack_-LL031hGPvOJX4gaGy9E_attack}

And for reference here's Acid Splash;

%{-LGXyiedNyf6eFJ0LCcM|repeating_attack_-LL02GvowDaDMIh4k8Ax_attack}

And Chill Touch, which I was able to drag from the compendium instead of a manual input like Eldritch Blast but is broken in the same way;

%{-LGXyiedNyf6eFJ0LCcM|repeating_attack_-LL02L7Gag4cOz5c6njy_attack}

September 01 (6 years ago)

I think it may be something in the spell's Name field, but you can't see it as it is too long to display the entire field.

For both spells, click in the spell Name field, select all the text with Ctrl-A, copy with Ctrl-C, and then paste the text in a message here.

September 01 (6 years ago)

Edited September 01 (6 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Well, I've put those spells and links into a test character, and it's definitely the way the sheet's parsing the spell. I even tried switching the URLs around to verify it's not the image source.

Acid Splash correctly returns:

<a href="https://i.imgur.com/AB2PzbI.jpg">
<img src="http://imgsrv.roll20.net/?src=i.imgur.com/AB2PzbI.jpg" alt="text here">
</a>

While Eldritch Blast returns:

<a href="https://i.imgur.com/38okZPt.jpg">
<img src="http://imgsrv.roll20.net/?src=i.imgur.com/38okZPt.jpg" alt="Eldritch Blast<a href=">text here" /&gt;
</a>

But beyond that, I am stumped. Changing the order of the spells on the sheet doesn't seem to do anything, either.


September 01 (6 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

I have done more investigation, and consulted with people cleverer than I. The issue is that an  attack roll puts an ability command button in place of the attack name to roll the damage. You can't nest inserted images and command buttons.

The solution is to turn on Auto Roll Damage in your sheet settings.

September 01 (6 years ago)
GiGs
Pro
Sheet Author
API Scripter

nice detective work!

September 01 (6 years ago)
keithcurtis
Forum Champion
Marketplace Creator
API Scripter

Aaron and I came up with clues, and Scott C made the deduction.

Ahhh, thank you so much! Good to know that's the issue and fix. I'll do some testing of it myself a little later and if it works I'll pass it along to my players and friends. This is something I see so few people using because it seems they don't know it exists so I want to be able to pass this around and see more people doing it ^^