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

Damage macro help

1421699954

Edited 1421703418
How would I make a specific macro or script for PCs taking damage that takes into account any resistances they have? Sounds like an easy one but I'm new to the API stuff and I'm frying my brain here...
1421707530
Gen Kitty
Forum Champion
If the characters have an attribute such as 'Resistance.Fire', your macro could do something such as [[ (3d6+6) -@{target|Target|Resistance.Fire} ]] But you'd need to make sure all your players had attributes for the resistances, if only set to 0, because macros fail in weird and sometimes cryptic ways if you try to call an unset attribute. ^_^ I hope this helps!
Given just how many different resistances someone could have (and thus need to be added to the macro), I would instead recommend a bit of manual entry. Ask person rolling if DR detracts from their damage: [[ ( 1d8 or whatever your damage is ) - ?{Any DR reducing damage?|0} ]] If you're looking for something specificlly API based, I would recommend posting in the API forum.
1421707877
Gen Kitty
Forum Champion
Well... it depends on the system. Some systems have just a handful of resistances, which makes my macro useful. Some systems are much more freeform, making the manual entry more reasonable :>
Hey thanks fellas, I'll try these out. I was looking to make a macro where it would ask you if you had any resistances and then subtract that entry and these both look useful. Thanks again!
1421709054

Edited 1421709219
Still having an issue. Here is my damage macro "!alter @{target||token_id} 2 -?{Damage Taken|0}". I just click and it deducts from the health bar what I input. How can I add a variable to that for resistances and get it to work or automatically deduct it? Something either where I add a resist attribute to the character sheet and it is deducted or a query where the player can just input the resist value and it is deducted. This is probably easier than I'm making it... I'm using D&D 4e rules if that helps.
Ha! I got it. ( !alter @{target||token_id} 2 -?{Damage Taken|0}-?{Resistance} ) So simple I feel stupid!
you should probably change that ?{Resistance} at the end to ?{Resistance|0} ... it can get weird sometimes with null values.
Yepper, got it. Thanks man.