Good morning all,
I've just recently started playing on Roll20 and I'm attempting to learn how to write macros. As I'm currently playing a bard, I'm trying to write something inspiration related and have come up with the following:
/em inspires @{target|token_name} (1d[[6 + {{@{MYCHARNAME|base_level}, 0}>4}*2 + {{@{MYCHARNAME|base_level}, 0}>9}*2 + {{@{MYCHARNAME|base_level},0}>14}*2]])
Since I'm not a pro user I cannot use the API to tick down my Inspiration resource pool, but I can (using the if statement hack I read about on the wiki) look at my character's level, determine the level appropriate inspiration die, and pass that information along to the rest of my part. This all works fine.
The issue I have stems with the appearance of the output:
As you can see, because the if statement math is treated like a roll, the output is formatted as such. My reaction: "That's fine, I know there's a hack to get CSS to work in chat. I'll just format it out." It seems that I was naive however, as while I can get the actual text surrounding the "roll" to accept CSS:
/em [inspires @{target|token_name}](#" style="color:red;) (1d[[6 + {{@{MYCHARNAME|base_level}, 0}>4}*2 + {{@{MYCHARNAME|base_level}, 0}>9}*2 + {{@{MYCHARNAME|base_level},0}>14}*2]])
Attempting to format the "roll" itself leads to the following:
/em [inspires @{target|token_name} (1d[[6 + {{@{MYCHARNAME|base_level}, 0}>4}*2 + {{@{MYCHARNAME|base_level}, 0}>9}*2 + {{@{MYCHARNAME|base_level},0}>14}*2]])](#" style="color:red;)
Attempting to apply the CSS around the roll portion alone leads to similar results. I suspect what I'm trying to do might be impossible on account of Roll20's order of operations, but I'm uncertain. Am I missing something obvious formatting wise? Am I better off just trying to get this into a roll template?
Thanks for any help you can provide. My apologies if I'm missing something obvious staring me in the face.