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 .
×

Macro with Optional parts?

1485778196

Edited 1485778336
For my monk character, I can combine several of my attacks in different ways, e.g. Attack 1 + Extra Dmg + Extra Hit , Then Attack 2 + Lower Extra Dmg, Then Attack 3 + Extra Hit. Currently, I created these macros as individual buttons and then proceed to click whatever combination I currently need. I'd much rather have a single button that lets me modify what gets rolled, for example having some checkboxes that let me select what modifiers to apply. Can I do this in a macro and if so, how?
1485782360

Edited 1485782375
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Short answer, yes. The details may depend on your system and sheet tho. What are you playing, and what char sheet, if any, are you using?
We're playing Pathfinder but not using any character sheet, just "pure/generic" Abilities / Skills and Macros.
1485785805
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, I'm in a game doing the same thing right now; fair warning this will get complicated. I'm heading off to work and on my phone atm, so I can't give a full example, but it'll involve roll queries, advanced roll queries, and some nonstandard uses of API command buttons (API access not required). I'll post a more detailed explanation tonight, but in the meantime here are the relevant wiki links: <a href="https://wiki.roll20.net/Dice_Reference#Roll_Querie" rel="nofollow">https://wiki.roll20.net/Dice_Reference#Roll_Querie</a>... <a href="https://wiki.roll20.net/Macros#Advanced_Usage_for_" rel="nofollow">https://wiki.roll20.net/Macros#Advanced_Usage_for_</a>... <a href="https://wiki.roll20.net/API:Chat" rel="nofollow">https://wiki.roll20.net/API:Chat</a> (towards the bottom of this page) Do you want your output in a roll template, or just pure chat (less complicated macros)?
Pure chat will be already a great step in the right direction. I'm not sure if it's relevant, but please not I don't have access to any "Pro" scripting APIs of Roll20, and neither does my GM... I'll read through the pages nonetheless.
1485786261

Edited 1485786378
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yep, everything you'll use for this is base Roll20, no subscription required. The API command buttons are called that because they were introduced for use with API script's, but they aren't part of the API themselves (they're really just a special type of hyperlink).
1485820938
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ok, back home and on my computer. Here's how I have my&nbsp; Eldritch Archer Magus set up in the sheetless campaign I'm in. Now, that probably looks pretty incomprehensible, but&nbsp;the general idea is that you use roll queries to select what you're doing, which is then output to chat. The API command buttons allow you to store query options from the attack roll to be applied to the damage roll (aka power attack attack penalty and damage bonus) without having to reenter your selections. One thing that I use that makes this easier, is that I created a&nbsp; google sheet to html encode problem characters for me. This makes it so I can work with each level of nesting in close to human readable format. I'm happy to explain the parts in detail, or set up a part of the macro for you, just let me know what you need help with.
This is real gold, man. I digged through it for a while and I think I figured most of it out. I will try to create a similar sheet for my stuff. Two questions: Why does the first { in the command buttons not need escaping? (?{template:...) And: What do you mean by storing the query options? I didn't quite see where you applied that. And another thing; How do you decide what to put in separate Macros? Is there a rule? Could I just create several Macros and call upon them to make the whole thing easier to read?
1485882647

Edited 1485882677
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
ApoY2k said: This is real gold, man. I digged through it for a while and I think I figured most of it out. I will try to create a similar sheet for my stuff. Two questions: Why does the first { in the command buttons not need escaping? (?{template:...) And: What do you mean by storing the query options? I didn't quite see where you applied that. I'm only escaping the ending brackets because the roll template fields end at the first }} that they see (similarly to how roll queries end at the first } that they see) even if that double bracket is inside a command button syntax. So in order for the template fields to show up correctly, you need to escape those double brackets that are inside a command button an additional time on top of the escaping needed for nesting the roll queries. I'll touch on the storing query options part at the end. And another thing; How do you decide what to put in separate Macros? Is there a rule? Could I just create several Macros and call upon them to make the whole thing easier to read? There's not a really a rule and it doesn't matter for the running of the macro. I could have put all of this in a single macro, but I found it easier conceptually to split the parts out into like with like (spells in one macro, bow attacks in another - which also just so happens to be the master macro, and damage calculations as their own separate macros). For the storing of query responses; if you look in the longbow-damage ability, you'll see that the queries for things that were answered in the attack ability are escaped x times, but then my queries for damage specific things are escaped X+1 times. This means that my responses for things like Deadly Aim (penalty to attack, bonus to damage) from the attack are put in the damage ability so that I don't then have to re-answer these queries while still asking me for damage specific prompts when I trigger the damage ability because those prompts escaped X+1 times are not recognized as queries until the message is sent back to chat when the command button is clicked. Also note that all inline roll brackets are html escaped in the api command buttons, the command buttons won't work with inline roll results.
Okay, so this is what I've come up with now. <a href="http://pastebin.com/f58yTGaR" rel="nofollow">http://pastebin.com/f58yTGaR</a> I realized when doing it that the "First Attack in Round" should probably be something that I pass through to the abilities, but I'm not quite sure how to do it. The basic attacks are fairly simple, the only "Problem" I have is that I have to decide wether the attack is the first attack I do in a round or not - because then I get extra DMG.