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

Rolling a Macro or specific roll X number of times

Ok, so my GM is trying to create a quick way to handle damage rolls When you attack you roll and for every 10 above 0 that you roll, you get an extra damage roll (with some weapons). EG: You attack with a shotgun and roll 67 (which is Really good) This means you hit. So you roll damage once. And you hit really well, so you roll damage 6 more times. What I am trying to write is a macro that asks how many times you want to roll the damage macro (in this case 7) and then it rolls it X (again, 7 this time) times. I have tried: ?{Number of hits|1}#Damage-Macro ?{Number of hits|1}(#Damage-Macro) ?{Number of hits|1}*#Damage-Macro ?{Number of hits|1}*(#Damage-Macro) I put brackets all over the place to see if I could get it working but Its not doing it. Is there a way to do this? Why? Because we initially had a macro that rolled damage the maximum humber of times for a given weapon and we just ignored the excess ones, players claimed it felt very disconnected from how one usually gets to roll the damage yourself, and the excitement that came with that. As such myself and the DM are trying to split the attack and damage macro up and make em generic and request the damage dice (via popup) from the players so they feel more in control, however, the vast number of damage rolls means a player may have to input his individual damage roll many times (I believe 10 is the max) which could get quite tedious. My ideal result would be to roll the default template and add 1 {{Damage Roll=[[2d6]]}} and 1 {{Hit Location=[[Roll on a table]]}} for every hit the player wants to make. I have never tried my hand at the API but am a programmer and if thats the way forward then thats what I will try. but its not my campaign, so not sure I could even access the API stuff. Note: The DM is combining rules from Dark Heresy with another setting, and so he is having to come up with some odd rules, incase you were wondering about the oddity of this request. Once he sets the rules down properly I will probably create the character sheets for the ruleset.
1427644410
vÍnce
Pro
Sheet Author
Hi Smethane. Can you just put the query inside the damage-macro so that whenever you trigger #Damage-Macro you'll have the option. something like; [[(?{how many times?|1})d6]] Pardon if I misunderstood your problem. Cheers.
You can't unless you use the API.
In that case, any recomendations for API tutorials or anything? Not done any web dev before, and no idea what the language even looks like yet.
1427647561
Lithl
Pro
Sheet Author
API Scripter
The API is simply JavaScript, with access to Underscore.js and a few Roll20-specific functions.
I have been thinking about this for my roll templates, it may be possible (logically speaking) to create a roll template that checks then number of times you are allowed to roll and have that number compared to another display extra sections of your roll template for each one it matches. I think I have seen Diana's 3.5 template do something similar to this. The HTML section of the roll template would get rather complicated I imagine and you'd need some fairly inventive conditional work. I had intended to experiment on it but I have my own problem that I am trying to code before I wanted to ask about this issue myself. There is a neat little radio button script out there that autofills lesser radio buttons (CSS Wizardry forum post), that would be perfect. Or perhaps you could have an equation that counts how many times a number is divisible by five... or however many base attack you gain an extra attack for what game system you are using. And use that number to do a compcheck. That being said, from what I understand all of the attempts are actually 'rolled' so if you are using 3d dice you'll see the full number of rolls, however, they will not be displayed in the template or in chat.
1427670335
Diana P
Pro
Sheet Author
I only have an on the fly boolean trigger for whether you are doing a single attack vs multiple attacks; how many multiple attacks has to be changed by changing the macro. You could theoretically possibly set up your roll template for the character sheet to display rolls using #rollTotal() where you have conditions for 1 through 10 and {{rollnumber=[[?{#rolls|1}d1]]}} then something like {{#rollTotal() rollnumber 1}} {{only 1 roll stuff here}} {{/rollTotal() rollnumber 1}} {{#rollTotal() rollnumber 2}} {{stuff for roll 1 and roll 2 here}} {{/rollTotal() rollnumber 2}} etc but it would be pretty complicated html indeed! Don't know anyway to do a #rollTotal() >1 though so no nesting to save on the duplications (that I know about). and it would roll a large amount of dice every time (10 + 9 +8 +7 +6 +5+4+3+2+1+(#rolls) +any other rolls in the macro)
you wouldn't need to do a #rollTotal() > 1. Have a background success/fail dice roll and use that for any greater than or less than equations, although I dont know know why you'd need that when counting the number of attacks when you could divide the total base attack bonus by what ever number.. like for dungeons and dragons you gain an extra attack for each 5 bab. And it caps at 5 extra attacks, so no worrying about it going past 10. As for other wierd attacks like flurry of blows, or Multishot/Rapid Shot combos.. that's a whole 'nother beast entirely. But not impossible, there is a pathfinder macro page that talks about that stuff I think.
Ok, so I've had a moment (finally!) to read your responses. And wow you responded :) Guess I'll have to jump on the API tutorails and get started. Not done any HTML before, but I recently had to write a lexer/parser for some basic html (:s) so hopefully that will get me through it :) Unless anyone has some really good ideas for how to do this (or already has) then I think we can consider this one answered. Thanks again folks :)
Smethane, my power cards macro script already includes repeating rolls as part of the script. <a href="https://app.roll20.net/forum/post/1463736/script-powercards-2" rel="nofollow">https://app.roll20.net/forum/post/1463736/script-powercards-2</a>