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

Monospace formatting in ability disables ability

1563209794
Mike deBoston
Compendium Curator
I'm writing a macro to calculate shares of the loot in my pirate campaign. This code works; it prompts for values, outputs a bold headline and the results. ** ========== HEAR YE ========== ** Of ?{Shares|5} shares of ?{Pieces of 8|100} pieces of 8: 1 share is [[ floor(?{Pieces of 8}/?{Shares}) ]] Po8 2 shares is [[ floor(?{Pieces of 8}/?{Shares}*2) ]] Po8 3 shares is [[ floor(?{Pieces of 8}/?{Shares}*3) ]] Po8 But this doesn't. The headline is in monospace red, followed by a single backtick, and then the macro is printed. No prompts, no calculations. What's wrong here? ``` ========== HEAR YE ========== ``` Of ?{Shares|5} shares of ?{Pieces of 8|100} pieces of 8: 1 share is [[ floor(?{Pieces of 8}/?{Shares}) ]] Po8 2 shares is [[ floor(?{Pieces of 8}/?{Shares}*2) ]] Po8 3 shares is [[ floor(?{Pieces of 8}/?{Shares}*3) ]] Po8
1563210229

Edited 1563210399
vÍnce
Pro
Sheet Author
the backtick is a special character used by roll20 chat which basically stops macro parsing.&nbsp;&nbsp; <a href="https://wiki.roll20.net/Text_Chat#Escape_Text_.28.60.29" rel="nofollow">https://wiki.roll20.net/Text_Chat#Escape_Text_.28.60.29</a> Good for displaying macro code in chat for example...&nbsp; I would simply try another character.
1563212951
Mike deBoston
Compendium Curator
Yes, one backtick means don't parse the rest. But TWO backticks means red monospace. Because, TWO. <a href="https://wiki.roll20.net/Text_Chat#Basic_Formatting" rel="nofollow">https://wiki.roll20.net/Text_Chat#Basic_Formatting</a> FWIW, I tried two backticks but it stripped off the first one and just printed all the text. Then I tried three in front and two on back. And... I can see I'll just use bold and drop this. I was hoping I'd overlooked something.
1563213820
Mike deBoston
Compendium Curator
Also: I meant to say thanks for the quick reply, and a link to the source. Thanks!
1563217812
The Aaron
Roll20 Production Team
API Scripter
Try putting a space in front of it. IIRC, it only does its parsing denial when it's at the start of a line.&nbsp;
1563219723
Mike deBoston
Compendium Curator
Putting a period in front of it worked. Leading spaces were removed. Thanks!
1563220304
The Aaron
Roll20 Production Team
API Scripter
Cool
1563220330
The Aaron
Roll20 Production Team
API Scripter
Could try &amp;nbsp;
1563226650
Mike deBoston
Compendium Curator
Yes! Thanks! Works perfectly. Final macro, for future pirate captains. calc-shares: &amp;nbsp;``?{Pieces of 8|3527} pieces of 8, ?{Shares|5} shares`` 1 share is [[ floor(?{Pieces of 8}/?{Shares}) ]] Po8 2 shares is [[ floor(?{Pieces of 8}/?{Shares}*2) ]] Po8 3 shares is [[ floor(?{Pieces of 8}/?{Shares}*3) ]] Po8