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 .
×
May your rolls be chill this holiday season!
Create a free account

Help with Macro for consecutive queries.

I'll preface this by saying that i am a complete Noob when it comes to macros. I know some basic stuff but that's it. I'm running a game of CAIN by Tom Bloom which isn't available on roll20 and thought of making some Macros to make my player's lives easier. Here's the parameters i'm working with: Ask for dificulty. If Normal, count the number of rolls 4 or higher onthe d6. If Hard, coun the number of rolls equal to 6 on the d6. Then query the amount of dice rolled. it goes from 0d to 9d. Where nd is the number of d6 and 0d means two d6 dropping the highest roll. Then it queries risk. If risky, roll a separate d6. If regular it doesn't roll anything. there'sno success or failure in the risk, just the raw value. I tried many things but ultimatley decided to ask ChatGPT for some help and it gave me two options. In botth cases it queries me everything but it doesn't roll. I'm having it be in template so it looks better as well. OPTION 1 &{template:default}  {{name=Action Roll}} {{Difficulty=**?{Difficulty|Normal|Hard}**}} {{Dice= [[    ( ?{Number of Dice|0d,0|1d,1|2d,2|3d,3|4d,4|5d,5|6d,6|7d,7|8d,8|9d,9} )d6   +   ( 2d6kl1 * (1 - floor(?{Number of Dice}/1)) ) ]] }} {{Successes= [[    {      (       [[         (?{Number of Dice}d6 + 2d6kl1 * (1 - floor(?{Number of Dice}/1)))       ]] >= 4     ) * ( ?{Difficulty}=Normal )     +     (       [[         (?{Number of Dice}d6 + 2d6kl1 * (1 - floor(?{Number of Dice}/1)))       ]] = 6     ) * ( ?{Difficulty}=Hard )   } ]] }} {{Risky Roll= [[ 1d6 * ( ?{Risky?|No,0|Yes,1} ) ]] }} OPTION 2 &{template:default}  {{name=Action Roll}} {{Difficulty=**?{Difficulty|Normal|Hard}**}} {{Dice Rolled= [[    ( ?{Number of Dice|0d,0|1d,1|2d,2|3d,3|4d,4|5d,5|6d,6|7d,7|8d,8|9d,9} )d6   +   ( 2d6kl1 * (1 - floor(?{Number of Dice}/1)) ) ]] }} {{Successes= [[    (     ( ?{Number of Dice}d6>3 ) +     ( 2d6kl1>3 * (1 - floor(?{Number of Dice}/1)) )   ) * ( ?{Difficulty}=Normal )   +   (     ( ?{Number of Dice}d6cs6cf5 ) +     ( 2d6kl1cs6cf5 * (1 - floor(?{Number of Dice}/1)) )   ) * ( ?{Difficulty}=Hard ) ]] }} {{Risky Roll= [[ 1d6 * ?{Risky?|No,0|Yes,1} ]] }}
1763842799
Gauss
Forum Champion
Hi Morpheus,  First let me say, I wouldn't even bother with ChatGPT on this. Roll20 is too niche for it to know what is going on here.  Second, let me see if I understand what you need.  You need a variable "difficulty" (4 or 6). You also need a variable number of dice? Also, 0d is 2d6kl1.  So I am seeing:  0d6 = 2d6kl1>?{Difficulty|Normal,4|Hard,6} 1d6 = 1 d6>?{Difficulty|Normal,4|Hard,6} 2d6 = 2 d6>?{Difficulty|Normal,4|Hard,6} 3d6 = 3 d6>?{Difficulty|Normal,4|Hard,6} and so on up to 9d6.  Then you have the Risky Roll tacked on, that is the simplest thing.  Have I missed anything?
Nop, nothing else. You got variable difficulty, variable dice pool and risk, which is a standalone thing.
1763844828

Edited 1763845074
Gauss
Forum Champion
Here you go:  &{template:default} {{name=Action Roll}} {{Dice=[[?{Number of Dice|0d,2d6kl1|1d,1d6|2d,2d6|3d,3d6|4d,4d6|5d,5d6|6d,6d6|7d,7d6|8d,8d6|9d,9d6}>?{Difficulty?|Normal,4|Hard,6}]]}} {{Risky Roll=[[?{Risky?|No,0|Yes,1}d6]]}} If you want it to report the Difficulty at the start of the template like the ChatGPT version then either it needs an extra query (not recommended) or we can leverage a Rollable Table to provide that. But to create it you need GM permissions in your game or the GM needs to help with it.  Do you have GM permissions in your game?  If your GM needs to do it it should only take a couple minutes. 
THANK YOU SO MUCH! I just tested it and it is working wonderfully. I really appreciate you taking the time to help me figure it out. I was going insane trying to understand how to fit everything together.
1763865737
Gauss
Forum Champion
Did you want the difficulty stated at the start of the template?
To be honest i didn't know chat cgpt was attempting to display on the chat if the roll was hard or not. But sure, that would be very helpful. How would i go about doing that? if it isn't too much trouble though
1763926747
Gauss
Forum Champion
Are you the GM of the game? If not it will require about 5 minutes of your GM's time.
Yeah, I'm the GM. 
1763933647

Edited 1763934362
Gauss
Forum Champion
Alright here is the procedure then:  Go to the Collection tab (top right corner) Scroll down to the Rollable table section Click Add Name the first Rollable Table "4Difficulty" (without quotes) Add one object in the table and name it "Normal" (without quotes) Save the object, save the table.  Click Add again Name the second Rollable Table "6Difficulty" (without quotes) Add one object in the table and name it "Hard" (without quotes) Save the object, save the table.  Change the macro to:  &{template:default} {{name=Action Roll}} {{Difficulty=[[1t[?{Difficulty?|Normal,4|Hard,6}Difficulty]]]}} {{Dice=[[?{Number of Dice|0d,2d6kl1|1d,1d6|2d,2d6|3d,3d6|4d,4d6|5d,5d6|6d,6d6|7d,7d6|8d,8d6|9d,9d6}>?{Difficulty?}]]}} {{Risky Roll=[[?{Risky?|No,0|Yes,1}d6]]}} That will include the difficulty as a statement.
Jus Tested it and it's working wonders. Again, i can't really thank you enough for helping me out with it and taking time out of your day to figure this out! You're awesome