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 with damage macro.

Hello. So, I'm sorry if this seems obvious as I suck at math. I'm trying to make a macro to auto-calculate damage for Fallout PnP 2.0. Here's an example of the macro as it is now for a 9mm Mauser with AP rounds; &nbsp;/roll (1d4+4-@{Target|damage_threshold_base-normal})*(1-@{Target|damage_resistance_base-normal}) In the case of a Radscorpion, the target's DT is 5% (Expressed in Roll20 as 0.05), and his DR is 1.&nbsp; When rolled, however, it comes out as this; "rolling (1d4+4-0.05)*(1-1) ( 4)+4-0.05)*(1-1) = 0" Something isn't right. How sound I make this macro work? Here's a link to the rules for Fallout PnP,&nbsp; <a href="http://www.fallout.ru/projects/pnp/fallout_pnp_2.0" rel="nofollow">http://www.fallout.ru/projects/pnp/fallout_pnp_2.0</a>... Thanks.
1529309691

Edited 1529309859
GiGs
Pro
Sheet Author
API Scripter
It looks like your roll formula doesnt match the formula in the screenshotted text. Also in your formula: notice the final part : *(1-1)=0 You are multiplying by 0, so the result is always going to be zero. Also it looks like your brackets are maybe in the wrong place; the d4+4 and -0.05* shouldnt be inside the same brackets. I can't figure out what the formula should be though, since the rules do a really bad job of explaining themselves.&nbsp;What is ID? Is Threshold the same as DT?&nbsp;
Yah well, for starters, you have DT and DR backwards, according to those rules, DT is always a flat number, and DR is the percentage.&nbsp; So try using DT as 1 and DR as .05.
1529312375
GiGs
Pro
Sheet Author
API Scripter
Oh I've just realised the screenshotted formula is in fact incorrect, repeating some of the the tems. It says: (Damage - DT) - ((Damage - DT) * DR) The Damage-DT is listed twice. That's a pretty sloppy mistake to make. So your formula is actually correct, but as Aranador spotted, you have the wrong values in DT and DR. Swap them over.
Actually, he has used math to condense the two damage-DT parts into one - expand out his formula and it becomes the game formula.&nbsp; But the DT DR reversal is a definite error.
Aranador said: Yah well, for starters, you have DT and DR backwards, according to those rules, DT is always a flat number, and DR is the percentage.&nbsp; So try using DT as 1 and DR as .05. Oh wow. So, some of the enemies have DR and DT switched. I'm guessing this is a mistake, because it works well when I switch them like you said.&nbsp; I'll just have to watch out for that. Thanks guys!