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

Daggerheart Duality Macro

I am trying to set up a custom macro to roll the duality dice in roll20 without using the API. I have the following macro I found on the forums here: &{template:default} {{name=Agility Action Roll}}{{Hope=$[[0.computed]]}} {{Fear=$[[1.computed]]}} {{Total=[[ [[1d12[Hope] ]] + [[1d12[Fear] ?]] ?{Advantage|Regular, |Advantage,+ 1d6|Disadvantage,- 1d6} + @{selected|agility} + ?{Modifier?|0}}}]] }} I am trying to give an option to swap out the size of Hope and/or Fear dice. This is what I have: &{template:default} {{name=Agility Action Roll}}{{Hope=$[[0.computed]]}} {{Fear=$[[1.computed]]}} {{Total=[[ [[?{Hope|d12, [[d12]]|d20, [[d20]]|d8, [[d8]]}[Hope] ]] + [[?{Fear|d12, [[d12]]|d20, [[d20]]|d8, [[d8]]}[Fear] ?]] ?{Advantage|Regular, |Advantage,+ 1d6|Disadvantage,- 1d6} + @{selected|agility} + ?{Modifier?|0}}}]] }} It seems to work when I run it, allowing me to choose the Hope and Fear dice sizes. However, it when it actually rolls, it appears to roll the correct die size for the Hope die, and Fear die, and outputs the total correctly, but in the Fear section, it puts the Hope value instead of what was rolled on the Fear die. See pics. Any idea how I can fix this?  Also, any way without using the API, is there a macro that would give me an option to just do a regular roll without advantage/disadvantage or changing die sizes that would allow me to 2-click (i.e. click the macros and click "normal") to just roll the duality dice + the trait. And then have another option that's maybe "modified", where it becomes several clicks as they confirm die sizes, advantage/disadvantage other modifier. Thanks in advance for any help.
1767283796
timmaugh
Forum Champion
API Scripter
Rich McNutt said: I am trying to give an option to swap out the size of Hope and/or Fear dice. This is what I have: &{template:default} {{name=Agility Action Roll}}{{Hope=$[[0.computed]]}} {{Fear=$[[1.computed]]}} {{Total=[[ [[?{Hope|d12, [[d12]]|d20, [[d20]]|d8, [[d8]]}[Hope] ]] + [[?{Fear|d12, [[d12]]|d20, [[d20]]|d8, [[d8]]}[Fear] ?]] ?{Advantage|Regular, |Advantage,+ 1d6|Disadvantage,- 1d6} + @{selected|agility} + ?{Modifier?|0}}}]] }} It seems to work when I run it, allowing me to choose the Hope and Fear dice sizes. However, it when it actually rolls, it appears to roll the correct die size for the Hope die, and Fear die, and outputs the total correctly, but in the Fear section, it puts the Hope value instead of what was rolled on the Fear die. <SNIP> Any idea how I can fix this?  Hey, Rich... I think the problem is that your macro relies on roll index 0 being Hope, and roll index 1 being Fear, but in this variation, you've introduced inline rolls that are each going to gobble up a roll index and therefore make your numbering be off. Just keep your Hope query for die size within the inline roll brackets that are already there, but remove the brackets that are a part of each entry (which actually means you don't need the separate "label,value" construction of each query entry): [[?{Hope|d12|d20|d8}[Hope] ]] Now that inline roll has no sub-rolls within it, and is going to get the $[[0]] roll marker. Do the same with Fear (which also had a random question mark at the end, which I'll remove): [[?{Fear|d12|d20|d8}[Fear] ]] Rich McNutt said: Also, any way without using the API, is there a macro that would give me an option to just do a regular roll without advantage/disadvantage or changing die sizes that would allow me to 2-click (i.e. click the macros and click "normal") to just roll the duality dice + the trait. And then have another option that's maybe "modified", where it becomes several clicks as they confirm die sizes, advantage/disadvantage other modifier. So... you could always have 2 macros (one for normal, and one for "modified to allow choices"), so I don't think that's what you mean. I think you're maybe looking for a macro option that creates a decision tree of: Click 1 => Start process; < Generate a way to choose between Normal & Modified>     Choosing Normal (Click 2) => rolls Normal (non-Adv/non-Disad) with      a 1d12 for both Hope & Fear; outputs result     Choosing Modified (Click 2) => prompts for Normal/Adv/Disad; prompts for Hope die size; prompts for Fear die size; rolls and outputs result While you can do this with nested queries, I wouldn't recommend it.... I'd suggest you do it with a Chat Menu , then you can easily expand it, later, if you want to add more options. Here's the basic approach... Here is the base Duality roll, with no option to choose Normal/Adv/Dis, and defaulted to d12s for both Hope and Fear: &{template:default} {{name=Agility Action Roll}}{{Hope=$[[0.computed]]}} {{Fear=$[[1.computed]]}} {{Total=[[ [[1d12[Hope] ]] + [[1d12[Fear] ?]] + @{selected|agility} + ?{Modifier?|0}}}]] }} Save that to a Collection Tab macro called (for now), "BaseDuality". You can rename it, of course... you just have to chase that renaming through the rest of the example. Now, here is the Duality roll with all the levers and dials bolted on: &{template:default} {{name=Agility Action Roll}}{{Hope=$[[0.computed]]}} {{Fear=$[[1.computed]]}} {{Total=[[ [[?{Hope|d12|d20|d8}[Hope] ]] + [[?{Fear|d12|d20|d8}[Fear] ]] ?{Advantage|Regular, |Advantage,+ 1d6|Disadvantage,- 1d6} + @{selected|agility} + ?{Modifier?|0}}}]] }} Save that to another Collection Tab macro called (for now), "ModifiedDuality". Same caveats about potential renaming apply. Finally, create a third Collection Tab macro and put this text in the action: &{template:default} {{name=Duality Roll}} {{Base=[Roll Base](!
#BaseDuality)}}{{Modified=[Roll Modified](!
#ModifiedDuality)}} Save this macro (name it whatever you like) and run it. You should get a menu of 2 buttons offering the decision tree pathways outlined, above. Make sure you check the box for these macros that your players can run them. Also, consider that the third macro, above, is an open chat command... meaning everyone in the game would see it. If you want it, instead, whispered to a particular player, you can put a "/w @{selected|token_name}" at the start. That will require that the player has their token selected, and that token represents a character... but it would allow for the case where the *player* would click on a button to generate a menu of options for them to make a Duality roll. The benefit of the menu option is that you can add roll configurations, easily. You could have options for the base Duality roll where the Modifier is hard-coded to be 0, 1, 2, 3, etc. In that case, you'd remove the query for the Modifier from the BaseDuality macro, then save versions of that macro where you replace the modifer query with a +0, +1, etc. Then you could have multiple buttons in that section: {{Base= [Roll with +0](!
#BaseDuality)%NEWLINE% [Roll with +1](!
#BaseDuality_1)%NEWLINE% [Roll with +2](!
#BaseDuality_2)%NEWLINE% [Roll with +3](!
#BaseDuality_3)}} So you could save having to answer the Modifier query, and just click the button for the correct value:
That's perfect! Thank you so much! I am going to use the chat menu idea. I agree that will work a lot better. Follow-up question. Would there be any way within this macro without using the API to do one or both of the following? 1. Indicate that a roll is a critical (i.e. when both the Hope and Fear die are the same value). 2. Indicate a roll with Hope (Hope die higher) or Fear (Fear die higher).
1767298407
timmaugh
Forum Champion
API Scripter
I can crack part of the extra requirements, but I know when I get to this point I typically reach for scripts... so let me call in reinforcements and see if they have a better idea...
Thanks!
To manage those extra requirements requires some significant changes but here we are:- # BaseDuality &{template:default} {{name= [[[ $[[13]][Hope] + $[[52]][Fear] +@{selected|agility} +0]]] $[[$[[66]]]] [[[[[ [[ ({1,$[[25]]-$[[65]]+1}>2f<0)*2 + 6*12+9 ]] $[[$[[0]]]] [[1d12 Hope]] [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ 0 ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] [[12]][[11]][[10]][[9]][[8]][[7]][[6]][[5]][[4]][[3]][[2]][[1]] [[12]][[11]][[10]][[9]][[8]][[7]][[6]][[5]][[4]][[3]][[2]][[1]] $[[37]] [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ 0 ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] $[[$[[39]]]] [[ [[1d12 Fear]]+39 ]] [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ 0 ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] [[12]][[11]][[10]][[9]][[8]][[7]][[6]][[5]][[4]][[3]][[2]][[1]] [[12]][[11]][[10]][[9]][[8]][[7]][[6]][[5]][[4]][[3]][[2]][[1]] $[[78]] [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ 0 ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]]]]] }} [[[0 [[0]] {{With Fear!}} ]]] {{name= }} [[[0 [[0]] {{Critical!}} ]]] {{name= }} [[[0 [[0]] {{With Hope!}} ]]] {{name= }} {{Hope=$[[0]] }} {{Fear=$[[38]] }} {{Total=$[[53]] }} {{name=Agility Action Roll }} #ModifiedDuality &{template:default} {{name= [[[ $[[21]][Hope] + $[[84]][Fear] ?{Advantage|Regular, |Advantage,+1d6|Disadvantage,-1d6} +@{selected|agility} +(?{Modifier?|0}) ]]] $[[$[[106]]]] [[[[[ [[ ({1,$[[41]]-$[[105]]+1}>2f<0)*2 + 6*20+9 ]] $[[$[[0]]]] [[1?{Hope|d12|d20|d8} Hope]] [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ 0 ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] [[20]][[19]][[18]][[17]][[16]][[15]][[14]][[13]][[12]][[11]][[10]][[9]][[8]][[7]][[6]][[5]][[4]][[3]][[2]][[1]] [[20]][[19]][[18]][[17]][[16]][[15]][[14]][[13]][[12]][[11]][[10]][[9]][[8]][[7]][[6]][[5]][[4]][[3]][[2]][[1]] $[[61]] [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ 0 ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] $[[$[[63]]]] [[ [[1?{Fear|d12|d20|d8} Fear]]+63 ]] [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ 0 ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] [[20]][[19]][[18]][[17]][[16]][[15]][[14]][[13]][[12]][[11]][[10]][[9]][[8]][[7]][[6]][[5]][[4]][[3]][[2]][[1]] [[20]][[19]][[18]][[17]][[16]][[15]][[14]][[13]][[12]][[11]][[10]][[9]][[8]][[7]][[6]][[5]][[4]][[3]][[2]][[1]] $[[126]] [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ 0 ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] ]]]]] }} [[[0 [[0]] {{With Fear!}} ]]] {{name= }} [[[0 [[0]] {{Critical!}} ]]] {{name= }} [[[0 [[0]] {{With Hope!}} ]]] {{name= }} {{Hope=$[[0]] }} {{Fear=$[[62]] }} {{Total=$[[85]] }} {{name=Agility Action Roll }}
Wow! Thank you! Definitely would never have figured that out, lol.
1767316518
Gauss
Forum Champion
Rich McNutt said: Wow! Thank you! Definitely would never have figured that out, lol. Nobody can, RainbowEncoder is using dark magicks or alien science. :D