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

Conditional Macros?

Hi guys, loving my time in Roll20 so far as both a player and a GM, however I now have a question regarding a macro I'd like to create and I'm not sure if it's either possible or would require an API script. Here's the idea. There are certain types of weapons in my games that produce an additional effect on a successful hit if they trigger. The exact mechanics would be: 1. Score a successful hit 2. Attempt to trigger the effect by rolling 15 or above on 1d20+DEX mod. 3. Apply the associated triggered effect damage. In the tabletop version of my games, a player typically rolls 2 separate d20s (one for the 'to-hit' roll and one for the trigger effect), if the to-hit roll fails they ignore the second d20 as the weapon can only be triggered on a hit. Assuming the hit is successful however, the player adds any DEX modifier to the second d20 and if it scores 15 or more then the effect if triggered and whatever dice size is required for the effect is rolled (typically a d6). I'm guessing the 'ideal maths/macro' would along the lines for the trigger check would be: /r 1d20>15 on success, /r {effect-dice} ...or somesuch (lol) I already have detailed 'to-hit' and damage macros, but the inclusion of the first of these 'trigger-effect' weapons has thrown a bit of a spanner into the works. Any suggestions? Is there a way to do a form of conditional check within a macro? BTW, anyone who has ever played the EverQuest RPG should recognise these types of 'proccing' weapons.
1417789558
The Aaron
Roll20 Production Team
API Scripter
Macros are not capable of such logic. You could write an API function to do that for you. Most people would write that with inline rolls, something like this: ( On a hit and [[1d20+@{DexMod}]] > [[15]], add [[1d6]] damage. ) Most of the DnD5e stuff does that kind of thing with the handling for critical hits.
Thanks for the reply Aaron. Since I have no real scripting skills, I will go with your suggestion of an inline roll, much appreciated.
1417847136
The Aaron
Roll20 Production Team
API Scripter
No worries. I think there wouldn't be that much additional benefit from a simple script anyway. However, if you decide to pursue a script solution, is be happy to help point you in the right direction. :)
Actually, I'd love to see a way to fake conditional macros through the API. - We have a house rule in our 3.5e campaign: Roll a 1, it's a -10; Roll a 20, it's a 30. (rather than auto-success; auto failure.) - I'd like to have various chat messages based on the degree of success or failure on a roll--either as a GM function or player function.
1418285616
The Aaron
Roll20 Production Team
API Scripter
The difficulty involved will depend on how you see that working. Your specialty 1d20 with a -10 for a 1 and a 30 for a 20 can be handled already with a rollable table. Just at the -10 with a weight of 1, then the numbers 2-19 also with a weight of 1 and then a 30 with a weight of 1. If it were named h20, you could roll it like this: [[ 1t[h20] + @{somestate} + @{someOtherStat} ]] Degree of success could be handled by adding a label with the required value and then parsing it in the API to provide additional feedback: [[ 1d20+7 [>15] ]] The API could look for that label and send an additional message about the difference. Food for thought.