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

Not Sure if this is possible with a Macro

Hi, I have a table for Battletech that I was trying to recreate with a macro. Any ideas as to how to go about it? I currently have Rollable tables for a few of the Weapon Sizes (e.g, 2, 4, 6, 10, 15, 20) as they are the major ones required and then have a macro that refers to those tables. Can anyone think of a better way of doing it? Appreciate any thoughts and thanks in advance. AE
1731213073
Andrew R.
Pro
Sheet Author
Upgrade to a Pro subscription and use Mods like MetaScriptToolbox and / or ScriptCards. I'd use ScriptCards because I could write a script to create & store the table, run that in my Library game, and use Transmogrifier to copy the stored table into live games. 
Thanks for the response. Unfortunately Pro isn't an option right now. Nice to know it is an option in the future.
It's possible with a macro and you don't need Pro for it - you can compare the roll to a number of numbers, and output a result that is equal to the number of compared numbers that are lesser or equal to the roll. I can write out the full macro tomorrow. 
[[{?{weapon size|2,2,8|3,2,5,10|4,2,3,7,11|5,2,3,5,9,11|6,2,2,4,6,9,11|7,2,2,4,5,9,119,11|8,2,2,2,4,6,9,11,11|9,2,2,2,4,5,9,9,11,11|10,2,2,2,4,5,5,9,9,11,11|11,2,2,2,2,4,5,5,9,9,11,11|12,2,2,2,2,4,5,5,5,9,9,11,11|13,2,2,2,2,4,5,5,5,9,9,9,11,11|14,2,2,2,2,2,4,5,5,5,9,9,11,11,11|15,2,2,2,2,2,4,5,5,5,9,9,9,11,11,11|16,2,2,2,2,2,4,4,5,5,5&comm2a;9,9,9,11,11,11|17,2,2,2,2,2,4,4,5,5,5,9,9,9,9,11,11,11|18,2,2,2,2,2,2,4,4,5,5,5,9,9,9,11,11,11,11|19,2,2,2,2,2,2,4,4,5,5,5,9,9,9,9,11,11,11,11|20,2,2,2,2,2,2,4,4,4,5,5,5,9,9,9,9,11,11,11,11|21,2,2,2,2,2,2,2,4,4,5,5,5,5,9,9,9,9,11,11,11,11|22,2,2,2,2,2,2,2,4,4,5,5,5,5,5,9,9,9,9,11,11,11,11|23,2,2,2,2,2,2,2,4,4,4,5,5,5,5,5,9,9,9,9,11,11,11,11|24,2,2,2,2,2,2,2,2,4,4,5,5,5,5,5,5,9,9,9,9,11,11,11,11|25,2,2,2,2,2,2,2,2,4,4,5,5,5,5,5,5,9,9,9,9,9,11,11,11,11|26,2,2,2,2,2,2,2,2,2,4,4,5,5,5,5,5,5,9,9,9,9,11,11,11,11,11|27,2,2,2,2,2,2,2,2,2,4,4,5,5,5,5,5,5,9,9,9,9,9,11,11,11,11,11|28,2,2,2,2,2,2,2,2,2,4,4,5,5,5,5,5,5,9,9,9,9,9,9,11,11,11,11,11|29,2,2,2,2,2,2,2,2,2,2,4,4,5,5,5,5,5,5,9,9,9,9,9,11,11,11,11,11,11|30,2,2,2,2,2,2,2,2,2,2,4,4,5,5,5,5,5,5,9,9,9,9,9,9,11,11,11,11,11,11|40,2,2,2,2,2,2,2,2,2,2,2,2,4,4,4,4,4,4,5,5,5,5,5,5,9,9,9,9,9,9,9,9,11,11,11,11,11,11,11,11}}<[[2d6]] ]] (weapon size [[{?{weapon size}}<12]]) Right, this should do it. Fairly simple, but took a while to set up.
1731426282

Edited 1731426311
vÍnce
Pro
Sheet Author
1731627325

Edited 1731627887
Æ
Plus
Thank you TUO that would have indeed taken a bit to sort out so double thanks for the effort. So I have a better understanding of what is going on can you explain what the macro is actually doing? and can I trouble you with one more solution - If I needed to add a modifier to the dice roll how would you add that to the macro? Thanks again.
No trouble at all - you can use the greater than/lesser than roll modifiers to compare a roll to a series of numbers, and the roll returns 1 for every number it matches or is lesser/greater than (so if I have [[{1,2,2,4,5,6}<[[1d6]]]], that returns 1,3,3,4,5 or 6, as both 2 and 3 match or are greater than 2, so both clear 3 "gates"). So, I went and made a list of numbers for every weapon size on the chart, matching the "gates" of higher results, so that for example for weapon size 4, the result goes up by 1 at 2,3,7 and 11, so the roll is compared to those numbers. But because grouped rolls separate rolls/numbers with commas and queries don't like commas, I had to replace all of the commas between the numbers in the query with the corresponding html entity. As for modifiers - if it's to the dice roll, whatever modifiers you have, you can add them within the [[2d6]] roll at the end, it won't break anything. The macro simply compares all the numbers left of the < to the output of the inline roll to its right. If the modifier is to the final result, add it after that same inline roll.
Tuo you obtained legend status. That is a very useful bit of information. You have taught me a different way of thinking about tables of this nature. Time for me to rethink a few other things I have been using. Greatly appreciated.