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

How to check multiple conditions?

1558539663

Edited 1558539787
Hi all, I am trying to nest some conditions one after the other (e.g. roll a dice to select a result in a scheme and then roll another dice to select another result in a sub-scheme). In practice, I want to check a condition and if it is verified I want to check another set of sub-conditions. I tried to do that using the script: "extended expressions" but it did not work. Every time I do so it the sandbox API server crashes. Do you have any idea of how to solve it? 
Hello, I'm a player working with @Master in the same campaign! Here is the link to the git repo where you can find the script we are using link
1558540502
The Aaron
Roll20 Production Team
API Scripter
I remember extended expressions being somewhat persnickety. If you can give a more detailed description of the problem you are trying to solve, I can probably just write you a snippet to do it. The more examples of input and expected output, the easier it is to help. 
ok so this is a snippet of the macro we are using: /em has been critically hit: !extend `(1d100)[loc]``(1d10)[spec_10]``(1d12)[spec_12]`, `(${loc}>=1 && ${loc}<=12 && ${spec_10}<=6 ? "Head: Skull" : "")` `(${loc}>=1 && ${loc}<=12  && ${spec_10}>6 ? "Head: Face" : "")` there are different problems that we are facing: I can't save a dice roll inside the condition (i.e using '(1d10) [something] '  instead of writing "Head: Skull") I can't nest conditions (i.e using another if condition when the first one is satisfied) I can't even use other normal expressions native to Roll20 (i.e I tried using &(parameter|0) after using !extend but it doesn't work) I'm not that familiar with Roll20 API yet, so I don't really know how I could modify the script (if it is needed) or if what I want is straight out impossible.
1558612763

Edited 1558612846
The Aaron
Roll20 Production Team
API Scripter
Sorry, I wasn't specific enough. Can you give examples of the mechanic you're trying to implement, not the script use.&nbsp; It looks like you're rolling 1d100 and consulting a lookup table, then consulting a sub table with 1d10, etc? Would RecursiveTable get you what you want? &nbsp; <a href="https://app.roll20.net/forum/post/5954076/script-update-recursivetables-now-with-rollable-table-images-and-better-prefixing-rules-for-roll-templates" rel="nofollow">https://app.roll20.net/forum/post/5954076/script-update-recursivetables-now-with-rollable-table-images-and-better-prefixing-rules-for-roll-templates</a>
What we want is to have a macro with which we can roll a d100 first (just like consulting a lookup table yes); depending on the result we roll either a d10 or d12 and consult another table. The problem is the second result is bound to the first, and we want everything together. Anyway I'll go and check if we can solve everything with your script, thanks!
1558619576
The Aaron
Roll20 Production Team
API Scripter
That should be no problem to implement with RecursiveTable, that's pretty much the exact use case. Instead of using raw dice, you'd just set up a series of Rollable Tables. You use inline rolls in earlier entries to expand later ones.
1558627055

Edited 1558627140
I have read your doc and I'm not sure that's what we want; let me give you a complete example of what we want. I am an 8th level cleric with 50 PF and 16 WIS, a 7DV large monster critically hits me. First we have to see where I have been hit, so we roll d100, let's say we get 13, we check on a table and 13 it's head but head can either be face or skull; so we roll 1d10 and get 8, 8 it's face. After we check the severity of the hit, so we roll 1d100 (or two if I have a particular ability, we need to ask the user) and get 33 as a base result. Then we do a WIS check, rolling a d20 we get 11, so 16(WIS Value) - 11 = 5. We have a bonus of 5, from 33 we go down to 28. The monster is large tough so we get a malus of 5, from 28 we go up to 33 again. Now let's say that after another couple of operation and check we get 21 as our final number, 21 it's a light critical hit. We then go to a table named Head|Face and check what a light critical hit on the face does. Now we do all of this manually, but it takes a LOT of time and we are searching for ways to hasten the process! Sorry for the really long and complicate post, and thanks anyway for all the reply and suggestion you are giving us!
1558629737
The Aaron
Roll20 Production Team
API Scripter
No problem, that's great detail. What system is this? I think writing a custom script will be the only satisfactory solution.&nbsp;
I see, I'll check for a work around in the meantime, thanks again for you suggestions! About the system: it is based on AD&amp;D, but from there it has been expanded and modified over 30 years! Unfortunately it's only in Italian but you can find it here