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

Setting a value cap for number taken from character sheet

December 11 (4 years ago)

The healer in my Pathfinder game is trying to set up an easy macro for her cure spells.  The cure spells do:

Light - 1d8 + caster level (max 25)
Moderate - 2d8 + caster level (max 10)
Serious - 3d8 + caster level (max 15)
Critical - 4d8 + caster level (max 20)

I've got a macro set up to create a drop down menu and roll the correct number of dice plus caster level but I can't figure out and don't know how to create caps for the caster level.  PC is currently level 13 with caster level 11.


?{Spell|Light, **Cure Light Wounds:** [[1d8+@{Serena Ziegler|spellclass-0-level-total}]]| Moderate, **Cure Moderate Wounds:** [[2d8+@{Serena Ziegler|spellclass-0-level-total}]]| Serious, **Cure Serious Wounds:** [[3d8+@{Serena Ziegler|spellclass-0-level-total}]]| Critical, **Cure Critical Wounds:** [[4d8+@{Serena Ziegler|spellclass-0-level-total}]]}

December 11 (4 years ago)

Edited December 11 (4 years ago)
Oosh
Sheet Author
API Scripter

You just need to wrap the Attribute in a keep-lowest group operator. It's slightly complicated by the fact that it's inside a Query, so we have to escape a couple of characters which would otherwise break the Query (the , and })

{@{Serena Ziegler|spellclass-0-level-total},25}kl1

This will cap the level at 25 - {@{Attribute}, 25}kl1 without the HTML replacement.

December 11 (4 years ago)
I've barely scratched the surface of understanding macros.  Could you please explain the
,25}kl1

part?

December 11 (4 years ago)

Edited December 11 (4 years ago)
Jordan C.
Pro
API Scripter


Lianara said:

I've barely scratched the surface of understanding macros.  Could you please explain the
,25}kl1

part?


Not Oosh, but the ',' escapes (replaces) the comma (",") and the '}' escapes the right curly brace ("}") since you cannot use the literal characters inside of the query Oosh refers to.

The "kl1" means keep whichever value is lower, the 25 or the attribute

December 11 (4 years ago)

Ahhh, ok, thanks!  Also, as an edit, the page I was looking at for Cure Light Wounds has a typo, it should be +5 max, for anyone else interested in using this.