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

Macro with inline rolls, duplication and toggleable templates help

If anyone has the time, I am trying to adapt the things that I have learned with re-using rolls, duplicating rolls and toggleable template fields.  I am really close here, but I cannot quite get it right.  It seems my number of inline rolls is variable based on the value that is rolled.  I am still trying to understand this, but I think I have reached my limit trying to get this one working Here is the premise:  Roll 2d10 + stuff Toggle the template fields relative to the total amount rolled.  Tier 1 = 2-10, Tier2 = 11-16, Tier3 = 17-18, Tier4 (Crit) = 19,20 This will get me Tier1 - Tier3.  Does anyone know a way to get Tier 4 in there? {11,$[[55]]}>17f<10) Here is the full macro:  I have the Roll: Template working correctly.  I just cannot get the toggleable templates to come out with the same inline roll number so I am not quite able to target them with my tier calculation. &{template:default} $[[$[[56]]]] {{name=[[[ ({11,$[[55]]}>17f<10)*2 + 66 ]]] [[[ $[[11]][First] + $[[54]][Second] + ?{Edges?|0}[Edges] - ?{Banes?|0}[Banes] + ?{Modifier?|0}[Mod] ]]] [[[[[ $[[$[[0]]]] [[1d10 First]] [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ 0 ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] [[10]][[9]][[8]][[7]][[6]][[5]][[4]][[3]][[2]][[1]] [[10]][[9]][[8]][[7]][[6]][[5]][[4]][[3]][[2]][[1]] $[[31]] [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ 0 ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] $[[$[[33]]]] [[ [[1d10 Second]] + 33]] [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ 0 ]] ]] ]] ]] ]] ]] ]] ]] ]] ]] [[10]][[9]][[8]][[7]][[6]][[5]][[4]][[3]][[2]][[1]] [[10]][[9]][[8]][[7]][[6]][[5]][[4]][[3]][[2]][[1]] $[[65]] [[ [[ [[ [[ [[ [[ [[ [[ [[ [[ 0 ]] ]] ]] ]] ]] ]] ]] ]] ]] ]]  ]]]]] }} {{name=Power Roll}} {{Roll:=**2d10:**   $[[0.computed]]+$[[32.computed]] {{Total== $[[55.computed]]}} [[[0 [[0]] {{Total== $[[55.computed]]}} {{Result=Do Tier 1 Shenanigans}} ]]] [[[0 [[0]] {{Total== $[[55.computed]]}} {{Result=Do Tier 2 Shenanigans}} ]]] [[[0 [[0]] {{Total== $[[55.computed]]}} {{Result=Do Tier 3 Shenanigans}} ]]] I know this might be a tough one, but any help is appreciated.
1717202097
Gauss
Forum Champion
Could you explain what you are trying to do without using Roll20 lingo?  What happens when a 2-10 is rolled?  When 11-16 is rolled?  When 17-18 is rolled? When 19-20 is rolled?
It is just tiered results.  Higher is better.  19-20 is a crit.  What I am trying to do is toggle the fields relative to the 2d10 + stuff roll
1717207603

Edited 1717208492
Gauss
Forum Champion
What I am trying to ask here is what happens.  A 2-10 is rolled, what happens next? What is added, subtracted, multiplied, divided, rolled, etc?  A 11-16 is rolled, what happens next?  etc.
It would then have a tiered results for whatever it was you wanted to accomplish. If it was a simple attack - tiered amounts of damage Trying to scale of wall - tiered amounts of success or failure relative to a target number
1717208540
Gauss
Forum Champion
I am sorry, I am still not getting the question across. What is "Tier 1 Shenanigans"? "Tier 2 Shenanigans"? etc. The reason I am asking is there may be other ways to do what you want.
It should be what is displayed.  If a Tier 1 roll happened (2-10) then Tier 1 Shenanigans should be displayed...and so forth up the tiers.  This strategy was displayed here:  Toggleable Template I have seemed to gotten myself in a pickle with this one, though I know that I am close to getting the macro to work.  I am just getting my inline rolls mixed up
1717211126

Edited 1717211657
Gauss
Forum Champion
Ok, to clarify:  A roll happens, and the output (depending on the range of the roll) is the text "Do Tier X Shenanigans"? Edit: If that is the case, Toggleable Template may be massive overkill. This can probably be done rather easily with a Success/Failure check.
It is not necessarily can a Success/Failure be done.  That I can do.  I am trying to stretch my understanding I want only Tier 1 results to show when Tier 1 is rolled, only Tier 2 results when Tier 2 is rolled and so on.  I have actually done this before adapting a macro that Rainbow Encoder put together, but now that I have tried to adapt it to this I have been unable to make it happen
Macro  in question I posted a week ago
1717220656
Gauss
Forum Champion
Alright, very few folks understand what Rainbow Encoder has done, so you will probably have to wait for them to help. :)
So if I'm reading this correctly: You're rolling two d10 adding some modifiers and wanting to compare the total against the 4 tier ranges, and currently against 3 ranges. The output being the total and which tier of result was achieved. You're using roll duplication but don't appear to be using the duplicates; so that can be removed since it's only detracting from the macro. The only difference in the output appears to be the tier number; so unless you're intending to make some other changes Toggleable Template is massive overkill. Part of stretching understanding is also understanding when to use or not use a technique. To actually map the roll onto the 4 tiers would be to use something a kin to {2,11,17,19}<NUMBER Is there anything I'm missing?
1717349970
Gauss
Forum Champion
That was the same thing I was thinking RainbowEncoder. But, they stated they wanted to use your method so who was I to argue? :)
I agree, I think the duplicate rolls are no longer needed now that I am looking at it again. I am confused on how you would get conditional displays relative to the tier of roll if you didn’t use toggleable fields though. If tier 1 is rolled, you want the tier 1 display; if tier2 then the tier 2 display.
Since the only difference shown thus far is the number of the tier: a roll can be used to display that number. Such as {{Result=Do Tier [[{2,11,17,19}<NUMBER]] Shenanigans}}
I apologize for not getting across what I was going for.  Here is essentially what I am going for in a picture: The person rolled 2d10, they got an 11.  I want only the tier2 Message to be displayed (6 damage, knockback 1)
1717362999

Edited 1717363842
Gauss
Forum Champion
Are the damage or knockback numbers variables? Or are they static based on the Tier the dice rolled? Are they static but can change (such as character to character)? This is why I asked for all the relevant information. There are often other ways of doing things than going to RainbowEncoder's methods. :) Also, which character sheet is being used? 
The resulting numbers/conditions in each tier would be relative to the character that rolled, the class they played, the level they were, etc. but overall what I was going for was: 1) roll the dice 2) display the result of the roll 3) display the tier that result landed when there were 4 possible tiers within the single macro, which felt like toggleable fields to me
1717364544

Edited 1717365004
Gauss
Forum Champion
Alright, lets see if I understand correctly.  1) 2d10 are rolled 2) The result of that roll determines which tier of output.  3) The output is not rolled, however they do change based on character options.  4) You need the 2d10 to display as a value Question: does the 2d10 get modified in any way? Such as a modifier being added to it after all the above happens?  Also, I tossed it in late so it might have gotten missed: which character sheet is in use?  Edit: one other note, the reason I ask all these questions is to see if there is an easier route. Even if it turns out that there isn't, that the method above is needed, what I am doing is finding out all the particulars for someone like RainbowEncoder to come along and work their magic.  Posting code is often not going to be helpful if we don't know what the end result is trying to be, and what is necessary. Hence asking 20 questions. 
Yep, posting the code was dumb of me. I just felt I was close and maybe someone could find that one spot I was missing This does not involve any Roll20 supported sheet but an upcoming system I would like to play test. It has something called a power roll attached to “actions”. Roll 2d10, add modifiers. The result of that sum puts your result of what you are trying to accomplish into one of four tiers. I want the corresponding chat display after pushing the button to display the tier result conditional on the what was rolled plus modifiers
Rolling 2d10 with modifiers could put the result below the Tier 1 or above the Tier 4 ranges. What happens in those cases?
The rules are still being written but it looks like your min result is 2 (max modifier seems to be five so maybe could assume -5 is min) even if you have negative modifiers and tier 4 is only achieved if the 2d10 is 19 or 20.  Now that I think about it, tier 4 seems to not be needed as it seems to be a tier 3 result with the added condition that you get an extra action. Which could just be a product of the tier 3 display that only changes if 19 or 20 is actually rolled
Sound like tier is dependant on both the sum total and the raw roll. Maybe some examples would help If you rolled 1, 1. Mod -5 for total -3 is that Tier 1 or something else? And would the result be shown as -3 or 2? If you rolled 10, 10 Mod +5 for total 25 is that Tier 4 or something else? If you rolled 10, 10 Mod -5 for total 15 is that Tier 3 or 4? If you rolled 9,9 Mod +1 for total 19 is that Tier 3 or 4? If you rolled 8,8 Mod +1 for total 17 is that Tier 2 or 3?
1) 1,1 -5 = -3 is Tier 1 shown as -3 2) 10,10 + 5 = 25 is Tier 4 only because 19/20 rolled on dice 3) 10,10 -5 = 15 is Tier 4 because 19/20 rolled on dice 4) 9,9 + 1 = 19 is Tier 3 because 18 rolled on dice 5) 8,8 + 1 = 17 is Tier 3 
Okay, this should get you most of the way there. &{template:default} {{name= $[[$[[4]]]] [[[ [[ 5 +2*{ [ ] {11 -(?{Edges?|0}) +(?{Banes?|0}) -(?{Modifier?|0}), 19}kl1, [ ] {17 -(?{Edges?}) +(?{Banes?}) -(?{Modifier?}), 19}kl1, [ ] {19} [ ]}<[[ 0+[ ][[ [[1d10 First]][First] + [[1d10 Second]][Second] +(?{Edges?|0})[Edges] -(?{Banes?|0})[Banes] +(?{Modifier?|0})[Mod] ]] [ ]-(?{Edges?}) +(?{Banes?}) -(?{Modifier?}) ]] [ ] ]] ]]] }} {{Roll= **2d10:** $[[0]]+$[[1]]}} {{Total=$[[2]]}} {{name= [[[0}} [[0]] {{Tier 1=$[[12]] Damage}} {{name=]]] [[[0}} [[0]] {{Tier 2=$[[13]] Damage, Knockback $[[14]]}} {{name=]]] [[[0}} [[0]] {{Tier 3=$[[15]] Damage, Knockback $[[16]]}} {{name=]]] [[[0}} [[0]] {{Tier 4=$[[17]] Damage, Knockback $[[18]], Take another action}} {{name=]]] [[6 Tier 1 Damage]] [[6 Tier 2 Damage]] [[1 Tier 2 Knockback]] [[8 Tier 3 Damage]] [[3 Tier 3 Knockback]] [[8 Tier 4 Damage]] [[3 Tier 4 Knockback]] }} {{name=Power Roll}}
Thanks so much for the start. I will break down the inline rolls so I can try to figure out how it works. Fun to try to learn this stuff