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

Converting a Gamma World table to macro form

Hi there. There is a to-hit table from first edition Gamma World that I'm endeavoring to turn into an inline roller for my players and my use. Confession, I am horrible at programing, and everytime I take a stab at it I crash hard into my lack of programing skill. So if anyone can help me figure it out, I'd be grateful. Essentially this is what I'd like to do. Gamma World divides weapon to-hits into classes (16 of them), that tell you the number you need to roll over to hit a given AC from 10 to 1. So I know that at a minimum I need 16 macros that reflect each weapon class, that consists of 1d20 roll weighted to which AC they hit with a given d20 roll. In addition to this basic function (choose a weapon class, and roll a d20 for that class), I'd like to be able to add in a modifier before the roll is made to the d20 roll to reflect exceptional STR or DEX (either good or bad) so that the final modified roll gives the AC that is hit. Is there a simple way of doing this, that can be explained to someone with no real macro building ability for Roll20? Thank you for making it this far. 
1663771020
Gauss
Forum Champion
There may be a way to do this, but we would need more specific information, like all of the information for the mechanic in question, as specific as you can get it.  Example: (fill in the "quotes") Weapon "name" 1: 1d20 + modifier vs "weighted to the AC mechanic" I don't understand what you mean by "weighted to which AC they hit". Definitely need more information on that. 
You'll need a macro of the form {1d20+?{Mod|0}}>X where X is the value from the table lookup. Transcribing tables can be arduous so it might be best to use roll queries. Here is a template you can fill in the actual values with /r {1d20+?{Mod|0}}>[[?{Weapon Class| One (1) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Two (2) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Three (3) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Four (4) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Five (5) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Six (6) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Seven (7) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Eight (8) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Nine (9) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Ten (10) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Eleven (11) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Twelve (12) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Thirteen (13), ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Fourteen (14), ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Fifteen (15) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Sixteen (16) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } }]] Wherever there is a X followed by a number that needs to be replaced by the actual value required to hit that AC with that line's Weapon class. So X10 for class 1 might be replaced by 16 for example
Gauss said: There may be a way to do this, but we would need more specific information, like all of the information for the mechanic in question, as specific as you can get it.  Example: (fill in the "quotes") Weapon "name" 1: 1d20 + modifier vs "weighted to the AC mechanic" I don't understand what you mean by "weighted to which AC they hit". Definitely need more information on that.  Oh sorry. Here I'll give you an example, an excerpt from the table, Weapon Class 6 Roll AC 10 6 AC 9 7 AC 8 13 AC 7 13 AC 6 15 I meant weighted that there are some results that will have ranges associated to them. In this case for WC6, rolling a 13 hits AC:7  and higher. It's not shown on this chart but rolling a 15 will hit AC:5  and higher. That's what I meant by weighted, a given roll can hit a range of ACs. But looking over RainbowEncoder's solution that pretty much solves everything I think I needed. Thank you @Gauss and @RainbowEncoder for helping me with this!
1663817728
Gauss
Forum Champion
Guess RainbowEncoder beat me to it, but they are much better at Macros (like light years better) anyhow. :) Does RainbowEncoder's macro do what you need or do you need it to do more?
Gauss said: Guess RainbowEncoder beat me to it, but they are much better at Macros (like light years better) anyhow. :) Does RainbowEncoder's macro do what you need or do you need it to do more? Well I entered all the values that were needed and I gave it a spin last night. AFAIK it's working perfectly. It will query for a modifier, weapon class and AC and then tell you if there is a hit or not. It's a good enough template that I think I understand how I can dummy up something similar for Mental Attacks and Radiation Exposures as well. Once I get that done, I can then work on the Artifact Examination macro as well. Thank you both for the kind help. It helps to explain a lot about macros and their formatting.
1663930938
David M.
Pro
API Scripter
Never played Gamma World but saw you mentioned radiation exposure and it reminded me of a script I saw a while ago called Geiger Counter . No idea if it is relevant, but figured I'd share it in case it looks interesting to you.
David M. said: Never played Gamma World but saw you mentioned radiation exposure and it reminded me of a script I saw a while ago called Geiger Counter . No idea if it is relevant, but figured I'd share it in case it looks interesting to you. While not immediately useful, you better believe I'm filing that one away! Thank you very much for the heads-up and really useful script!
1664928725

Edited 1664928855
Well it would appear I'm not as clever as I thought I might be. I'm trying to make a second macro, this time for physical attacks. (The game splits combat tables between weapon combat and combat by a combatant's hit dice) I though it was just a matter of swapping out values but I'm running into errors. So Ideally it should behave like the first macro, ask for a modifier, query for Hit Dice (rather than Weapon Class) and then compare a success against an entered AC value. Is there a simple way of showing how you hack the first macro to get this new one? Oh yes in this case instead of 16 weapon classes there are 7 Hit Dice categories. RainbowEncoder said: You'll need a macro of the form {1d20+?{Mod|0}}>X where X is the value from the table lookup. Transcribing tables can be arduous so it might be best to use roll queries. Here is a template you can fill in the actual values with /r {1d20+?{Mod|0}}>[[?{Weapon Class| One (1) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Two (2) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Three (3) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Four (4) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Five (5) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Six (6) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Seven (7) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Eight (8) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Nine (9) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Ten (10) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Eleven (11) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Twelve (12) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Thirteen (13), ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Fourteen (14), ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Fifteen (15) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } | Sixteen (16) , ?{AC| 10 , X10 | 9 , X9 | 8 , X8 | 7 , X7 | 6 , X6 | 5, X5 | 4 , X4 | 3 , X3 | 2 , X2 | 1 , X1 } }]] Wherever there is a X followed by a number that needs to be replaced by the actual value required to hit that AC with that line's Weapon class. So X10 for class 1 might be replaced by 16 for example
Tom M. said: Well it would appear I'm not as clever as I thought I might be. I'm trying to make a second macro, this time for physical attacks. (The game splits combat tables between weapon combat and combat by a combatant's hit dice) I though it was just a matter of swapping out values but I'm running into errors. So Ideally it should behave like the first macro, ask for a modifier, query for Hit Dice (rather than Weapon Class) and then compare a success against an entered AC value. Is there a simple way of showing how you hack the first macro to get this new one? Oh yes in this case instead of 16 weapon classes there are 7 Hit Dice categories. Does it still use a d20 + Modifier compared against a target number that you lookup against the Hit Dice category and AC? Or do the Hit Dice provide separate dice that you add the modifier to and then compare against a target number determined solely by AC? And if so is it the sum of the hit dice or each individual die that gets the modifier and compared?
1665090119

Edited 1665090198
This is the table and how it's supposed to work. If you have 1 HD, you have the following THACs. If you have 2-3 HD, you have these THACs and so on. So again it would be modifier to roll + d20 roll per given HD class, so I believe that's your first case.
After that I have to work out these tables next...
1665102627
GiGs
Pro
Sheet Author
API Scripter
I can see three ways you could attempt this: Sheet worker: are you willing to modify the character sheet code, or are you using a sheet designed by someone else? An API/Mod script: something like ScriptCards could handle this A traditional Macro: this doesnt support this kind of thing naturally, but there's a sequence there so can likely be made to work (over to RainbowEncoder for that). The tables in your second post look easy to do with a macro (complication: the non-numeric results).
For your Physical Attack Matrix II. I don't see anything that would prevent swapping out values but nesting queries can be awkward syntax-wise and is easily broken. However since the table values are almost perfectly linear it can be made much simpler. /r {1d20 +?{Mod|0} }>[[20 -?{Hit Dice |1,0[HD1]|2-3,1[HD2-3]|4-5,2[HD4-5]|6-8,3[HD6-8]|9-10,4[HD9-10]|11-14,5[HD11-14]|15+,6[HD15+]} -?{AC |10,10[AC10]|9,9[AC9]|8,8[AC8]|7,7[AC7]|6,6[AC6]|5,4[AC5]|4,3[AC4]|3,2[AC3]|2,1[AC2]|1,0[AC1]} ]] Physical Attack Matrix II The remaining tables however are perfectly linear so with some Keep/Drop mechanics to bound the values and maybe some template overriding for the non-numeric results they are simple enough.
Thank you both for your replies. Looks like I have some more reading to do.