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

Multiple Drop Down modifiers how to sum up

i have the following , some rolls require lots of different modifiers for different things, how can i get them to add together 1 Test ?{Moving?|No,No:= [[ +3 |Quick,Quick:= [[ -2 }]] + ?{Cover?|None,None:= [[ -5 |Full,Full:= [[ 0 }]] + ?{Lighting?|None,None:= [[-7 |Torchlight,Torchlight:= [[0 | Midday,Midday:= [[+5}]] + ?{Sleeping?|Yes,Yes:= [[-9 |No,No := [[0}]] the drop downs work etc , but i assume i am needing some extra brackets etc but not sure where thanks
1539924860
GiGs
Pro
Sheet Author
API Scripter
I dont think what you want is possible. You can have a query return a number, or text (as yours does), but if it is returning text that cant be used as a number. For instance, your Moving query returns something like " No:= [[+3 ". There's no way to use that as an actually number. You can see that trying to add  No:= [[+3   to None:= [[ -5 just doesnt make sense, because they aren't numbers. The fact that you've put those numbers inside inline brackets doesnt matter - roll20 still cant see that as a distinct number, it;s just text. What you might be able to is use tags, like so /roll ?{Moving?|No,[[3|Quick,[[ -2} [Moving] ]] +  In chat that will print out the number, and the Moving tag, so you can see where the mod came from.  It's a very weirdly constructed macro though.
fair enough it was an attempt at a variation of one i found elsewhere that works but it give dice instead of values, Save vs ?{Choose Your Save?| Spell, Spell:= [[ 1d20 | Ritual, Ritual:= [[ 1d20 | Psionics, Psionics:= [[ 1d20 | Poison/Toxin, Poison/Toxin:= [[ 1d20 | Insanity, Insanity:= [[ 1d20 | Horror Factor, Horror Factor:= [[ 1d20 | Possession, Possession:= [[ 1d20 | Coma/Death, Coma/Death:= [[ 1d100 } + ?{Modifier?|0} ]]
1539937292
Ziechael
Forum Champion
Sheet Author
API Scripter
As G G says, I think tags are the way forward here. I don't fully understand the specifics but the below would do what your macro is attempting and, when hovering over the result, the tags will show the what and why: [[ ?{Moving|No,3[Not Moving]|Quick,-2[Quick]} + ?{Cover|None,-5[No Cover]|Full,0[Full Cover]} + ?{Lighting|None,-7[No Lighting]|Torchlight,0[Torchlight]|Midday,5[Midday]} + ?{Sleeping|Yes,-9[Asleep]|No,0[Awake]} ]]
perfect thanks , exactly what i needed help with , thanks a lot.
1539939449
GiGs
Pro
Sheet Author
API Scripter
Peter M. said: fair enough it was an attempt at a variation of one i found elsewhere that works but it give dice instead of values, Save vs ?{Choose Your Save?| Spell, Spell:= [[ 1d20 | Ritual, Ritual:= [[ 1d20 | Psionics, Psionics:= [[ 1d20 | Poison/Toxin, Poison/Toxin:= [[ 1d20 | Insanity, Insanity:= [[ 1d20 | Horror Factor, Horror Factor:= [[ 1d20 | Possession, Possession:= [[ 1d20 | Coma/Death, Coma/Death:= [[ 1d100 } + ?{Modifier?|0} ]] In case you're curious, the reason the above macro worked was because there was no text inserted in the middle of the calculation. Any output would look like (for instance): Save vs Psionics:= [[1d20 + ?{Modifier?|0} ]] That's a perfectly legitimate macro. You just cant put any more text in between the the 1d20+ and Modifier without breaking the calculation. tags are the only thing that roll20 accepts, as it knows to ignore those.
thanks , still trying to work things out , really appreciate the help.
You maybe can change your numbers to dice rolls, like -3 becomes - 3d1 and 2 becomes 2d1.  Then when you build your string of text, you put the final output all inside an inline roll, which should parse out the die rolls as the only results that they can generate.  Alternatively you might be able to do a 0d0-3 and 0d0+2 for the rolls, and I think those will be parsed out and evaluated too.
1539950869

Edited 1539950929
GiGs
Pro
Sheet Author
API Scripter
Aranador, those wouldn't help with the question in the OP. The issue is with trying to have multiple queries in a row each provide two bits of information: a label, and a number, and have those numbers all work in a single calculation. Roll20 queries can only return one or the other (text or number). Though as discussed above, tags are a way to incorporate a label into the number in a way that roll20 dice macros accept.