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

Using the result of one roll in another equation?

I'm working on macros for my upcoming Feng Shui 2 game. In FS2, damage is calculated by subtracting the target's defense from the attack roll total and then subtracting the target's toughness (if it isn't a mook). Is there a way to use the results of one die roll in another equation?
The Macro system is unable to store or alter any data or values, so you're unable to carry over a result from one roll to use in another roll. The only way you'd get around this would be to have two separate macros; one for Attack, and one for Damage, and query the end-user to manually enter the value from the attack roll in a pop-up window. ex: Macro1: Attack: [[ 1d20 + 4 ]] Macro2: Damage: [[ ?{What was the Attack Result?|0} - @{target|Defense} - @{target|Toughness} ]]
Actually with the new nested inline rolls you could roll one inside the other. [[[[ 1d20 + 4 ]] - @{target|Defense} - @{target|Toughness} ]]]]
If you use it within another, the end-user will not get a chance to see the attack result. It needs to be two separate macros for this so the user can see the first result, and then type it into the prompt from the second macro. I've edited my post for clarity.
And another consideration that makes what Mark G. is saying more likely to me is that there may be modifiers to damage from weapons and schticks. Another question: How do I do the vertical line as seen between target and toughness?
That's a Pipe | That's shift + backslash on most keyboards. (the one above enter key)
1430339458

Edited 1430370148
Ed S. said: Actually with the new nested inline rolls you could roll one inside the other. [[[[ 1d20 + 4 ]] - @{target|Defense} - @{target|Toughness} ]]]] Wouldn't a simple [[(1d20+?{modifier}) - @{target|Defense} - @{target|Toughness}]] suffice? (In regards to Mark G.) I don't know the system well, but to go even further it could be like [[{((1d20+?{modifier}) - @{target|Defense} - @{target|Toughness}) , d0cs1}kh1]] damage (the syntax might be bad) but I believe this will tell you the damage on the hit without producing negatives. Thanks to HoneyBadger, it should now work and not appear green! A full macro might be /me swings his sword attempting to strike! Doing [[{((1d20+?{modifier}) - @{target|Defense} - @{target|Toughness}) , d0cs1}kh1]] damage.
I don't believe you can do this accurately in a single roll. To make an attack, roll a Dice Pool, containing a positive and negative die to determine your Swerve . Add the Swerve to your Attack Value (Guns, Martial Arts, Sorcery, etc) to get your Action Result . If you meet or beat your target’s Defense value, you hit . If you hit: Subtract your target’s Defense value from your Action Result. The result is your Outcome . Add your Outcome to your weapon’s damage value to determine your Smackdown . The target subtracts their Toughness from the Smackdown to determine how many Wounds they take. You're going to want two separate rolls: One for attack, and one for damage. The user first rolls the attack roll. The result will be on the screen. If the Action Result actually hits; you roll the damage and use a Roll Query to ask the end-user what their attack roll was. The damage macro will take that entry from the user and subtract Defense and then add Weapon Damage, and then subtract Toughness. If you were to roll it in a single macro, you would not know if your attack hit or not, as it's modified by other factors when determining damage. Macro1: Attack: [[ 1d20 + 4 + 2]] Macro2: Damage: [[ ?{What was the Attack Result?|0} - @{target|Defense} + @{WeaponDamage} - @{target|Toughness} ]] Sample Values: Rolled 12 to hit for 6 dmg with Swerve of 2, a defense of 4, weapon damage of 2, and toughness of 2 Macro1: Attack: 12 Macro2: Damage:12 - 4 + 2 - 2 Sample Values if Combined: Results in "8" which wouldn't look like it was enough to hit, where 12 is when separately rolled. Macro1: Attack/Damage: 12 - 4 +2 -2