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

Getting a macro to display text on a die roll without using a table

1764004444

Edited 1764011239
This is a weird game mechanic situation, the game uses a d10 die as a direction pointer.  So, I’m using 3D dice.  The rolling macro is working correctly (the die is appearing on the board).  There are 3 results from the roll (1-2 “Return to Base”, 3-7 “Break Off” and 8-10 “No Effect”). The “Break Off” result uses the die point to indicate the direction.   Or, could I pass the die roll into the table. So, the die would remain on the table and the rollable table would return the string. How would I get the text to display?  I tried pipes, but I suspect my formatting is wrong.  This isn’t rocket science as the players could figure out the results by themselves. But it would be convenient to have. 
1764009635

Edited 1764009845
Gauss
Forum Champion
Hi Tom B.,  Why is a table off the table?  Is it because you want the 3d dice?  If so you can still use 3d dice and tables to output the text.  To do that you need to create 10 tables.  1Direction 2Direction 3Direction 4Direction and so on.  1 and 2 should have a single object in the tables with a title of "Return to Base" 3 through 7 should have a single object in the tables with a title of "Break Off"  8 through 10 should have a single object in the tables with a title of "No Effect" Then the command is: [[1t[[[1d10]]Direction]]] It will still roll your 3d die, then output the text as a table. 
1764012597

Edited 1764013254
Thank you!  Works great! Very kluge solution, I would have never thought of it. 
1764016047

Edited 1764016113
Gauss
Forum Champion
It is a long standing option for converting rolls to text. There is another option iirc, but only one or two people understand it. It isn't as "kluge" but it is very esoteric. (RainbowEncoder comes up with stuff that most people do not understand.) At least this "kluge" method everyone understands and can replicate on their own.
1764016562

Edited 1764016751
I stand corrected :) Can the esoteric solution be used in the basic version or does it require the API?
1764017776

Edited 1764017848
Gauss
Forum Champion
Assuming I am not having a false memory and it does actually exist then it would not require the API, but it would require RainbowEncoder to come explain it. I will see if I can summon them. :D
So the non-rollable table option would be &{template:default} {{Roll $[[0.computed]]}} {{name= $[[$[[1]]]] [[[ [[ {3,8}<[[d10]]*2+2 ]] }} [[ [[0]] {{Return to Base}} ]] {{name= }} [[ [[0]] {{Break Off}} ]] {{name= }} [[ [[0]] {{No Effect}} ]] {{name= ]]]}} {{name=}} As for how it works that's magic string exploitation to alter the parser's internal state to change how it executes based on the dice roll to selectively show a template field
1764024836
Gauss
Forum Champion
The summoning was successful, only sacrificed a couple of players to bring RainbowEncoder from the realm they live in to ours.
Ha, ha…. Holy Cow, that is tricky code.  I’ll have to look up some of those functions.  The kluge is understandable.  As opposed to the foul sorcery in that code… :) Question, can I configure the macro to roll 4 dice leaving them on the table and call the tables?  Basically a unit goes into combat as a mass, the survivors then roll 1d10 each.  Using the results noted above.  I tried fiddled with it but no joy.  I then have the player sort out ties by screen placement of the dice (top to bottom, left to right).  I fell back to a roll 4d10 with instructions on sort and value resolution text.    Ideally something like this. Leader Result: X Result: X Result: X Result: X. 
1764033748

Edited 1764033893
Gauss
Forum Champion
Tom B. said: Ha, ha…. Holy Cow, that is tricky code.  I’ll have to look up some of those functions.  The kluge is understandable.  As opposed to the foul sorcery in that code… :) Told you, RainbowEncoder is a sorcerer from another realm! Regarding your question, you can stick it all in a template.  &{template:default} {{name=Example}} {{Roll1= [[1t[[[1d10]]Direction]]]}} {{Roll2= [[1t[[[1d10]]Direction]]]}} {{Roll3= [[1t[[[1d10]]Direction]]]}} {{Roll4= [[1t[[[1d10]]Direction]]]}} {{Instructions=yadda yadda}} If I misunderstood your question please elaborate. :)
1764041049

Edited 1764091247
OK using a variant of the code you provided, the last run shows that the die on the table is the last die of the 4.  (Value 9 being a No Effect)  Clearly the other 3 dice rolled and worked generating correct outputs.  However, those dice grapics have gone MIA after use, leaving only die 4.   Since the "Break Off!" result is dependent on the direction the die is pointing, the other dice need to remain on the table.  Is this possible?  Is it possible to roll 4d10 then plug the value of each die into the table name?  I’m not sure how to extract the value of the specific die to use for the table string? Example:  … [[4d10]] … {{Result 2 = [[1t[value die 2]Direction]]}} … BTW the use of the d10 as a pointer is a really clever idea.  When playing on table a leader gets one die of a color the rest another.  You roll for the survivors of a fight and sort out their results.  The leader matters the others are just generic.  The hardest part is stopping the players from picking up the dice after the roll as the die lay is important.  
1764094139
Gauss
Forum Champion
Give this version a try (all praise RainbowEncoder for the modification):  &{template:default} {{name=Example}} [[0]] [[0]] [[0]] {{Roll1=[[1t[[[1d10]]Direction]]]}} {{Roll2=[[1t[[[1d10]]Direction]]]}} {{Roll3=[[1t[[[1d10]]Direction]]]}} {{Roll4=[[1t[[[1d10]]Direction]]]}} {{Instructions=yadda yadda}}
1764096683

Edited 1764097668
Blessed be the Rainbow Encoder, for their Roll20 Macro code Fu is strong.  Works the Trick! What do the leading [[0]] do?  Are they disabling the die pickup code?
Tom B. said: Blessed be the Rainbow Encoder, for their Roll20 Macro code Fu is strong.  Works the Trick! What do the leading [[0]] do?  Are they disabling the die pickup code? They wrangle the dice to all happen at once, so they all roll together. Previously they are done separately so the 3D dice only sees the last one
Thank You!