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

GURPs Rapid Fire Damage

Hey Guys, I'm trying to create a macro that will take a variable integer and perform so many die rolls based on it for the purposes of having a quick macro for firearms damage. For example, one of my PCs has an auto-shotgun. At 50 ft range, it can hit up to 3 times for 4d+4. When over 50ft, it spreads to 27 potential pellets of 1d+1. Between stuff like this and recoil vs success margin to change a very dynamic range of hits, it would be really nice to have a macro for this. I'm hoping to capture something like ?{Shots Hit} and ?{Damage Roll} (or @{character|damage_roll}) and turn it into a sum of multiple rolls. eg: ?{Shots Hit} = 3 ?{Damage Roll} = 4d6+4 Would end up being... /roll {4d6+4, 4d6+4, 4d6+4} Is there a way to iterate over variable input in this manner with macros?
1590995955

Edited 1590996210
Oosh
Sheet Author
API Scripter
Getting the macro to "repeat this roll 3-27 times" isn't going to be achievable unless you're super keen on writing a nested macro about 200m long. What you can achieve though, if it's acceptable is: [[ ( ?{Shots Hit} * ?{DamageDice} )d?{DamageDieType} + ( ?{Shots Hit} * ?{DamageMod} ) ]] So essentially, if the Damage Roll =  4d6 + 5, you break that up into DamageDice=4, DamageDieType=6, DamageMod=5. If 3 shots hit, then the above code will then render that into (3 * 4)d6 + (3 * 5), or 12d6 + 15. The total is the same, but you're losing the 'per pellet' grouping. The only way I know of to get the roller to repeat (4d6 + 5) a certain number of times (rather than flat out multiply it) is to hard code it. If you're going up to 27 possible hits in a shot that is going to be one absolute beast of a macro. The advantage of the above code is it... works. And it's extremely simple. Could definitely use some prettying up though! Does this achieve what it needs to, or does the damage need to be kept separated into pellets? If this does achieve what you want, it's easy enough to put some polish on it, like limiting die type to actual die types, putting default values in and outputting to something other than a single inline roll. Of course GiGs will probably jump in with a much cleverer macro any second... one that does exactly what you want AND makes sandwiches....
1591019059

Edited 1591019206
GiGs
Pro
Sheet Author
API Scripter
Hehe, thanks Oosh, but I was going make exactly the same suggestion you did. Roll20 does have its limits. And besides when it comes to dice macros, Ziechael is the guru. We are all mere padawans to his force wizardry.
1591028167

Edited 1591028185
That does the trick @Oosh :D - of course it would be better to have separate rolls that are summed up per pellet/rapid fire round, but the manual did suggest the one die roll multiplied as an option for "faster combat". Thank you :)
1591030300
GiGs
Pro
Sheet Author
API Scripter
btw, Oosh's macro isnt doing a simple one roll multiplied by number of hits. Lets say you get 10 hits. With one rull multiplied, you'd roll 4d6 once, then multiply by 10. In Oosh's macro, you are multiplying the number rolled, so in this example, you'd be rolling 40d6. If you'd prefer to just use one roll and then multiply by the number of hits, the code is simpler, and also allows you to apply armour more easily. [[ ?{Shots Hit|1} * (?{DamageDice|1} )d?{DamageDieType|6} + ?{DamageMod|0} ) ]] You could even apply the armour in the roll: [[ ?{Shots Hit|1} * {?{DamageDice|1}d?{DamageDieType|6} + ?{DamageMod|0} -?{Armor|0},0d0}kh1 ]] This uses the kh (keep highest) group roll to set the minimum of a roll to 0. So if armour is higher than the damage rolled, you get 0 damage, not a negative total. This isnt really possible with the other approach.
> btw, Oosh's macro isnt doing a simple one roll multiplied by number of hits. Yeah I realized that after 1 roll and 6 dice flew across the screen :D - Both methods described here are very useful :D - I'm assuming that flinging more dice is more balanced than multiplying one.
1591033903
GiGs
Pro
Sheet Author
API Scripter
It's just a matter of which you prefer. If just using one roll multipled by #hits, it's going to produce extremes more often, which could be very good or very bad for the player. If one fails to penetrate armour, they all do. But if he rolls really high, its devastating. Rolling many dice instead pushes results to the average, so its more consistent - you have a better idea what to expect each time. That can be good or bad: if the average armour is more than a tough higher than the average damage roll, rolling once will give zero more often, but at least gives the chance of a big hit. The many rolls version will have some rolls that get through, but the total will be fairly low. Personally I'd go with the one roll system: its easier to handle armour and individual rolls matter more, and players can get excited about them.  But its purely a matter of personal preference. It's perfectly valid to prefer the consistency of the many dice method.
1591034275

Edited 1591034313
In the case where a targets DR is north of 15, 1 bullet will often never penetrate and the best they get its blunt force trauma...so I've just been summing up the damage of all the hits and using the difference as penetrating damage...so in my case, I feel like the PCs are getting a solid kick for multiple hits already