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

Can't figure out why this macro won't work

1452204458

Edited 1452206242
?{Change in BS?|0, [[d6>[[{7-@{Ballistic Skill}-0,2}kh1]] ]]37 mm hits at +0 BS|-1, [[d6>[[{7 - @{Ballistic Skill} - (-1), 2}kh1]] ]] 37 mm hits at -1 BS} whenever I run it, it just outputs  [[d6>[[{7 - 3 - (-1) or  [[d6>[[{7 - 3 - (0) Depending on if I select 0 or -1 in the drop down (3 is what @{Ballistic Skill} evaluates as) If I change the } to a } it doesn't work because of nesting syntax and whatnot. If I remove the ",2" from each option it works fine, but the whole purpose of this is to force any d6 that evaluates as 1 to fail, regardless of the unit's Ballistic Skill and modifier, so it renders the whole macro pointless. The purpose of the macro is to allow a player to click the macro, enter any modifiers to the unit's BS, and output whether or not the result of the roll would be a hit, while also outputting to the chatbox what modifier was used (to prevent cheating). I've been bashing my head against the keyboard for like 2 hours now, so any and all help would be greatly appreciated, though I'm beginning to suspect what I'm trying to do just can't be done due to the way the parser works. EDIT: I can't figure out how to get my markup to show, so the } directly before "kh1" in each instance is the correct HTML markup for a }.
1452205781
Gen Kitty
Forum Champion
I can't fix your macro for you, but I can at least get you your code box :)
Hey, Nic . Try replacing the commas that are part of the keep/drop function's syntax with HTML entities (i.e. ,).
Silvyre said: Hey, Nic . Try replacing the commas that are part of the keep/drop function's syntax with HTML entities (i.e. ,). Works perfectly now.  Don't know why I didn't think of that (I spent a bunch of time staring at the "Advanced Usage" section of the wiki article on Macros and it never occurred to me).  Thank you so much (again, lol)!