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

My character can jump a negative height.

Hello, Looking into the macro engine and its abilities I started on writing a "jump" macro, to practise a bit. With a two query fields you can choose whether it's a "high" or "long" jump and whether you jump from stand or running. That I got to work. The jump height (or distance, depending on what you chose, I can't seem to show the choice in the answer) shows a calculated distance. All fine. However, there is a little line that says: "with a minimum of 0ft.", and I can't figure out how to do that. I tested it on my mage, who isn't among the most strong gnomes outthere, and he can jump a negative height. This is what i have so far: @{selected|character_name} jumps  [[{floor(?{Type of jump|Long,@{selected|strength}|High,@{selected|strength_mod}}/?{Running start|yes,1|no,2})} ]] ft. And there I got stuck.
1620574496

Edited 1620574653
Ziechael
Forum Champion
Sheet Author
API Scripter
You can use the kh (keep highest) function to ensure it can't go below 0: @{selected|character_name} jumps [[ { floor(?{Type of jump|Long,@{selected|strength}|High,@{selected|strength_mod}}/?{Running start|yes,1|no,2}) ,0}kh1 ]] ft.
Thank you very much. that did the trick.