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

[Help] Not sure how to get this to work.

Long story short, I have no programming skills to speak of an am jury-rigging something. I have started with a macro to accomplish what I'm trying to do, but I think it might require the power of an API script to actually come out fully, and clean. The macro I currently have is this: Attack Macro /r (ceil((2d6+?{Modifiers|0}+?{Shots Bonus|0}-8)/2)) Here is an explanation of what it is doing. First, the system is a 2d6 based with totaled stat, skill, and miscellaneous modifiers added to each roll. In this particular instance, the player also adds a bonus based on shots fired divided by 2. I would have had more math in there to just have it calculate the bonus based on shots fired, but what I have now took me long enough. To score a hit, the total roll of 2d6 and all modifiers must be a 9. For every 2 above 9 another round will hit. By setting it to subtract 8, then divide by two and round up, the output is the total rounds that hit. If it is a positive number. Now, for what I am attempting to do. At the least: When it displays it shows all the math and looks sloppy. I would like to have a cleaner display with maybe just the die rolls, added modifiers, and total hits. This would also mean no negative numbers, just a 0 for misses and a max of shot bonus x2. Or, if it can calculate the bonus based on number of shots divided by 2 rounded down, then max hits could equal number of shots input. If possible: Have it then take the output number of hits, roll against a hit table for each, and roll damage (dice per hit to be queried) for each hit on said location. Without a custom character sheet made up to reference stats and damage dice, it seems to make things more difficult. We are currently testing different variations for our system and haven't built a sheet yet, and I am hoping this speeds the test up. Also, if there is somewhere you guys can point me so I can understand how to write API's a bit better, it would be appreciated. Finally, and most importantly, thank you all in advance for any help you can provide. -Aaron
1515228842
GiGs
Pro
Sheet Author
API Scripter
If possible: Have it then take the output number of hits, roll against a hit table for each, and roll damage (dice per hit to be queried) for each hit on said location. The only way to do this is to use an API script. For the rest of your question: this macro will eliminate minuses: /r {(ceil((2d6+?{Modifiers|0}+?{Shots Bonus|0}-8)/2)),0d0}k1 There's no good way to streamline the output. You can have it report just the number of bullets that hit with an inline roll, like so: [[{(ceil((2d6+?{Modifiers|0}+?{Shots Bonus|0}-8)/2)),0d0}k1]] shots hit. Hovering over the result will show the workings. It's not pretty though. You can also use a roll template to make it slightly prettier, something like &{template:default} {{name=My Attack}} {{Shots Hit=[[{(ceil((2d6+?{Modifiers|0}+?{Shots Bonus|0}-8)/2)),0d0}k1]] }} If you created a HitLocation macro and a DamageRoll macro, you you could include a button for each of those in the attack output, and players could click them as needed to generate the damage. &{template:default} {{name=My Attack}} {{Shots Hit=[[{(ceil((2d6+?{Modifiers|0}+?{Shots Bonus|0}-8)/2)),0d0}k1]] }} {{ [Hit Location](!& #13;#HitLocation)=[Damage Roll](!& #13;#DamageRoll) }} Note: when pasting the above into your roll20 macro, remove the space from both "!& #13;#" items. These are html replacements, and both roll20 and the forums process them so they'll vanish if you're not careful! Once you save that macro, do NOT open it again or those characters will vanish. It's worth keeping a copy of the original macro in a text file outside of roll20, for the inevitable accidental deletion.