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 .
×
The developers are currently investigating an issue with logging in + accessing the VTT.
Create a free account

Divine Favor Beginner Macro

1588139119

Edited 1588139179
Hi guys ! Beginner on Roll20, and I'm trying myself at some macros for Pathfinder, seems a good way to learn more about them. I find Divine Favor kinda tricky. Basically, it should return 1 for caster level 1-5, 2 for 6-8 and 3 for 9 and above. So far, I've come up with that : [[{{floor(@{caster1_level}/3),1}kh1,3}kl1]] I feel like there are quite a few problems here, one of them being the first and second "}". I tried to replace them with their html entity, but all I get is : SyntaxError: Expected ",", ".", "[", "d", "e", "t", "}", [ |\t], [+|\-|*|\/|%] or [0-9] but "&" found. Pretty sure there are too many "," too, but I guess I'm gonna end up with the same issue. Any help ? Is what I'm trying to do actually possible ? Thanks in advance !
1588146291
Ziechael
Forum Champion
Sheet Author
API Scripter
You shouldn't need to nest any keep high/lows: [[{floor(@{caster1_level}/3),3}kl1]] The above should result in a 1, 2 or 3+ depending on level (1-5 =1, 6-8 =2, 9-11=3 etc) which is then capped by the kl value of the 3.
1588168731

Edited 1588176067
First of all, thanks for your answer. The problem is, without the nested keep high, for level 1 and 2, the result will be 0, where it should be 1. Any way around that ? EDIT : I've managed to get it working ! I don't know why, but this works : [[{{floor(@{caster1_level}/3),1}kh1,0d0+3}kl1]]
1588181444
Ziechael
Forum Champion
Sheet Author
API Scripter
Oh yeah, didn't think of the min value lol, your solution is great, it works because the kh function makes the first section a 'roll' by Roll20 standards which means the second kl needs to compare against a roll also (hence why it works with the addition of the '0d0+')... sorry for the mislead!
No problem, and thanks for the explanation, it'll probably help me for future macros :)