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

If And Or Macro additions

Is there a way to include a If/and/or clause inside an attack macro to call a roll table macro based on Critical Hits and Critical Misses? IE Thaco rolls a Natural 20 on his attack roll below is his macro: @{Thaco|wtype}&{template:atkdmg} {{mod=+6}} {{rname=Greataxe}} {{r1=[[1d20@{Thaco|halflingluck}cs>20 + 4[STR] + 2[PROF]]]}} @{Thaco|rtype}@{Thaco|halflingluck}cs>20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[1d12 + 4[STR] + 2[MOD]]]}} {{dmg1type=}} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[1d12[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=}} ammo= @{Thaco|charname_output} I'd like to include the following macro: &{template:default} {{name=Critical Melee}} {{Effect=[[1t[Critical]]]}}  Which would only trigger on Natural 20's and &{template:default} {{name=Melee Fumble}} {{Effect=[[1t[Melee-Fumble]]]}} Which would only trigger on Natural 1's I know i can use #MacroName to call another macro within a macro just unsure how to write the If/and/or clause so that it wouldn't trigger roll table on every roll
1481440762
Tetsuo
Forum Champion
The only if then statements supported by roll20 natively are purely math scenarios. There is an API script (Pro user feature) that adds this functionality in, otherwise its unavailable.
1481452090
Andrew C
Marketplace Creator
You might want to talk to the Sheet Creator, they can build that kind of functionality INTO the Templates. D&D3.5E Sheet (callout to Diana P's hard work), includes Critical Hit and Critical Fail/Fumble rolls as part of the Attack Templates.
1481455787

Edited 1481456514
Use {{crit1=[[ 1t[Critical] ]]}} {{crit1}} only displays when r1 (or r2, given advantage) critically hits (determined by cs>20). Alternatively, replace the table roll with an  Ability Command Button that calls the corresponding macro.
Silvyre does it matter when in the roll I add the command line?  {{crit1=[[1t[critical]]}}?
1481498391

Edited 1481498512
Nope, but there can only be one displayed instance of {{crit}} per &{template}, so you might opt for {{crit1=[[1d12[CRIT]]] / [[1t[critical]]}}
1481498547

Edited 1481499064
Doesn't work as intended anyways command line {{crit1=[[1t[Melee-Fumble]]]}} is rolling for both crit fails and crit success 
Also I went to the trouble of macroing a template for rolltables and template won't be shown using the current macro
&{template:default} {{name=Melee Fumble}} {{Effect=[[1t[Melee-Fumble]]]}} this is my macro for fumbles calling the melee fumble table
1481498651

Edited 1481498700
{{crit1}} displays if and only if 1d20cs>20 resolves to equal 20 or greater (i.e. the critical success threshold defined by the cs>20 syntax).
1481499062

Edited 1481499099
DandDAddicts said: Also I went to the trouble of macroing a template for rolltables and template won't be shown using the current macro You can add an [ Ability Command Button ](~Character|AbilityName) to your attack macro to make this macro you're mentioning more accessible. (e.g. add an ACB for critical hits to {{crit1}} and an ACB for anything else to another field of your attack macro.) This is as close as you'll get to achieving the automation you're expressing interest in without the assistance of an API Script . (Access to the API is available only in games in which the game's Creator currently has an active Pro subscription.)
Don't quite understand what your expressing with the ability command button Are you saying I need to code in a trigger on the characters attribute page so that when they roll it will roll my rolltable macro with template? API scripts need to be usable by accounts that have them even if the Creator doesn't I hate GMing but sucks that I'm paying for the service but can't use it unless I join a game that has it 
It's roll20's fault i'm learning HTML and CSS as it is lol
@{Lacrimosa|wtype}&{template:atkdmg} {{mod=+6}} {{rname=Greatsword}} {{r1=[[1d20@{Lacrimosa|halflingluck}cs>20 + 4[STR] + 2[PROF]]]}} @{Lacrimosa|rtype}@{Lacrimosa|halflingluck}cs>20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[2d6 + 4[STR]]]}} {{dmg1type=Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[2d6[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=Silver and Red Flames flicker and dance around this Black Steel Greatsword}} ammo= @{Lacrimosa|charname_output} Adding these as getattrbyname? @{Lacrimosa|Fumble}cs=1 @{Lacrimosa|Critical}cs<20?
1481500270

Edited 1481500382
DandDAddicts said: Don't quite understand what your expressing with the ability command button Ability Command Buttons can be used to call Abilities (or sheet button rolls ) from a clickable button in the Text Chat. &{template:default} {{name=Critical Melee}} {{Effect=[[1t[Critical]]]}} If this macro is saved as an Ability (e.g. named CriticalMelee on the Character named Thaco), you could add the following Ability Command Button to your attack macro: [Critical Hit](~Thaco|CriticalMelee) or {{crit1=[Critical Hit](~Thaco|CriticalMelee)}} When you roll a critical hit, you could click the pink [Critical Hit] ACB to call your CriticalMelee Ability. You may find using Ability Command Buttons a more-accessible method of calling macros, maybe mitigating the desire for complete automation. DandDAddicts said: It's roll20's fault i'm learning HTML and CSS as it is lol Don't forget JavaScript! :)
Java is the next class on <a href="http://www.codecademy.com" rel="nofollow">www.codecademy.com</a> lol
DandDAddicts said: @{Lacrimosa|wtype}&{template:atkdmg} {{mod=+6}} {{rname=Greatsword}} {{r1=[[1d20@{Lacrimosa|halflingluck}cs&gt;20 + 4[STR] + 2[PROF]]]}} @{Lacrimosa|rtype}@{Lacrimosa|halflingluck}cs&gt;20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[2d6 + 4[STR]]]}} {{dmg1type=Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[2d6[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=Silver and Red Flames flicker and dance around this Black Steel Greatsword}} ammo= @{Lacrimosa|charname_output} Adding these as getattrbyname? @{Lacrimosa|Fumble}cs=1 @{Lacrimosa|Critical}cs&lt;20? This would mean any roll less than 20 is considered a critical success.
Can't get it to call attributes labeled as (Crit) or (Fumble) with current expression @{Lacrimosa|wtype}&{template:atkdmg} {{mod=+6}} {{rname=Greatsword}} {{r1=[[1d20@{Lacrimosa|halflingluck}cs&gt;20 + 4[STR] + 2[PROF]]]}} @{Lacrimosa|rtype}@{Lacrimosa|halflingluck}cs&gt;20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[2d6 + 4[STR]]]}} {{dmg1type=Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[2d6[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=Silver and Red Flames flicker and dance around this Black Steel Greatsword}} ammo= @{Lacrimosa|charname_output} [Critical Hit](~Lacrimosa|Crit) How would I express Critical fails? if [Critical Hit] is the call line for &lt;20?
SFX said: DandDAddicts said: @{Lacrimosa|wtype}&{template:atkdmg} {{mod=+6}} {{rname=Greatsword}} {{r1=[[1d20@{Lacrimosa|halflingluck}cs&gt;20 + 4[STR] + 2[PROF]]]}} @{Lacrimosa|rtype}@{Lacrimosa|halflingluck}cs&gt;20 + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[2d6 + 4[STR]]]}} {{dmg1type=Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[2d6[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=Silver and Red Flames flicker and dance around this Black Steel Greatsword}} ammo= @{Lacrimosa|charname_output} Adding these as getattrbyname? @{Lacrimosa|Fumble}cs=1 @{Lacrimosa|Critical}cs&lt;20? This would mean any roll less than 20 is considered a critical success. Thanks missed that wasn't paying as much attention to it as I should have should of course been @{Lacrimosa|Critical}cs&gt;20 but it didn't work anyways
critical success = cs&gt;20 greater than or equal to 20 or cs&lt;1 less than or equal to 1 critical failure = cf&lt;1 less than or equal to 1 or cf&gt;20 greater than or equal to 20. You can set threshholds with this too, if the crit threshhold is a variable d20cs?{Crit?|16}cf&lt;1 etc
1481501555

Edited 1481501898
So I've added the following attributes to the Lacrimosa character sheet: Critical &{template:default} {{name=Critical Melee}} {{Effect=[[1t[Critical]]]}} the macro is listed in the first box &nbsp;*edited attribute from *crit to Critical to head off any possible issues* Fumble&nbsp;&{template:default} {{name=Melee Fumble}} {{Effect=[[1t[Melee-Fumble]]]}}&nbsp;the macro is listed in the first box So if I've done this correctly I should be able to add a call line into characters macros to call these attributes my problem is the setting of triggering events if this is even possible?
1481502017

Edited 1481502321
[Deleted]
Sheet Author
hmm... I'm honestly still learning macros myself, so I'm not sure about that last part. As for calling, make sure your called macros have html escapes. I've been wrapping my head around that particular blot of undigested mustard for a couple of days now :/ Edit: Neceros.... I know the PF sheet has a conditional built in to roll crit damage. There has to be a way to do this, but it may require sheet scripting...
This is current test version trying to work on the [Critical Hit] @{Lacrimosa|Critical} line here so that it rolls this macro&nbsp;&{template:default} {{name=Critical Melee}} {{Effect=[[1t[Critical]]]}} on a &gt;20 roll which rolls&nbsp;[[1t[Critical]]]}} this rolltable and outputs the response in the above macro's template. @{Lacrimosa|wtype}&{template:atkdmg} {{mod=+6}} {{rname=Greatsword}} {{r1=[[1d20@{Lacrimosa|halflingluck}cs&gt;20 [Critical Hit] @{Lacrimosa|Critical} + 4[STR] + 2[PROF]]]}} @{Lacrimosa|rtype}@{Lacrimosa|halflingluck}cs&gt;20 [Critical Hit] @{Lacrimosa|Critical} + 4[STR] + 2[PROF]]]}} {{attack=1}} {{range=}} {{damage=1}} {{dmg1flag=1}} {{dmg1=[[2d6 + 4[STR]]]}} {{dmg1type=Slashing }} 0 {{dmg2=[[0]]}} {{dmg2type=}} {{crit1=[[2d6[CRIT]]]}} {{crit2=[[0[CRIT]]]}} 0 {{desc=Silver and Red Flames flicker and dance around this Black Steel Greatsword}} ammo= @{Lacrimosa|charname_output}
Basically I want to be able to use character sheet to use roll table for me
I'll be honest, 3 coffees ago I might have been more help, but my head is swimming. Silvyre is probably your best bet if he's around. Macro wizard that one is. Wish I could be of more help, but I need sleep, like, 4 hours ago :)
Get some sleep man I'll figure this out shouldn't need API to run this since its already does this by rolling extra damage when you score a crit&nbsp;
DandDAddicts said: So I've added the following attributes to the Lacrimosa character sheet: Critical &{template:default} {{name=Critical Melee}} {{Effect=[[1t[Critical]]]}} the macro is listed in the first box &nbsp;*edited attribute from *crit to Critical to head off any possible issues* Fumble&nbsp; &{template:default} {{name=Melee Fumble}} {{Effect=[[1t[Melee-Fumble]]]}}&nbsp;the macro is listed in the first box These should be added as Abilities , not as Attributes .