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

scriptcard macro help

February 27 (1 month ago)
Nylo
Pro

sorry if im asking alot these days but setting up a custom game.


!script {{ --#title| Attack Roll  --#whisper|self --=Roll|1d4 --#emoteText|Rolling a d4 for attack... --?[$Roll] -eq 1|[ --+Result|You rolled a **1 (Miss!)** ❌ --]|?[$Roll] -eq 4|[ --+Result|You rolled a **4 (Crit!)**  --]|[ --+Result|You rolled a **[$Roll]**. --] }}

this one work on a d4 when we miss but not when we hit.

further more i would like the roll to query how many ydxkh1 if result is highest show the crit if result is a 1 show miss (and ofcourse still the dice)

if it is possible on a crit pop a button that roll same dice as chosen but exploding etc 1d4! if that is not possible then just a query of what dice i would like to roll.

if its not possible to pop a button roll in chat its ok to i will roll it manually

February 27 (1 month ago)
Nylo
Pro

would like the top yellow to disappear to if this kind of thing is only possible with another api like powercards i can install anything

February 27 (1 month ago)
Nylo
Pro

yes and the whisper is only me who sees it because i want everyone to see it


February 27 (1 month ago)

So if I'm understanding this correctly - you want

1. To select X and Y

2. Roll XdYkh1

3. If result is 1, show miss and the roll

4. If the result is Y, show crit, the roll and a button that will roll 1dY!

5. If neither of the above, show roll

Do I have all of this right? If so, this should all be doable without scripts, and I can help you.

February 27 (1 month ago)
Nylo
Pro

yes i believe you do if possible i  would like it to query kh1 or kl1 too but if not possible i will just duplicate it for advantage / disadvantage


February 27 (1 month ago)
Nylo
Pro

and thnks a lot for all your time



February 27 (1 month ago)
&{template:default} {{name=Attack Roll (?{advantage/disadvantage|none,1d?{die size|4}|advantage,?{die count|2}d?{die size|4}kh1|disadvantage,?{die count|2}d?{die size|4}kl1})[ ](#" hidden null=)
}} {{[-1.5]=[ ](#" hidden null=)
}} {{[1]=Miss[ ](#" hidden null=)
}} {{[0.5]=[ ](#" hidden null=)
}} {{[?{die size|4}]=[Crit!](!/
 &{template:default} {{name=Critical}} {{Roll=[[1d?{die size}!]]}})[ ](#" hidden null=)
}} {{[-0.5]=[ ](#)
}} {{[[[ {0,[[?{advantage/disadvantage}]]}>?{die size}f=1-0.5]]]=[ ](#)
}} {{Roll=$[[0.computed]]
}}

Alright, this should do it - it's a little complicated, but if there's any part of it you'd like to learn more about, I'd be happy to explain!

February 27 (1 month ago)
Nylo
Pro

Thanks i will look at it tonight when i come home

February 27 (1 month ago)
Nylo
Pro

its very good is there a way i can wrap it inside my scriptcard so iit outputs like my other rolls


February 27 (1 month ago)

C1 said:

its very good is there a way i can wrap it inside my scriptcard so iit outputs like my other rolls

Probably not, since it relies on the behavior of the template, but I know very little about scriptcards. But someone else can probably tell you how to do the same with scriptcards.

February 27 (1 month ago)
Nylo
Pro

i will just use it as it is just liked the better looks of scriptcards or powercards 


February 27 (1 month ago)
Nylo
Pro

because it do all i need to do


February 28 (1 month ago)
Andrew R.
Pro
Sheet Author

Ask in the ScriptCards thread in the Mods forum for help with ScriptCards.

https://app.roll20.net/forum/permalink/11175456/

March 12 (3 weeks ago)
Nylo
Pro


Tuo said:

&{template:default} {{name=Attack Roll (?{advantage/disadvantage|none,1d?{die size|4}|advantage,?{die count|2}d?{die size|4}kh1|disadvantage,?{die count|2}d?{die size|4}kl1})[ ](#" hidden null=)
}} {{[-1.5]=[ ](#" hidden null=)
}} {{[1]=Miss[ ](#" hidden null=)
}} {{[0.5]=[ ](#" hidden null=)
}} {{[?{die size|4}]=[Crit!](!/
 &{template:default} {{name=Critical}} {{Roll=[[1d?{die size}!]]}})[ ](#" hidden null=)
}} {{[-0.5]=[ ](#)
}} {{[[[ {0,[[?{advantage/disadvantage}]]}>?{die size}f=1-0.5]]]=[ ](#)
}} {{Roll=$[[0.computed]]
}}

thanks for the help, i do have situations where i be rolling etc 3d4dl1 and there i only want the crit button to show if the first kept roll is the max

so the crit button should only come if the 3 were a 4


March 13 (3 weeks ago)

There isn't really a way to distinguish individual rolls in a multi-dice roll like that (at least not without scripts, not sure how doable it is with them), and the macro I wrote can only determine max roll of a single (kept) die. It could be modified to account for multiple dice (currently if you roll multiple max results it doesn't display correctly, as it was set up for a single die), but there would still be no way to pick out only the first kept roll. You'd have to make that roll separately from the rest of the dice, and the drop lowest part of it makes that complicated.