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 me finish this insane macro! PLEASE!

1421349734

Edited 1421349765
Tom
Pro
Sheet Author
There are times when you realize that what you are trying to do is just beyond your skills to transform into useful code. This is one of those times. I'm trying to create a macro that will calculate falling damage. It sets a dice cap at 10 dice, then every 2 dice that would have been rolled above that translate to 1 bonus point of damage. To do this, I need to marry two macros together and I'm just not up to the task, it seems. Too many brackets makes Tom's head spin. So if someone could lend a hand, I'd really appreciate it. In the end, I'd really like to make this one big inline roll, with an output something like this: First, the business end of the falling damage macro: [[ { ( ( (?{Areas|1} *4) - ( (?{Victim Toughness Successes|0}/2) + ?{Break Fall Successes|0}) -@{target|armor}) ) d10!sd } > 7 ]] points of damage. Now here is the 10-dice cap macro: /roll [[ ( ?{Combined Dice Pool|1} + ?{modifiers|0} ) d1kh10 ]] d10!sd > 7 + [[ {0, floor ( ( (?{Combined Dice Pool|1}+?{modifiers|0} )- 10)/2) } kh1 ]] bonus successes Thanks in advance!
1421353770
Falcon
Pro
Sheet Author
Can you give us a breakdown without the formulas? Variables: ((Areas *4) - (Toughness Successes/2) + (Break Fall Successes) - Armour) D10!sd>7 <-- What are you trying to do here? /r (Combined Dice Pool + Modifier)D1kh10 --> You know you are rolling a D1 sided dice here then are you trying to get a number for D10!sd>7 ?? I am lost - can you explain in a little more detail then I can help. THanks.
1421356127
Tom
Pro
Sheet Author
Black Falcon said: Can you give us a breakdown without the formulas? Variables: ((Areas *4) - (Toughness Successes/2) + (Break Fall Successes) - Armour) D10!sd>7 <-- What are you trying to do here? /r (Combined Dice Pool + Modifier)D1kh10 --> You know you are rolling a D1 sided dice here then are you trying to get a number for D10!sd>7 ?? I am lost - can you explain in a little more detail then I can help. THanks. d10!sd>7 = d10 dice pool, reroll 10s; sort descending; count rolls of 7+ as a success. The first formula is all about totaling up the d10 dice pool. Dice rolled are equal to the number of Areas (game term, think Fate's Zones) fallen, times 4, MINUS half of the victim's toughness (an attribute roll) successes, and any break fall (a talent, think feats) successes, and any armor the character is wearing. The second formula is tricky. I barely understand it, but it rolls a set of 10 d1s and tells R20 to keep the highest set. This (in some weird way) is what caps the die roll at 10. If I take that formula and, for instance, put in 12 dice, it only rolls 10 dice. The second part (+ [[ {0, floor etc.) converts those extra dice into bonus successes. If there is an easier way to do all this, I'm all ears.
just to clarify, the number of dice is (areas*4)-the other stuff in that macro? you aren't adding the break fall successes to the number of dice rolled right? and that number is capped at 10 but every 2 dice after that is another point of damage? If that is right, I am sure it can be combined into 1 macro, but I don't think it can be all in one inline roll. I will play around with it for a while...
So, I worked under the assumption that the second macro was something you found as a way to perform the function that you needed, and not actually coded to do useful things with your system. If you dont actually need to do anything with the combined dice pool and modifier queries you can do [[{(Areas *4) - (Toughness Successes/2) - (Break Fall Successes) - (Armour),10}kl1]]D10!sd>7+[[ {floor( ( (Areas *4) - (Toughness Successes/2) - (Break Fall Successes) - (Armour)-10)/2 ),0 }kh1]] the kl1 sets the max dice at 10d10, the kh1 sets the minimum added to the damage at 0. sadly there isn't any way to put everything inside an inline roll with the way the dice roller handles the kh and kl in relation to teh calculation of how many dice to roll.
1421409867
Tom
Pro
Sheet Author
Roger A. said: just to clarify, the number of dice is (areas*4)-the other stuff in that macro? you aren't adding the break fall successes to the number of dice rolled right? and that number is capped at 10 but every 2 dice after that is another point of damage? If that is right, I am sure it can be combined into 1 macro, but I don't think it can be all in one inline roll. I will play around with it for a while... Yes. The falling damage, before modifiers, is Area*4. However, I think the cap really needs to be put in place after the modifiers (toughness, break fall, armor).
1421410068
Tom
Pro
Sheet Author
Roger A. said: So, I worked under the assumption that the second macro was something you found as a way to perform the function that you needed, and not actually coded to do useful things with your system. If you dont actually need to do anything with the combined dice pool and modifier queries you can do [[{(Areas *4) - (Toughness Successes/2) - (Break Fall Successes) - (Armour),10}kl1]]D10!sd>7+[[ {floor( ( (Areas *4) - (Toughness Successes/2) - (Break Fall Successes) - (Armour)-10)/2 ),0 }kh1]] the kl1 sets the max dice at 10d10, the kh1 sets the minimum added to the damage at 0. sadly there isn't any way to put everything inside an inline roll with the way the dice roller handles the kh and kl in relation to teh calculation of how many dice to roll. Thanks Roger. I'll test it out this morning. Thanks for the effort. Yeah the whole 10 cap is a snap on the tabletop, but a real PITA in macro-land. If the output has to be ugly, then ugly it will be. I can live with it. :)
1421429673
Tom
Pro
Sheet Author
Roger, Tried it and the whole thing kept getting hung up. It took a lot of puzzling and reverse engineering, but I finally got it working. Ditching the idea of making it an inline roll helped matters considerably. Here is the final macro: /r [[ ((?{Areas|1}*4)-((?{Victim Toughness Successes|0}/2)+?{Break Fall Successes|0}+@{target|armor}))d1kh10]]d10!sd>7 plus [[{0, floor(((?{Areas|1}*4)-((?{Victim Toughness Successes|0}/2)+?{Break Fall Successes|0}+@{target|armor})-10)/2)}kh1]] bonus damage