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

Specific MACRO for dice rolls

1721164587

Edited 1721165049
Hi, I'm trying to create macro that does two specific things: * Throwing two dice in one click / two separate results (like Savage World system but dice do not ACE / explode) * Result from both dice separate but together determine success of my test What do I mean? First dice is a ACTION DICE let's say d8 - to pass the test, result have to be 5 or higher If I roll 1 - 4, I have failed my test But here comes the second dice. LUCK DICE , because very often we also need a bit of luck in life to make it work :) And that luck decides do we actually succeed. Let's say d8 as well. But this dice works differently. Result above 4 is adding specific number to ACTION (actual check) 5 on dice adds +1, 6 adds +2, 7 adds +3, 8 adds +4. or 1 on luck dice actaully substract 1 point from test. In situation when character have more luck than sense, will still pass the test, beacuse total result still will be 5. Is something like that possible at all? Anyone can help?
1721165811

Edited 1721165835
Gauss
Forum Champion
Yes, this is possible but will require the use of either a Mod (API Script) or Rollable Table.  I see you have a Pro account, are you the game owner?  If so, which method would you prefer? 
1721233285

Edited 1721233442
Gauss said: Yes, this is possible but will require the use of either a Mod (API Script) or Rollable Table.  I see you have a Pro account, are you the game owner?  If so, which method would you prefer?  Rollable Table will do. I will be happy with that. I'm the owner, It's a Solo game I will be running, so lots of things will be rolled from rollable tables.
1721242252
timmaugh
Pro
API Scripter
You said rollable table was fine, and I'm sure Gauss will be able to hook you up with working solution using that method... but I figured I'd present one of the script alternatives, just so you can compare setup/investment in result. This example utilizes the MetascriptToolbox script: !&{template:default} {{name=Bit O Luck}} {{Action Die=[[1d8]]}} {{Luck Die=[[1d8]]}} {{Adjusted Roll=[\][\]$[[0]] + {&if $[[1]] = 1}-1{&else}{&math max($[[1]].value - 4, 0)}{&end}\]\] }} {{Outcome=**{\&if $[[2]].value > 4}Success!{\&else}Failure!{\&end}** }}{&simple} That produces output like this (three consecutive runs showing the Luck Die adding to the original roll, doing nothing to the original roll, and subtracting 1 from the original roll: That was built specifically to your example (d8 for Action, d8 for Luck, with 4 being both the success point as well as the "where-luck-begins-to-affect-things" point. We could probably agnosticize it to other die types and other breakpoints, but I'll hold off on showing that for now in case you do end up liking the rollable table option better.
That looks great. Exactly what I was looking for. Graphically nicely presented. All rolls are visable, and outcome is visable as well.
1721250658
Gauss
Forum Champion
I suggest using timmaugh's script, but if you ever drop below Pro let me know and I can set you up with the non-script setup.
To be honest, I don't really know how to use that script.  That's why I used option rollable table :D Where to put that script to make it work? 
1721413021
timmaugh
Pro
API Scripter
So, first you'd install the scripts from the Script Deck: Roll20 => Games => [Specific Game Page] => Settings => Mod (API) Scripts => Roll20 Mod Library(dropdown) => MetaScriptToolbox Choose the "Add Script" button at the bottom of the small blurb about the Toolbox, and answer the prompts in the affirmative. Once the Toolbox is installed, you can copy the command from the previous post and just paste it into chat and it will work. If it were me, though, I would create a Macro Mule character to handle any of these game-mechanic commands. For instance, if you had a series of these sorts of commands (a d8-d8 version, a d6-d10 version, etc. -- I don't know the system you're using), or other commands that controlled Dynamic Lighting, or token spawning, etc... I'd put all of those on a mule character and then reference them from there (either directly or in a Chat Menu ). To put them on a character, you'd be creating Abilities on the Attributes & Abilities tab of the character sheet. If you need help with the specifics of that, post back.
1721419684

Edited 1721420891
timmaugh said: So, first you'd install the scripts from the Script Deck: Roll20 => Games => [Specific Game Page] => Settings => Mod (API) Scripts => Roll20 Mod Library(dropdown) => MetaScriptToolbox Choose the "Add Script" button at the bottom of the small blurb about the Toolbox, and answer the prompts in the affirmative. Once the Toolbox is installed, you can copy the command from the previous post and just paste it into chat and it will work. If it were me, though, I would create a Macro Mule character to handle any of these game-mechanic commands. For instance, if you had a series of these sorts of commands (a d8-d8 version, a d6-d10 version, etc. -- I don't know the system you're using), or other commands that controlled Dynamic Lighting, or token spawning, etc... I'd put all of those on a mule character and then reference them from there (either directly or in a Chat Menu ). To put them on a character, you'd be creating Abilities on the Attributes & Abilities tab of the character sheet. If you need help with the specifics of that, post back. Thank you for your help. Yes, my idea is to create character for this solo play with four main Attributes, no Abilities check. Something like Fabula Ultima where you using only Attributes to roll. And because of that I will need different series of commands. I see my character like that: Intelligence d8 Agility d10 Strength d6 Vigor d8 Where character is really good in something, in that case Agility, Good in two Attributes, and weak in Strength. LUCK die always stay the same at d8. And pretty much that's it. Because this is solo game and rest of tests will be coming from rollable tables or simple roll yes or no. So, I just need four buttons to press which will test my Intelligence with d8 dice and d8 Luck, Agility with d10 and d8 Luck..and so on...with script your created for me.
1721434870
timmaugh
Pro
API Scripter
OK, so I mocked that up in my game. I gave my character, Umlauf, stats of: Intelligence = 8 Agility = 10 Strength = 6 Vigor = 8 (We could probably change the script command I'm about to share to work with an alternate entry of "1d8" instead of "8", but for now this is how I had it mocked up.) Then I created 5 abilities on the character. Four of them were named as "...Check"s... so: IntelligenceCheck AgilityCheck StrengthCheck VigorCheck Here is the relevant code for each (note you will have to replace "Umlauf" with your character name, or change it to "selected" and have a token on the board that corresponds to the character on which these abilities reside): IntelligenceCheck !&{template:default} {{name=Intelligence Check}} {{Action Die=[[1d@{Umlauf|Intelligence} ]] }} {{Luck Die=[[1d8]] }} {{Adjusted Roll=[\][\]$[[0]] + {&if $[[1]] = 1}-1{&else}{&math max($[[1]] - 4, 0)}{&end}\]\] }} {{Outcome=**{\&if $[[2]] > 4}Success!{\&else}Failure!{\&end}** }}{&simple} AgilityCheck !&{template:default} {{name=Agility Check}} {{Action Die=[[1d@{Umlauf|Agility} ]] }} {{Luck Die=[[1d8]] }} {{Adjusted Roll=[\][\]$[[0]] + {&if $[[1]] = 1}-1{&else}{&math max($[[1]] - 4, 0)}{&end}\]\] }} {{Outcome=**{\&if $[[2]] > 4}Success!{\&else}Failure!{\&end}** }}{&simple} StrengthCheck !&{template:default} {{name=Strength Check}} {{Action Die=[[1d@{Umlauf|Strength} ]] }} {{Luck Die=[[1d8]] }} {{Adjusted Roll=[\][\]$[[0]] + {&if $[[1]] = 1}-1{&else}{&math max($[[1]] - 4, 0)}{&end}\]\] }} {{Outcome=**{\&if $[[2]] > 4}Success!{\&else}Failure!{\&end}** }}{&simple} VigorCheck !&{template:default} {{name=Vigor Check}} {{Action Die=[[1d@{Umlauf|Vigor} ]] }} {{Luck Die=[[1d8]] }} {{Adjusted Roll=[\][\]$[[0]] + {&if $[[1]] = 1}-1{&else}{&math max($[[1]] - 4, 0)}{&end}\]\] }} {{Outcome=**{\&if $[[2]] > 4}Success!{\&else}Failure!{\&end}** }}{&simple} The fifth ability I named "CheckMenu", and that used a chat menu to show the other abilities as buttons: CheckMenu &{template:default}{{name=Check Menu}} {{Intelligence=[Intelligence](~IntelligenceCheck)}} {{Agility=[Agility](~AgilityCheck)}} {{Strength=[Strength](~StrengthCheck)}} {{Vigor=[Vigor](~VigorCheck)}} Then you can check the button to "Show In Macro Bar", and you'll always have a quick reference to pull the menu up, again, should you need it. Here is what the menu looks like: And here is each check being run in turn: As I said, it's a fairly simple change to make this work with a format like "d8" or "1d8" being used in the stat attribute instead of "8", so if that's what you need, let me know.
A very stupid way to do this without scripts is to use a small collection of tricks like this:  &{template:default}[[[[1d8]]+[[{1d7-3,0d0}kh1]]]][[[[1d8]]-1cs]] {{name=[eraser](#"style=" display: none " class="showtip" title=)}}{{[[[1]]](#)=$[[0]]+$[[1]]=$[[2]] [eraser](#"style=" display: none " class="showtip" title=)}} {{[[[0]]](#)=$[[3]]-[[1]]=$[[4]] [eraser](#"style=" display: none " class="showtip" title=)}} {{[[[{1d8-7,0d0}kh1]]](#)=[eraser](#"style=" display: none " class="showtip" title=)}} The rolls are made first before the rows, hidden out of view, then a roll is made which will hide one of the two rows, the corresponding pre-rolled results are displayed again, and the unnecessary stuff is hidden away.