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

Weirdness with keep highest inside variables?

Hi, So I've encountered a weird problem: kh1 seems to be interfering with this macro's functionality. Essentially it's supposed to add half the character level rounded down, with a minimum of 1. /r ?{Tracking?|Yes, [[{[[floor(@{level}/2)]], 1}kh1]]|No, 0} I can replicate this with a kh of anything. Is there a workaround for this annoying behaviour? Making a sheet attribute didn't seem to do the trick and I really don't want to have to increment half level manually.
I think it would be easier to pre-calculate the value in the sheet as its own attribute (attr_level_half). ?{Tracking?|Yes, [[ @{selected|level_half} ]] |No, 0} If you want to make this macro you will need to use HTML replacements (see the wiki: <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_</a>... and save it as an Ability: ?{Tracking?|Yes,&nbsp; [[ {[[floor(@{level}/2) ]]&#44;1&#125;kh1]] |No, 0}
1499532737

Edited 1499532747
Nice, that did the job just fine. I notice the forum automatically replaced the kh , and } with the text replacements too, as a point of note.
Dang it! I tried to double-encode those characters, but the forum will have its way... Glad that it helped you, at any rate.