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

Hit & Damage in one button

1454980882

Edited 1454980924
Hey, so I'm starting up a campaign and am very new to Roll20. What I'd like to do is streamline the game as much as possible, so that I can calculate both attack and damage with a single button. The relevant attributes would be: Armor: The AC of the character Attack: the bonus to a character's attack Damage: The amount of damage their weapon does Wound: The amount of damage required to wound a character Strike: Once the character rolls their attack, this value is set to their roll Margin: The margin of difference between the Strike and the target's Armor (Character rolls a 10 for attack, target has armor 6, Margin would be 4) I want it to go like this: (Attack button is pressed, or the macro is entered in chat) Player is asked to choose a target Set the character's attribute 'Strike' equal to Attack + 1D6!p Set the character's attribute 'Margin' equal to Strike - target's Armor "@{selected|token_name} attacks @{target|name} and " IF @{selected|Margin} < 1 "Misses" *end script* else "Hits, dealing " @{selected|Margin} * @{selected|Damage} "damage." If Margin*Damage > Wound "It's a Wounding blow" else "It's just a scratch" Okay, I know that is all messed up, mixing macros with other stuff. Basically, the character rolls their attack. If they hit, the margin by which they hit is multiplied by their damage. If that amount exceeds the target's Wound threshold then the target receives a wound. And I'm sorry in advance if this is a silly question. I've dabbled in scripting for a few languages, but API is nothing like them. Any help would be appreciated! Thanks!
Soma C. said: I had a script (!attrib stat|new value) that allowed me to set attributes installed, but it isn't working any more and I can't seem to find where I got it from. Sounds like HoneyBadger's "attrib" script. Here's a link to a version modified by The Aaron. For your macro, I very strongly recommend using PowerCards (another one of HoneyBadger's scripts).
I don't remember writing that attrib script... lol. As for powercards... it won't automatically apply the damage.
HoneyBadger said: As for powercards... it won't automatically apply the damage. We'll have to keep begging praying, then... ;)
Thanks for the replies! I'm checking out PowerCards now. I will likely have more questions in the future about how to apply this to my campaign, but for now this is very helpful. Also, I'm not worried about applying damage to the target. Only about comparing whether the damage is significant enough to cause Wound on the target
Okay, first off PowerCards is amazing! Great work! Almost everything's going well so far, but I'm starting to run into a big problem. At the moment this is my macro: !power {{ --emote|: @{selected|token_name} attacks with their @{selected|Weap}. --format|Lita --name|Basic Attack --leftsub|@{selected|Weap} --rightsub|Attack Action --Attack:|[[ [$Atk] 1d6!p + @{selected|WeapS} + @{selected|WeapB} ]] vs @{target|Armor} Armor --Strike:|[[ [$Stk] 1d0 + $Atk.total - @{target|Armor} ]] --Damage:|[[ [$Dmg] d0+ $Stk.total * @{selected|WeapD} ]] --?? $Atk.total < @{target|Armor}?? !Miss:|Missed! --?? $Atk.total >= @{target|Armor} ?? Hit:| Deals [[d0 + 1 * @{selected|WeapD} ]] damage }} My problem is that I want to use one of the --?? statements, but use an equation to determine whether it's true rather than a single value . For instance, I'd like to check if $Atk.total - @{target|Armor} >= @{target|Wound} / @{selected|Damage} (so that I can tell if the margin * the damage is greater than the target's wound threshold) Is that possible? Here's a workaround I've been trying. I thought maybe I could make my own Margin to be calculated by creating a new tag after the --Attack tag that said: --Strike:|[[ [$Stk] 1d0 + $Atk.total - @{target|Armor} ]] But unfortunately it seems you can't use the $Atk.total here. Strike returns 0 + $Atk.total - 10 = 0 Same problem when I try to calculate damage, since the original roll ($Atk.total) is a key factor. (in the formula above I have $Stk.total plugged into the Damage tag, but the problem is the same) Is there maybe a way to do this? To use the $Atk.total in an equation? Maybe would it be possible to, after rolling the Attack, automatically save the result as an attribute? Or even just save the $Atk.base as an attribute? If I could do that, I'd be able to fix everything! Thanks again for you help! I hope that all made sense XD I'll try working on this some more tomorrow
Conditionals can't be used for math. You need to do all your math before you make the comparison. It's a limitation of PowerCards right now and for the foreseeable future. It would take a lot of re-writing to make it work.