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

Help With Macros

Hello! I have a group who is new to roll20, and are loving using the system. I'm trying to research about macros and the API to use some extra features, and i already searched for this particular problem. On the char sheet we have some macros on attack, but the problem is that the GM doesn't know when a player roll for power atack and/or flank, he has to mouseover on the number to see the results of the macro, ou simply trust the players to do the right thing. Is there a way to know if a player changed some stats? for reference, here's my macro (text in portuguese): /em - @{character_name} usou uma flecha para atacar com @{weapon2name} e obteve [[1d20+@{bab}[BAB] +@{weapon2stat}[Ability] +@{size}[size] +@{weapon2enh}[Weapon2 Enh] +@{weapon2focus}[Weapon2 Focus] + ?{Flanqueando (1=sim)|0}*2[Flank] ]]. What i'm looking for is a way to the GM know if a player used Flank or no, or a way to change the text of the macro, something like this: /em - @{character_name} ?{use ability?|0} [[True:used ability|False:didn't used ability]] Is there a way to do this on the macro? Or only using the API? Thanks in advance! PS: Non english-speaker, so sorry for any typos.
Typically this is a Social Solution... when they roll, ask if they remembered to add this or that bonus to their roll. Other than mousing over, you can create your own macros for them to use, but you'll likely find that you have to keep updating it unless they learn to make it on their own. You can ask them, mouse-over the roll to see what was added, or create a different macro that breaks out any separate bonus visually. [[1d20+something]] + [[2]] flanking, etc. Or create a separate macro for Regular Attack, Power Attack, and just mentally add any circumstance bonus like Flanking or Bless. *** You want to avoid constantly checking their sheets, as it changes their view too if they're looking at it at the same time. They're not meant to be used by more than one person at a time.
Otherwise, there's a few things you can do with token bubbles or attributes. ie: in Bar1 keep their HP as usual, but bar2 keep their attack bonus and bar3 their damage bonus. When using Power Attack, Bar2 = -1, Bar3 = 3. When flanking that becomes Bar2=1, Bar3=3, etc. In this way you can use Attack: [[1d20 + @{selected|Bar2}]] Damage: [[1d20 + @{selected|Bar3}]] Or you can just use roll Query's, but they can get annoying if overused. Attack: [[ 1d20 + ( ?{PowerAttack? 1=yes 0=no|1} * -1 ) + (?{Flanking? 1=yes 0=no|0} * 2) + ?{Misc Attack Bonus?|0) ) Damage: [[ 1d20 + ( ?{PowerAttack? 1=yes 0=no|1} * 3 ) + ?{Misc Damage Bonus?|0) )
1437170269

Edited 1437170518
vÍnce
Pro
Sheet Author
Mouseover is probably the best option. You have included the descriptors which is good! You can separate the mods and do the math visually /em - @{character_name} usou uma flecha para atacar com @{weapon2name} e obteve [[ 1d20+@{bab}[BAB] ]] Attack [[ @{weapon2stat}[Ability] ]] Ability [[ @{size}[size] ]] Size: [[ @{weapon2enh}[Weapon2 Enh] ]] Enhancement [[ @{weapon2focus}[Weapon2 Focus] ]] Focus [[ ?{Flanqueando (1=sim)|0}*2[Flank] ]] Flank basically same thing using the default roll template /em - @{selected|character_name} usou uma flecha para atacar com SWORD e obteve &{template:default}{{name=@{selected|character_name} - Weapon Attack}}{{Attack=[[ 1d20+@{bab}[BAB] ]] }}{{Ability=+[[ @{weapon2stat}[Ability] ]] }}{{Size=+[[ @{size}[size] ]] }}{{Enhancement=+[[ @{weapon2enh}[Weapon2 Enh] ]] }}{{Focus=+[[[ @{weapon2focus}[Weapon2 Focus] ]] }}{{Flank=+[[ ?{Flanqueando (1=sim)|0}*2[Flank] ]] }}
Thanks for the replys! Do you guys think is worth doing something on the API, and using the macro to call that and then display everything nicelly? is it possible? Something like: function Attack(character, flank, pwratt){ //do the calculations here } and then a macro calling !attack @{character_name} ?{Flanquando? (1=sim)|0} ?{Power Attack?|0} Is this possible?
My idea for the API works, just tested. Thanks for all the replys! @Vince: I'll totally steal your first macro and do everything detailed =] Thanks
1437171969
vÍnce
Pro
Sheet Author
Victor S. said: Thanks for the replys! Do you guys think is worth doing something on the API, and using the macro to call that and then display everything nicelly? is it possible? Something like: function Attack(character, flank, pwratt){ //do the calculations here } and then a macro calling !attack @{character_name} ?{Flanquando? (1=sim)|0} ?{Power Attack?|0} Is this possible? Above my pay grade Victor. :-) Sounds like you got it working though. If you have any API-related questions you'll get great help posting to the API forum. Cheers
1437175888
Lithl
Pro
Sheet Author
API Scripter
Victor S. said: Thanks for the replys! Do you guys think is worth doing something on the API, and using the macro to call that and then display everything nicelly? is it possible? Something like: function Attack(character, flank, pwratt){ //do the calculations here } and then a macro calling !attack @{character_name} ?{Flanquando? (1=sim)|0} ?{Power Attack?|0} Is this possible? Possible, yes, but the API doesn't automatically interpret functions for you like that. You can create an Attack function, but it won't do anything until you call it yourself from within the API. The API interacts with the tabletop via registering events using the on(event, callback) function. In order to react to a message sent to the chat such as !attack, you need to use the chat:message event: on('chat:message', function(msg) { if (msg.type === 'api') { // The message began with ! if (msg.content.indexOf('!attack ') === 0) { // The message began with !attack // Parse the msg.content string to find your parameters, then call your Attack function } } });