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 .
×

Macro: Why Is This Right Justified?

1774716596

Edited 1774951931
I'm getting back into macros before I take a large step an start figuring out the loads of API Scripts I wrote up to about 2022. I'm wondering why this dialog box, which uses Aaron's Tokenmod script for most, if not all, buttons, is right justified. Is there anything I can do to, in the realm of roll20 macro tech, to at least centre it or even left justify it. Is it the template:general  (note, initially said default, meant general) that makes it all right justified? I don't like the look of the buttons with  template:default , plus it cannot make the width smaller than 20. The labels are still in progress as are the various sizes: Image: Code for the above: &{template:default}{{name=Select Character Token(s) and:}} {{*Resize to w x h pixels* [15](!token-mod --set width|=15 height|=15) [20](!token-mod --set width|=20 height|=20) [33](!token-mod --set width|=33 height|=33) [40](!token-mod --set width|=40 height|=40) [50](!token-mod --set width|=50 height|=50) [60](!token-mod --set width|=60 height|=60) [70](!token-mod --set width|=70 height|=70) [Very Large](!token-mod --set width|=105 height|=105) [Huge](!token-mod --set width|=140 height|=140) Or you may: [Flip Horizontally](!token-mod --flip fliph) [Rotate to 0°](!token-mod --set rotation|360) [Highlight On/Off](!token-mod --on aura1_square --set aura1_color|ffffff --set aura1_radius|!.1) [Character Name On/Off](!token-mod --flip showname)}@{selected|character_name} as it throws a little error before opening the dialog. I like this, because it reminds me, when I open it, that  need to select something. Thanks for any help -- Tim
1774717198

Edited 1774717214
Yes the template:default  will right justify everything on the left side, and left justify everything on the right side.  I’m not at my computer at the moment, but you could try adding an = to force the display to be on the right side:  {{=*Resize to w x h pixels*
1774735583
vÍnce
Pro
Sheet Author
FYI: you might try the AD&amp;D1e general roll template assuming this is for that sheet. Here's a sample macro that might help when you are formulating custom macros using the sheet's template; (the image url used will probably need to match something from your own library or available remotely) &amp;{template:general} {{bigname=bigname = bigname}} {{name=name = name}} {{subtag=subtag = subtag}} {{color=darkblue}} {{bigtext1=bigtext1 = [[1d20]] }} {{bigtext2=bigtext2 = [[1d20]] }} {{bigtext3=bigtext3 = [[1d20]] }} {{bigtext12=bigtext(...12) = [[1d20]] }} {{roll_high=roll_high [[1d20]] }} {{roll_low=roll_low [[1d20]] }} {{roll_target=roll_target [[20]] }} {{roll=roll [[1d20]] }} {{school=school}} {{spell_level=spell_level}} {{range=range}} {{duration=duration}} {{area_of_effect=area_of_effect}} {{components=components}} {{casting_time=casting_time}} {{saving_throw=saving_throw}} {{save_type=save_type}} {{quantity=quantity}} {{quantity_max=x}} {{uses=x}} {{uses_max=x}} {{custom key left=%NEWLINE%}} {{custom key centered}} {{ custom key centered}} {{=custom key right}} {{custom key=value}} {{[chat menu btn](~some_attribute)}} {{[chat menu w/backtick](`~some_attribute)}} {{freetext=**freetext** = Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s...}} {{ [.](<a href="https://s3.amazonaws.com/files.d20.io/images/56118678/hzXbLFvUu8q7o-zMaYrXoA/max.jpg" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/56118678/hzXbLFvUu8q7o-zMaYrXoA/max.jpg</a>) }} {{link=[LINK](<a href="https://app.roll20.net" rel="nofollow">https://app.roll20.net</a>)}}
1774769772

Edited 1774769991
Jarren said: Yes the template:default &nbsp;will right justify everything on the left side, and left justify everything on the right side.&nbsp; I’m not at my computer at the moment, but you could try adding an = to force the display to be on the right side:&nbsp; {{=*Resize to w x h pixels* Thanks JArren, that helps a fair bit: Looks like there's columns I'm missing. Anyway, this is a help, much appreciated. Now I need to figure out why my original macro, above, has everything in one column to the right. -- Tim
vÍnce said: FYI: you might try the AD&amp;D1e general roll template assuming this is for that sheet. Here's a sample macro that might help when you are formulating custom macros using the sheet's template; (the image url used will probably need to match something from your own library or available remotely) &amp;{template:general} {{bigname=bigname = bigname}} {{name=name = name}} {{subtag=subtag = subtag}} {{color=darkblue}} {{bigtext1=bigtext1 = [[1d20]] }} {{bigtext2=bigtext2 = [[1d20]] }} {{bigtext3=bigtext3 = [[1d20]] }} {{bigtext12=bigtext(...12) = [[1d20]] }} {{roll_high=roll_high [[1d20]] }} {{roll_low=roll_low [[1d20]] }} {{roll_target=roll_target [[20]] }} {{roll=roll [[1d20]] }} {{school=school}} {{spell_level=spell_level}} {{range=range}} {{duration=duration}} {{area_of_effect=area_of_effect}} {{components=components}} {{casting_time=casting_time}} {{saving_throw=saving_throw}} {{save_type=save_type}} {{quantity=quantity}} {{quantity_max=x}} {{uses=x}} {{uses_max=x}} {{custom key left=%NEWLINE%}} {{custom key centered}} {{ custom key centered}} {{=custom key right}} {{custom key=value}} {{[chat menu btn](~some_attribute)}} {{[chat menu w/backtick](`~some_attribute)}} {{freetext=**freetext** = Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s...}} {{ [.](<a href="https://s3.amazonaws.com/files.d20.io/images/56118678/hzXbLFvUu8q7o-zMaYrXoA/max.jpg" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/56118678/hzXbLFvUu8q7o-zMaYrXoA/max.jpg</a>) }} {{link=[LINK](<a href="https://app.roll20.net" rel="nofollow">https://app.roll20.net</a>)}} Thank you Vince. Your assumption is correct, of course! :) I could not figure out the pictures bit, specifically where to put images.&nbsp; For Handouts, I use dropbox for my shared files I use (always indicated by "(dropbox)" and I can just use the image library for images on the handouts (parts of the main handout for players in both my campaigns): But I have not been able to figure out how to link an image to a macro chat output. All the googling I do bring up very unhelpful (to me) entries from 8 or so years ago. Mind you, I only got back into macro chat stuff on Friday, to control a friend who has impulse issues and for whom "Just stop moving your *&amp;^%ing toekn until the party decides what to do!" doesn't work. LOL I'll have to look more into what you have there later this week. My next big thing after using macros to view money situations and quick comparison of attributes is to be able to enter money myself to the appropriate characters. Coincidentally, the money macros led me to discover the same bloody player I mentioned has way more money than he should even after giving "generously" 200 GP to the party's cleric for level training (I use SP amounts instead of GP amounts for training at low levels) might have a bit too much money for a 1e ranger giving away his earnings to the poor, grrrr. LOL BTW, Vince, what is the total coins supposed to represent? I wasn't sure - the term "total" was confusing to me - and have asked players not to use it; money not on their person they can mention is wealth notes:
1774797686
vÍnce
Pro
Sheet Author
Images; {{ [.](<a href="https://s3.amazonaws.com/files.d20.io/images/56118678/hzXbLFvUu8q7o-zMaYrXoA/max.jpg" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/56118678/hzXbLFvUu8q7o-zMaYrXoA/max.jpg</a>) }} This is just roll20's default image insertion format syntax. [x](URL)&nbsp; The URL must end in an image format (png, jpg, gif, etc.) I just included that to show if you simply include an image insertion in the sheet's roll template how it would display.&nbsp; ie {{ [x](URL) }}&nbsp; You can insert an image similarly directly within a textarea like a description field and possibly other areas, but YMMV as to what it does to the roll template.&nbsp; Total vs Coins; Think of your Total Coins as your "Bank Account" including what you have in your pockets.&nbsp; Carried is only what you have on your person.&nbsp; Encumbrance uses carried coins.
1774949927

Edited 1774950075
vÍnce said: Images; {{ [.](<a href="https://s3.amazonaws.com/files.d20.io/images/56118678/hzXbLFvUu8q7o-zMaYrXoA/max.jpg" rel="nofollow">https://s3.amazonaws.com/files.d20.io/images/56118678/hzXbLFvUu8q7o-zMaYrXoA/max.jpg</a>) }} This is just roll20's default image insertion format syntax. [x](URL)&nbsp; The URL must end in an image format (png, jpg, gif, etc.) I just included that to show if you simply include an image insertion in the sheet's roll template how it would display.&nbsp; ie {{ [x](URL) }}&nbsp; You can insert an image similarly directly within a textarea like a description field and possibly other areas, but YMMV as to what it does to the roll template.&nbsp; Total vs Coins; Think of your Total Coins as your "Bank Account" including what you have in your pockets.&nbsp; Carried is only what you have on your person.&nbsp; Encumbrance uses carried coins. Thanks Vince. To get a URL of an image from my art library, the only way I can see doing it is by creating a test handout, with the image in question like this screenshot and saving it.&nbsp; Then I open the image in a new tab/browser window and copy the URL, for example, <a href="https://files.d20.io/images/481519013/cgfisHREuSqL2eduujnDGA/max.jpg?1774834276" rel="nofollow">https://files.d20.io/images/481519013/cgfisHREuSqL2eduujnDGA/max.jpg?1774834276</a> , and removing the protocol (&nbsp; https:// ). Then I suffix it to&nbsp; <a href="https://s3.amazonaws.com/" rel="nofollow">https://s3.amazonaws.com/</a>. It's a fair bit of work, but doable. Is there another method? This would be a great addition to the Art Library right click menu. :) Also, thanks for the explanation on Total Coins. I think I'll stick with my approach for now and just keep checking with this macro and making sure the values are zero :&nbsp; Now I have to start using&nbsp;!setattr to set up macros I and the other players can control players' coins, add, subtract, convert to smaller/larger denominations, etc. I'll try t write such macro transactions to a file to keep track of what has been done. I ended up firing my problem player afterwards as the dishonesty and his and another of group's extreme min/max lead was leading to too many arguments and was no longer fun. Thanks again! -- Tim
1774967428
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
Hi Tim! You can just drag the image to the VTT (no need to create a handout). Then select, hit "Z" on the keyboard, right-click and copy the URL. Depending on where that URL is going, you may get better performance by truncating the cache buster number at the end ("?1774834276") in your example above. You also shouldn't need to go through all that extra surgery on the URL. [x](<a href="https://files.d20.io/images/481519013/cgfisHREuSqL2eduujnDGA/max.jpg" rel="nofollow">https://files.d20.io/images/481519013/cgfisHREuSqL2eduujnDGA/max.jpg</a>) should work fine. There are two different "buckets" that Roll20 assets can be in. One is for your personal library images, the other for marketplace images. It may even be in a third bucket if the image is old enough. I know that there has been recent work on this, I think to consolidate.
keithcurtis said: Hi Tim! You can just drag the image to the VTT (no need to create a handout). Then select, hit "Z" on the keyboard, right-click and copy the URL. Depending on where that URL is going, you may get better performance by truncating the cache buster number at the end ("?1774834276") in your example above. You also shouldn't need to go through all that extra surgery on the URL. [x](<a href="https://files.d20.io/images/481519013/cgfisHREuSqL2eduujnDGA/max.jpg" rel="nofollow">https://files.d20.io/images/481519013/cgfisHREuSqL2eduujnDGA/max.jpg</a>) should work fine. There are two different "buckets" that Roll20 assets can be in. One is for your personal library images, the other for marketplace images. It may even be in a third bucket if the image is old enough. I know that there has been recent work on this, I think to consolidate. OK, I saw lots of reference to shift Z or just Z and I see that's what it means. But doing what you describe I get the necessary URL. Cool beans! <a href="https://files.d20.io/images/481519013/cgfisHREuSqL2eduujnDGA/original.jpg?1774834276" rel="nofollow">https://files.d20.io/images/481519013/cgfisHREuSqL2eduujnDGA/original.jpg?1774834276</a> That's certainly a lot quicker, thanks for saving my sanity (again), Keith, :) &nbsp;&nbsp;&nbsp;&nbsp;
1775007116
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
In case you didn't run across documentation for "Z" and "Shift-Z", the former previews the selected image in a light box for the user. The latter is GM-use only, and throws up a lightbox preview for all connected players. It's a great tool for "This is what you see".
keithcurtis said: In case you didn't run across documentation for "Z" and "Shift-Z", the former previews the selected image in a light box for the user. The latter is GM-use only, and throws up a lightbox preview for all connected players. It's a great tool for "This is what you see". Fantastic!
1775061163
timmaugh
Pro
API Scripter
If you want to include an image in a macro output, you don't always have to know the URL ahead of time. There are scripts that will do it (to specific effect), but there is also the Metascript Toolbox, which will let you agnosticize the retrieval of the image. You can include the image in a templated output by getting it from a token (via name, ID, selection, or targeting), from the character (via name), or from a table or page (via name). By one of those methods, you could use the same command for many different potential image sources without ever having to collect the URLs from the images. If that's something you'd be interested in, post back with your current macro, where in the template you would want to have the image appear, and the source of the image (token, character, selection, etc.).
timmaugh said: If you want to include an image in a macro output, you don't always have to know the URL ahead of time. There are scripts that will do it (to specific effect), but there is also the Metascript Toolbox, which will let you agnosticize the retrieval of the image. You can include the image in a templated output by getting it from a token (via name, ID, selection, or targeting), from the character (via name), or from a table or page (via name). By one of those methods, you could use the same command for many different potential image sources without ever having to collect the URLs from the images. If that's something you'd be interested in, post back with your current macro, where in the template you would want to have the image appear, and the source of the image (token, character, selection, etc.). Sounds great. Give me a bit of time, age has really done a number on my intelligence :) and I've got to figure a few other things out.
keithcurtis said: Hi Tim! You can just drag the image to the VTT (no need to create a handout). Then select, hit "Z" on the keyboard, right-click and copy the URL. Depending on where that URL is going, you may get better performance by truncating the cache buster number at the end ("?1774834276") in your example above. You also shouldn't need to go through all that extra surgery on the URL. [x](<a href="https://files.d20.io/images/481519013/cgfisHREuSqL2eduujnDGA/max.jpg" rel="nofollow">https://files.d20.io/images/481519013/cgfisHREuSqL2eduujnDGA/max.jpg</a>) should work fine. There are two different "buckets" that Roll20 assets can be in. One is for your personal library images, the other for marketplace images. It may even be in a third bucket if the image is old enough. I know that there has been recent work on this, I think to consolidate. Keith, I am having difficulty with one image. Are there protected images? I've used the method you described and also tried the way I initially described. The one image that refuses to work is from AD&amp;D Players Handbook 1e, though the second image shows another image from the same source. Both were copied and saved as files using the Windows Snipping Tool. The image URL can be seen in the edit macro to the left. The picture that will not work is the one with 4 adventurers dividing up treasure. The remaining 4 pictures in the screenshot show up without any difficulty. Each time, I replaced the URL of an image that works. Each time,&nbsp; except for the first instance shown here , that work. So the URL is being copied correctly. Any ideas where I am screwing up or is that particularly image protected somehow? -- Tim
1775190597
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
It could be a parser problem. "JPG" looks wrong. The uploader usually either passes "jpg" or converts it to "png". Or it used to convert to png. Try changing that JPG to jpg, or to png.&nbsp;If that doesn't work, can you post the two urls, working and non-working? Generally, the only protected images are ones that are not hosted on Roll20, or certain applications of marketplace images.&nbsp;
1775238882

Edited 1775241319
keithcurtis said: It could be a parser problem. "JPG" looks wrong. The uploader usually either passes "jpg" or converts it to "png". Or it used to convert to png. Try changing that JPG to jpg, or to png.&nbsp;If that doesn't work, can you post the two urls, working and non-working? Generally, the only protected images are ones that are not hosted on Roll20, or certain applications of marketplace images.&nbsp; After a considerable amount of time with this, the problem for me is any images created using Windows Snipping Tool and saving as jpg. I did one run of a Windows Snipping Tool screen shot saved as a png and got the very same issue as above ( Comment Link ). Here are a list of images in my art library. Anything with capitalized JPG or the one case of PNG will&nbsp; not &nbsp;appear in a chat window as per my last post above. It only works for images that are either: 1) jpg images that were taken by my iPhone and saved, such as my old Canadian armour corps images or pictures downloaded from the internet. 2) jpg images saved from Windows Snipping Tool that are next opened in an image processing program - I use Affinity Photo 2 - and exported to jpg. The images in the screenshot below work or do not work as described above: My conclusion applies to Windows Snipping Tool on Windows 10 (Win 11 is a memory thief! LOL) -- Tim
1775332413
keithcurtis
Forum Champion
Marketplace Creator
API Scripter
What happens if you change the name of the image from JPG to jpg before uploading?
keithcurtis said: What happens if you change the name of the image from JPG to jpg before uploading? Same thing. I can only use the Snipping Tool in Windows for handouts. If it's going to go in a chat window, it has to be saved as a jpg in, for me, Affinity.