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

D100 macro help

Hello! First of all very sorry my bad English. My question is: Our games have to roll 1d100, but need two d10 roll, becouse always the bigger in the first number. Example roll 4 and 6, the result 64, or 0 and 9, the result 90. 00 is always succes, and 11 always fail. And top of all one dice dark, and one dice light. We use this macro now: &{template:default} {{name=d100 roll}} {{Dark=[[d10%10]]}} {{Light=[[d10%10]]}} after we caluculate result, etc... Possible to  autamtion this. Exaple we roll, and the result somthing like this: Dark dice: 8 Light dice: 10 Result: 80 or Dark dice: 10 Light dice: 1 Result: 10 Thanks for help! Gabor 
1566122067

Edited 1566122200
Ziechael
Forum Champion
Sheet Author
API Scripter
It will harder to do with a clean inline output but /r 2d10sd will give you 2d10, sorting them from highest to lowest and will give you the individual dice and a grouped 'result' but won't give you the total as you want, it will still be 6+4=10 not 64. Something like that would likely require an API script (which in turn requires the games creator to have a Pro subscription. edit: hmm actually it will still fail visually when a 10 is rolled since the roller sees it as a 10 and not a 0... sorry
1566123686
Finderski
Pro
Sheet Author
Compendium Curator
What character sheet are you using?  There might be a roll template for it, because you could possible get close to with a roll template specific for the game system you're using...
Not using sheet, becouse this is a hungarian test system. 
1566145338
Finderski
Pro
Sheet Author
Compendium Curator
It's an interesting scenario...a couple questions Is the lowest roll always 11 (or is 10, the lowest...the example above seems contradictory)? Is the highest roll always 99? Are there there other modifiers that apply to the roll? If not, I'm thinking a d10-1 may be easier (on roll20) to get 10-99) Just thinking through the process...to see if a sheet worker actually would work...
1. Lowest roll is 10,  2. Highest roll is 00. 3. Yes.
1566153696

Edited 1566154499
GiGs
Pro
Sheet Author
API Scripter
I think the only way to do this (without a Pro subscription) would be with a rollable table , where you just list every possible roll from the d100 with appropriate weights. You can treat a rollable table as a dice roll, so as long your modifiers apply to the final output, and not to each die individually, it would work. You could add dice images to the table as well as the numbers, if you want the output to be prettier, but you'd have to make 55 of them (one for each row).
1566154171
GiGs
Pro
Sheet Author
API Scripter
For the record, the table would be Number Weight 10 2 11 1 20 2 21 2 22 1 30 2 31 2 32 2 33 1 40 2 41 2 42 2 43 2 44 1 50 2 51 2 52 2 53 2 54 2 55 1 60 2 61 2 62 2 63 2 64 2 65 2 66 1 70 2 71 2 72 2 73 2 74 2 75 2 76 2 77 1 80 2 81 2 82 2 83 2 84 2 85 2 86 2 87 2 88 1 90 2 91 2 92 2 93 2 94 2 95 2 96 2 97 2 98 2 99 1 00 1
Shouldn't all the weights be 2 except for 10 and 00 being 1? If I understand the explanation, there are two ways to get 11: The Light Die = 10 and the Dark Die = 1, and the Light Die = 1 and the Dark Die = 10. The same would be true for 22, 33, 44, etc.
1566190186

Edited 1566190308
GiGs
Pro
Sheet Author
API Scripter
There's only one way to get each double. For each number on the chart that isnt a double: e.g. 73 there's two ways to get it, because you can roll 7 and 3, or 3 and 7. But there's only one way to roll 8 and 8. To get 11, you have to roll 1 and 1. If the light die is 10 and the dark die is 1, or vice-versa, that's 10. Because a 10 on the die is treated as 0. 
1566191021

Edited 1566191218
GiGs
Pro
Sheet Author
API Scripter
Here's a table showing every possible result. First die across the top, second die down the side, and results in the grid.  Gabor's first post shows 10's are being treated as zeroes (and many dice are labelled that way), which is why the table goes 1...0. I shaded the doubles to make it easier to read. Notice the doubles occur only once, and each result on once side of the doubles line is mirrored on the other side.  Edit:  the table would be more symmetrical if I'd labelled the axes 0, 1, 2, etc., so I've done that here.
Ah, yes. My brain is addled. :-)
1566191263
GiGs
Pro
Sheet Author
API Scripter
It's late (or early), you have a good excuse :)
Thanks for the helps. Rollable table good idea, but not solve dark and light dice problem. So this roll is the attack roll in this system. Characters have attack values. The attack is this roll + attack value. dark dice always the demage dice, and leght is a hit position. For example: Bubu the warrior attack. His attack value with short sword is 55, demage d5. Roll. Dark dice: 6 Light dice: 7 Total attack: 55 + 76 = 131 Demage (dark dice): 3 Hit position: Torso (7). But I see need a pro subscription for this, so until my players do the math. :) Thanks fot the helps. Gabor
1566231339
GiGs
Pro
Sheet Author
API Scripter
If you used a rollable table and created 100 dice images, each of two dice one white, one black, you could see at a glance which is white and dark, but thats a lot of work. You're right that the best way to do this would be through a Pro API script. 
1566437459
Finderski
Pro
Sheet Author
Compendium Curator
Gabor N. said: Hello! First of all very sorry my bad English. My question is: Our games have to roll 1d100, but need two d10 roll, becouse always the bigger in the first number. Example roll 4 and 6, the result 64, or 0 and 9, the result 90. 00 is always succes, and 11 always fail. And top of all one dice dark, and one dice light. We use this macro now: &{template:default} {{name=d100 roll}} {{Dark=[[d10%10]]}} {{Light=[[d10%10]]}} after we caluculate result, etc... Possible to  autamtion this. Exaple we roll, and the result somthing like this: Dark dice: 8 Light dice: 10 Result: 80 or Dark dice: 10 Light dice: 1 Result: 10 Thanks for help! Gabor  ...and... Gabor N. said: Thanks for the helps. Rollable table good idea, but not solve dark and light dice problem. So this roll is the attack roll in this system. Characters have attack values. The attack is this roll + attack value. dark dice always the demage dice, and leght is a hit position. For example: Bubu the warrior attack. His attack value with short sword is 55, demage d5. Roll. Dark dice: 6 Light dice: 7 Total attack: 55 + 76 = 131 Demage (dark dice): 3 Hit position: Torso (7). But I see need a pro subscription for this, so until my players do the math. :) Thanks fot the helps. Gabor So, with a very simple custom sheet (nothing more than a roll button with a custom roll template), you can have this: As I mentioned, you can't do any math within the roll template, so the formula would need to be resolved manually (unless the modifier were 0).   The Hit Location can be shown (I realize most of those are probably, because I had no idea what the chart looks like) Damage I left off, because from your example, it looks like it's divided by 2 or some other calculation. If that's not the case, and it is, in fact, set numbers based on the Dark Die value (e.g. 1-2 = 1, 3-4 = 2, 5-6 = 3, etc), then you could display the Damage as well...in which case, I'd probably recommend leaving the Result formula off the display and just showing Hit Location and Damage. If this meets your needs, I can share the code with you; you'd need to go Pro for a month so you could upload the sheet to your game, but you could then let it lapse and the sheet would remain...just couldn't be modified.
Very nice solution. First of all Thanks! As I mentioned, this system is a test phase now, but if the authors finish I take Your help. 
1566462848
Finderski
Pro
Sheet Author
Compendium Curator
Gabor N. said: Very nice solution. First of all Thanks! As I mentioned, this system is a test phase now, but if the authors finish I take Your help.  It was an interesting experiment to see how close I could get to something without the API...given that it may be a while before this is potentially needed, I'll post the code here, because down the road, I'll likely not remember where I put stuff...this keeps it all together. :) HTML: <button type="roll" name="roll_weirdpercentile" value="&{template:roll} {{name=@{character_name}}} {{light=[[1d10-1]]}} {{dark=[[1d10-1]]}} {{modifier=[[?{Modifier|0}]]}}">Roll</button> <rolltemplate class="sheet-rolltemplate-roll">     <div class="sheet-roll">         <h1>{{name}}</h1>         <div class="sheet-rollresult">             {{#rollGreater() dark light}}                 <span class="sheet-d10">                     {{#rollTotal() dark 1}}A{{/rollTotal() dark 1}}                     {{#rollTotal() dark 2}}B{{/rollTotal() dark 2}}                     {{#rollTotal() dark 3}}C{{/rollTotal() dark 3}}                     {{#rollTotal() dark 4}}D{{/rollTotal() dark 4}}                     {{#rollTotal() dark 5}}E{{/rollTotal() dark 5}}                     {{#rollTotal() dark 6}}F{{/rollTotal() dark 6}}                     {{#rollTotal() dark 7}}G{{/rollTotal() dark 7}}                     {{#rollTotal() dark 8}}H{{/rollTotal() dark 8}}                     {{#rollTotal() dark 9}}I{{/rollTotal() dark 9}}                     {{#rollTotal() dark 0}}J{{/rollTotal() dark 0}}                 </span>                 <span class="sheet-d10">                     {{#rollTotal() light 1}}a{{/rollTotal() light 1}}                     {{#rollTotal() light 2}}b{{/rollTotal() light 2}}                     {{#rollTotal() light 3}}c{{/rollTotal() light 3}}                     {{#rollTotal() light 4}}d{{/rollTotal() light 4}}                     {{#rollTotal() light 5}}e{{/rollTotal() light 5}}                     {{#rollTotal() light 6}}f{{/rollTotal() light 6}}                     {{#rollTotal() light 7}}g{{/rollTotal() light 7}}                     {{#rollTotal() light 8}}h{{/rollTotal() light 8}}                     {{#rollTotal() light 9}}i{{/rollTotal() light 9}}                     {{#rollTotal() light 0}}j{{/rollTotal() light 0}}                 </span>             {{/rollGreater() dark light}}             {{#rollGreater() light dark}}                 <span class="sheet-d10">                     {{#rollTotal() light 1}}a{{/rollTotal() light 1}}                     {{#rollTotal() light 2}}b{{/rollTotal() light 2}}                     {{#rollTotal() light 3}}c{{/rollTotal() light 3}}                     {{#rollTotal() light 4}}d{{/rollTotal() light 4}}                     {{#rollTotal() light 5}}e{{/rollTotal() light 5}}                     {{#rollTotal() light 6}}f{{/rollTotal() light 6}}                     {{#rollTotal() light 7}}g{{/rollTotal() light 7}}                     {{#rollTotal() light 8}}h{{/rollTotal() light 8}}                     {{#rollTotal() light 9}}i{{/rollTotal() light 9}}                     {{#rollTotal() light 0}}j{{/rollTotal() light 0}}                 </span>                 <span class="sheet-d10">                     {{#rollTotal() dark 1}}A{{/rollTotal() dark 1}}                     {{#rollTotal() dark 2}}B{{/rollTotal() dark 2}}                     {{#rollTotal() dark 3}}C{{/rollTotal() dark 3}}                     {{#rollTotal() dark 4}}D{{/rollTotal() dark 4}}                     {{#rollTotal() dark 5}}E{{/rollTotal() dark 5}}                     {{#rollTotal() dark 6}}F{{/rollTotal() dark 6}}                     {{#rollTotal() dark 7}}G{{/rollTotal() dark 7}}                     {{#rollTotal() dark 8}}H{{/rollTotal() dark 8}}                     {{#rollTotal() dark 9}}I{{/rollTotal() dark 9}}                     {{#rollTotal() dark 0}}J{{/rollTotal() dark 0}}                 </span>             {{/rollGreater() light dark}}             {{#rollTotal() dark light}}                 <span class="sheet-d10">                     {{#rollTotal() dark 1}}A{{/rollTotal() dark 1}}                     {{#rollTotal() dark 2}}B{{/rollTotal() dark 2}}                     {{#rollTotal() dark 3}}C{{/rollTotal() dark 3}}                     {{#rollTotal() dark 4}}D{{/rollTotal() dark 4}}                     {{#rollTotal() dark 5}}E{{/rollTotal() dark 5}}                     {{#rollTotal() dark 6}}F{{/rollTotal() dark 6}}                     {{#rollTotal() dark 7}}G{{/rollTotal() dark 7}}                     {{#rollTotal() dark 8}}H{{/rollTotal() dark 8}}                     {{#rollTotal() dark 9}}I{{/rollTotal() dark 9}}                     {{#rollTotal() dark 0}}J{{/rollTotal() dark 0}}                 </span>                 <span class="sheet-d10">                     {{#rollTotal() light 1}}a{{/rollTotal() light 1}}                     {{#rollTotal() light 2}}b{{/rollTotal() light 2}}                     {{#rollTotal() light 3}}c{{/rollTotal() light 3}}                     {{#rollTotal() light 4}}d{{/rollTotal() light 4}}                     {{#rollTotal() light 5}}e{{/rollTotal() light 5}}                     {{#rollTotal() light 6}}f{{/rollTotal() light 6}}                     {{#rollTotal() light 7}}g{{/rollTotal() light 7}}                     {{#rollTotal() light 8}}h{{/rollTotal() light 8}}                     {{#rollTotal() light 9}}i{{/rollTotal() light 9}}                     {{#rollTotal() light 0}}j{{/rollTotal() light 0}}                 </span>             {{/rollTotal() dark light}}         </div>         <div class="sheet-templateRoll sheet-trollLeft"> <span class="sheet-rollLabel"><strong>Result Formula</strong></span> <span class="sheet-rollContainer">    {{#rollGreater() dark light}}        {{dark}}{{light}}{{#rollGreater() modifier 0}}+{{modifier}}{{/rollGreater() modifier 0}}{{#rollLess() modifier 0}}{{modifier}}{{/rollLess() modifier 0}} = ??    {{/rollGreater() dark light}}    {{#rollGreater() light dark}}        {{light}}{{dark}}{{#rollGreater() modifier 0}}+{{modifier}}{{/rollGreater() modifier 0}}{{#rollLess() modifier 0}}{{modifier}}{{/rollLess() modifier 0}} = ??    {{/rollGreater() light dark}}     {{#rollTotal() dark light}}        {{dark}}{{light}}{{#rollGreater() modifier 0}}+{{modifier}}{{/rollGreater() modifier 0}}{{#rollLess() modifier 0}}{{modifier}}{{/rollLess() modifier 0}} = {{dark}}{{light}}     {{/rollTotal() dark light}} </span> </div> <div class="sheet-templateRoll sheet-trollRight"> <span class="sheet-rollLabel"><strong>Hit Location: {{light}}</strong></span> <span class="sheet-rollContainer">    {{#rollTotal() light 1}}Head{{/rollTotal() light 1}}                 {{#rollTotal() light 2}}Left Arm{{/rollTotal() light 2}}                 {{#rollTotal() light 3}}Torso{{/rollTotal() light 3}}                 {{#rollTotal() light 4}}Right Arm{{/rollTotal() light 4}}                 {{#rollTotal() light 5}}Groin{{/rollTotal() light 5}}                 {{#rollTotal() light 6}}Left Leg{{/rollTotal() light 6}}                 {{#rollTotal() light 7}}Right Leg{{/rollTotal() light 7}}                 {{#rollTotal() light 8}}Foot{{/rollTotal() light 8}}                 {{#rollTotal() light 9}}Hand{{/rollTotal() light 9}}                 {{#rollTotal() light 0}}Eye{{/rollTotal() light 0}} </span> </div>     </div> </rolltemplate> CSS: .sheet-rolltemplate-roll div {     box-sizing: border-box; } .sheet-rolltemplate-roll .sheet-roll {     display:-webkit-box; display:-ms-flexbox; display:flex; -ms-flex-pack: distribute;    justify-content: space-around; -ms-flex-wrap: wrap;    flex-wrap: wrap; width: 100%; padding: 0px; border: 1px solid black; background-color: white; } .sheet-rolltemplate-roll h1 { font-size: 1.25em; text-align: center; background-color: black;     color: white;     width: 100%;     margin-bottom: 10px; } .sheet-rolltemplate-roll .sheet-rollresult {     display: block;     width: 100%;     border-bottom: 1px solid black;     text-align: center; } .sheet-rolltemplate-roll .sheet-rollLabel {     display: block; } .sheet-rolltemplate-roll .sheet-templateRoll, .sheet-rolltemplate-damage .sheet-templateRoll { width: 50%; background-color: white; -webkit-box-flex: 1;    -ms-flex: 1 0 50%;        flex: 1 0 50%; } .sheet-rolltemplate-roll .sheet-d10 {     font-family: dicefontd10;     font-size: 4em; } .sheet-rolltemplate-roll .sheet-trollLeft { border-right: .5px solid black; text-align: center; } .sheet-rolltemplate-roll .sheet-trollRight { border-left: .5px solid black; text-align: center; } .sheet-rolltemplate-roll .inlinerollresult {     background-color: transparent;     border: none;     padding: 0px;     font-weight: normal;     font-size: 1em; } .sheet-rolltemplate-roll .inlinerollresult.fullcrit {     border: none; } .sheet-rolltemplate-roll .inlinerollresult.fullfail {     border: none; } .sheet-rolltempalte-roll .inlinerollresult.importantroll {     border: none; }