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 merry + bright! 🎄
Create a free account

DnD 5e Wild Talent Feat (UA) Macro with template

Hi, I was trying to make a cool macro for the DnD 5e Wild Talent Feat ( UA are always free and publicly accessible ). This is the part i'm focusing on: Changing the Die’s Size. If you roll the highest number on your Psionic Talent die, it decreases by one die size after the roll. This represents you burning through your psionic energy. For example, if the die is a d6 and you roll a 6, it becomes a d4. If it’s a d4 and you roll a 4, it becomes unusable until you finish a long rest. Conversely, if you roll a 1 on your Psionic Talent die, it increases by one die size after the roll, up to its starting size. This represents you conserving psionic energy for later use. For example, if you roll a 1 on a d4, the die then becomes a d6. Whenever you finish a long rest, your Psionic Talent die resets to its starting size. When you reach certain levels in this class, the starting size of your Psionic Talent die increases: at 5th level (d8), 11th level (d10), and 17th level (d12). In a nutshell, I'd like a macro that firstly uses query to ask the player which is their dice size, then rolls the dice and sends the result. Then i'd like the macro to write a simple note that if the <result of the roll> is the maximum number rolled, the feat rules that the dice decrease in size, meanwhile the <result> is 1, the dice increase to the next size in order. With the help of the roll20 wiki, i've made up this spaghetti code (sorry for bad english too) &{template:default} {{name=Psionic Talent}} {{Dice Size= ?{Psionic Talent dice size?|d4|d6|d8|d10|d12} }} {{Psionic Talent Dice= [[ ?{Psionic Talent dice size?|d4|d6|d8|d10|d12} ]] }} {{Decreasing Dice size= If $[[0]] = the maximum number of the dice, it decreases of one size, after decreasing from d4 it becomes disabled}} {{Increasing Dice size= If $[[0]] = 1, the dice size increases to the next one available}} Is there a way to make the code more smart? Something like confronting the result with the maximum/minimum dice number and write the right size changing without writing everything, and don't add anything as a note if the result is a number in middle. Last small thing: how can I set the critical failure and critical success color to be reversed with query rolls? For example, since 6 is the worst result on a d6 (it decrease the dice size of the next roll) its border should be red, not green I know the normal roll whould be 1d6cf6cs1, but idk how to implement in a query.
By changing the query to only have the die size in it's result it can be used directly for comparisons and the critical failure colouring. Then use can use template overwriting and some roll referencing to show the Die size, the Psionic talent dice result and conditionally show what the die size has changed to on a critical success/failure, with the limit that the text for increasing and decreasing is the same &{template:default} {{name=Psionic Talent}} {{Dice Size[1](" hidden)}} {{Psionic Talent Dice=$[[0.computed]]}} {{Dice Size[[[{abs(?{Psionic Talent dice size?|d4,4|d6,6|d8,8|d10,10|d12,12}-[[{ {12},{4,?{Psionic Talent dice size?} + 2*[[{2,[[d?{Psionic Talent dice size?}cs1cf?{Psionic Talent dice size?}]]}<1f>?{Psionic Talent dice size?}]]}k1}kl1 ]]),1}<0]]](" hidden)=**has changed to d**$[[2]]}} {{Dice Size[1](" hidden)=d?{Psionic Talent dice size?}}}
RainbowEncoder said: By changing the query to only have the die size in it's result it can be used directly for comparisons and the critical failure colouring. Then use can use template overwriting and some roll referencing to show the Die size, the Psionic talent dice result and conditionally show what the die size has changed to on a critical success/failure, with the limit that the text for increasing and decreasing is the same &{template:default} {{name=Psionic Talent}} {{Dice Size[1](" hidden)}} {{Psionic Talent Dice=$[[0.computed]]}} {{Dice Size[[[{abs(?{Psionic Talent dice size?|d4,4|d6,6|d8,8|d10,10|d12,12}-[[{ {12},{4,?{Psionic Talent dice size?} + 2*[[{2,[[d?{Psionic Talent dice size?}cs1cf?{Psionic Talent dice size?}]]}<1f>?{Psionic Talent dice size?}]]}k1}kl1 ]]),1}<0]]](" hidden)=**has changed to d**$[[2]]}} {{Dice Size[1](" hidden)=d?{Psionic Talent dice size?}}} It works like a charm! Thank you really much