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

Query same label, different input

1486692899

Edited 1486693127
Tetsuo
Forum Champion
Is it possible to use a query to select the label once, and make multiple different choices? Example: {{Damage=?{Test|One, 1 physical|Two, 2 Mental} }} {{Damage 2= ?{Test|One, 4 acid|Two, 6 fire} }} I basically have choices that always go together, but will have different outputs and I don't want to do multiple different queries every time i roll a macro.
1486693467
The Aaron
Pro
API Scripter
nope.
1486700237

Edited 1486700628
Silvyre
Forum Champion
Typical workarounds: {{Damage=?{Test|One, 1 physical / 4 acid|Two, 2 Mental / 6 fire} }} ?{Test|   One, {{Damage=1 physical}} {{Damage 2=4 acid}} |   Two, {{Damage=2 Mental}} {{Damage 2=6 fire}} } {{Damage=[[ 1 - ?{Test|One, 0|Two, 1} ]] physical / [[ ?{Test} * 2 ]] Mental}} {{Damage 2=[[ (1 - ?{Test}) * 4 ]] acid / [[ ?{Test} * 6 ]] fire}}
1486702776

Edited 1486702784
Tetsuo
Forum Champion
here's the macro I'm working on: !power {{ --name|Onslaught --format|at-will --Attack Roll|[[ [$Roll] 1d20]] vs Difficulty --Effort Level|?{Level of Effort?|[[0]]|[[1]]} --Damage|?{Damage Type?|Physical, [[4]] physical|Mental, [[2]] mental} --?? $Roll == 17 ?? Extra Damage|[[1]] extra damage --?? $Roll == 18 ?? Extra Damage|[[2]] extra damage --?? $Roll == 19 ?? Extra Damage|[[3]] extra damage or minor effect --?? $Roll == 20 ?? Extra Damage|[[4]] extra damage or major effect --Cost|[[1 + [[?{Level of Effort?|0|1}*3]] - @{Kythas|Intellectedge}]] }} I want to remove the damage line and factor in the extra damage with the main damage. so It'd look like this --?? $Roll <= 16 ?? Damage|?{Damage Type?|Physical, [[4]] physical|Mental, [[2]] mental} --?? $Roll == 17 ?? Damage|?{Damage Type?|Physical, [[5]] physical|Mental, [[3]] mental} --?? $Roll == 18 ?? Damage|?{Damage Type?|Physical, [[6]] physical|Mental, [[4]] mental} --?? $Roll == 19 ?? Damage|?{Damage Type?|Physical, [[7]] physical|Mental, [[5]] mental} or ?{Damage Type?|Physical, [[4]] physical|Mental, [[2]] mental} and minor effect --?? $Roll == 20 ?? Damage|?{Damage Type?|Physical, [[8]] physical|Mental, [[6]] mental} or ?{Damage Type?|Physical, [[4]] physical|Mental, [[2]] mental} and mmajor effect
1486708572

Edited 1486711879
Silvyre
Forum Champion
Looks like you'll want something like this: !power {{ --name|Onslaught --format|at-will --Attack Roll|[[ [$Roll] 1d20 ]] vs Difficulty --Effort Level|?{Level of Effort?|0|1} --?? $Roll <= 16 ?? Damage|[[ ?{Damage Type?|Physical, 4 ]] physical|Mental, 2 ]] mental} --?? $Roll == 17 ?? Damage|[[ 1 + ?{Damage Type?} --?? $Roll == 18 ?? Damage|[[ 2 + ?{Damage Type?} --?? $Roll == 19 ?? Damage|[[ 3 + ?{Damage Type?} or [[ ?{Damage Type?} and minor effect --?? $Roll == 20 ?? Damage|[[ 4 + ?{Damage Type?} or [[ ?{Damage Type?} and major effect --Cost|[[ 1 + [[?{Level of Effort?}*3]] - @{Kythas|Intellectedge} ]] }} Alternatively, this will work, too: !power {{ --name|Onslaught --format|at-will --Attack Roll|[! [^Roll] !] vs Difficulty --Effort Level|[[ ?{Level of Effort?|0|1} ]] --Damage|[[ (5 - (21 - [$Roll|NH] {1d20}) % 20%19%18%17%16%15%14%13%12%11%10%9%8%7%6%5) % 5 + ?{Damage Type?|Physical, 4 ]] physical|Mental, 2 ]] mental} --?? $Roll.base == 19 ?? !Minor| ~R or [[ ?{Damage Type?} and minor effect ~R --?? $Roll.base == 20 ?? !Major| ~R or [[ ?{Damage Type?} and major effect ~R --Cost|[[ 1 + [[?{Level of Effort?}*3]] - @{Kythas|Intellectedge} ]] }} ( [[ (5 - (21 - [$Roll] 1d20) % 20%19%18%17%16%15%14%13%12%11%10%9%8%7%6%5) % 5 ]] emulates [[ [$Roll] {1d20 - 16, 0d0}kh1 ]] but actually works with $Roll.base...)
1486719114

Edited 1486719160
Tetsuo
Forum Champion
Man, just when you think you know things,Silvyre is here to crush dreams. Can you explain the purpose if the damage line in the second one? What's the point of all the % signs?
1486724220

Edited 1486725083
Silvyre
Forum Champion
Franky H. said: Man, just when you think you know things,Silvyre is here to crush dreams. Can you explain the purpose if the damage line in the second one? Yup and sure; that's my job! I wanted to see if I could amalgamate the four --?? $Roll [...] ?? Damage| tags into a single --Damage| tag. --Damage|[[ [$Roll] {1d20 - 16, 0d0}kh1 + ?{Damage Type?} ]] intuitively seemed like a good way to do this; it would perfectly conform to what we needed: $Roll Extra Damage <=16 0 17 1 18 2 19 3 20 4 Unfortunately, $RollIDs do not (yet?) play nice with {}kh1 functions... For example, [^Roll] and [^Roll.base] were returning the value of the entire {}kh1 function instead of the base value of 1d20. (Attempting to use something like { [$Roll] 1d20 - 16, 0d0 }kh1 results in $Roll not getting properly parsed by PowerCards, returning "Roll ID Not Found".) So, I had to find a replacement for {1d20 - 16, 0d0}kh1. (1d20 - 16 + abs(1d20 - 16)) / 2 won't work for obvious reasons, so I came up with another solution that takes advantage of two 'properties' of modulo operations; for numbers M, N such that M < N ≠ 0: M % N = M (call this Property 1) N % N = 0 (call this Property 2) (21 - [$Roll] 1d20) % 20 % 19 % 18 % 17 % 16 % 15 % 14 % 13 % 12 % 11 % 10 % 9 % 8 % 7 % 6 % 5 Looking at the code above; if 1d20 rolls between 17 and 20, (21 - 1d20) resolves to equal a number between 4 and 1. By Property 1, those numbers are 'unaffected' by the modulo operations. If 1d20 rolls less than 17, (21 - 1d20) resolves to equal a number between 20 and 5. By Property 2, each of those numbers are 'eliminated' to 0 by one of the respective modulo operations. So, with the code above, I had so far managed to get pretty close to the table of values above, i.e. $Roll Extra Damage <=16 0 17 4 18 3 19 2 20 1 Subtracting the above code from 5 (and appending %5 to 'eliminate' unwanted values of 5-0) finally aligned the macro with the desired table of values.
1486725837
Tetsuo
Forum Champion
That is infinitely complicated, and yet, basically makes sense when you explain it. I would have never thought to do it that way. Thanks a lot!
1486725881
Silvyre
Forum Champion
You're very welcome! Happy rolling!