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

Beginner needs some help.

Hello, I'm trying to wrap my head around macro's and syntax but am hitting a bit of a wall with a specific macro for use in the Pathfinder 1E community sheet. This is in the extra damage modifier field. Momentum's Edge: [[?{Did you Spring or Charge with burst?|No, 0|Yes, [[?{Expend Focus?|No, @{speed-base}+10*0.2|Yes, @{Speed-base}+50.2}}]]]] My first issue is that the drop down menu displays 4 options (no, yes, no, yes), the second issue is that the nested query "Expend Focus?" is showing up as a text field instead of a drop down with yes and no. The intention is for it to ask if I used burst with spring attack or charge action, if no then do nothing. If yes then ask if I also expended my focus, if no then add 10 to my base speed  and then multiply it by 0.2. If yes then add 40 to my base speed and multiply it by 0.2. Any help would be appreciated. Thanks!
Lots of errors in there. First, in your Expended Focus Query you have an inline roll started before it, but it doesn't end until after the query finishes, which won't work. Also, make sure you use parentheses to add your speed bonuses before you multiply, otherwise by order of operations it will multiply the 10 or 50(40?) by .2 and add that result to your speed. I could be wrong, but I don't think you can put a query inside another query. Your best bet would be to give three options on the first query- No, Yes w/o Focus, Yes w/ Focus and build your calculations in line with that.
1604706039

Edited 1604706466
Oosh
Sheet Author
API Scripter
I'm not sure about the math, it doesn't quite look right, like Dakota said. But this should fix the macro syntax: Momentum's Edge: [[?{Did you Spring or Charge with burst?|No, 0|Yes, ?{Expend Focus?|No, @{speed-base}+10*0.2|Yes, @{speed-base}+50.2}}]] You need to use HTML replacement on the inner Query, there's more info here . I've removed a set of [[ ]] inline roll brackets so you can actually see the mouseover tooltip to check the math - unless you want to hide some overly complex math to tidy up the tooltip, it's best to use parentheses where possible so you can see what's going on. Unless you wanted to hide the math, then you'll want to put them back in :) It would be simpler to use a single Query as Dakota has suggested, since there are only 3 options (and only two have a result). Nesting gets messy very quickly.
Ok, that makes it much simpler, figured it out from there. Thank you. On a related note, is there a way to hide the damage when "No" is selected?
1604725192

Edited 1604727866
Oosh
Sheet Author
API Scripter
That depends, is this inside another calculation? Or is it outputting to part of a roll template? You can put the inline brackets entirely within the Query so there's no inline roll if you select 'no': Momentum's Edge: ?{Did you Spring or Charge with burst?| No, | Yes no Focus,[[@{speed-base}+10*0.2]]| Yes with Focus,[[@{Speed-base}+50.2]]} Or you can also sneak an API ! in there to disappear the whole line, but this could do some bad things if you're using a roll template (like make the rest of the template disappear): ?{You like thing?| No,!| Yes a bit,[[1| Very much,[[2}d10 + 6]] self-damage!
No, just in that particular calculation. Whenever I try to place a ! in, the macro doesn't complete when that option is chosen.
1604727646
Oosh
Sheet Author
API Scripter
Yep, it turns it into an API command, so it doesn't appear in chat. It'll feed the entire macro to the Kraken - if that's no good, you'll need to use the first option and just leave a space there.
Thanks very much!