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
This post has been closed. You can still view previous posts, but you can't post any new replies.

I would like to be able to roll negative numbers of dice

1550082464

Edited 1550083845
Hi,  So I've just recently picked up a system that uses Accuracy and Difficulty as opposed sets.  Meaning that if i have 2 Accuracy and 3 Difficulty, I will make a single die difficulty roll. I would normally write a macro and represent difficulty with negative numbers (2accuracy + (-3difficulty)), so that the result of the above arithmetic results in rolling  -1 dice. Unfortunately if you try to roll -1 dice the dice parser rolls 0 dice. Could you please modify the dice parser so that it will roll positive numbers of dice if you send it a negative number and color the output to denote that it happened?
Soo... technically you want an absolute function (which exists), with colorcoding (which could be achieved by an apiscript)?
no, I want to be able to roll negative dice. The negative dice are different mechanically than the positive dice, if the positive dice win i will keep the highest roll in the group. If the negative dice win i will keep the lowest roll in the group So Advantage 5, Difficulty 1 results in the roll 4d6kh1, Advantage 1, Difficulty 5 (should) result in the roll (-4)d6kl1 unfortunately the second case is broken in Roll20 because the dice parser ignores all negative dice
1550142439

Edited 1550148984
How do you roll a negative amount of dice on a real tabletop?  I mean saying "Hey, give me the -4 dice laying there" does not make sense to me. So please help me understand what you're actually trying to do. I have a possible solution in mind, but am not sure if it fits the needs.  Edit: Just tested my possible solution with just macros and found it is not possible due to order of operations in a single roll (macro calls are always interpreted before roll-queries and such). It would be possible with an Api-Script. Either one dedicated for this problem, or abusing the "rollable table macro" script to convert rollabletablecalls to macrocalls. Maybe the Powercards-script is capable of this, too. Suggestion without Api: Make 2 macros - one for each case - and select the correct one by hand. You can colorcode them by making all outcome successes (green) or fails (red).
On a table top I would do the calculation beforehand, or keep two pools of differently colored dice at least. The problem within roll20 is that you have no way to make conditional statements in macros. There's no way to decide "if the disadvantage set wins, then do this" as a single statement.  The hack is to change the sign, do the calcuation, and then roll the result, then have the output change color to show which set won.   Basically anything short of that takes the same amount of time as just counting them up myself, and its not a huge time savings even if it all works. I'm just really frustrated at the inability to build a macro for such a simple action.  In the end this is the sort of calculation that should go on a sheet and be toggleable on an attack roll. As in it will count up all the possible sources of advantage from your sheet and then query you for the amount of disadvantage to roll against, but it simply isn't possible with the way the dice parser handles "negative" dice (aka differently grouped dice).
1550163854

Edited 1550163992
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
I had this same discussion with someone else on the forums a couple months ago, and this is already possible with the caveat that the negative dice roll can't be the first argument in its expression, so the following will work: /r xdy - zdw /r xdy + -zdw /r n - zdw The following will not work: /r -zdw + xdy /r xdy +(-zdw) /r -zdw + n So, simply change your expression to be 2Accuracy - 3Difficulty, and you'll be fine. Edit: If you need the negative dice roll to be first, then you can simply use the n-zdw pattern where n=0 .
1550170741

Edited 1550172223
Like this? Accuracy = 2 Disadvantage = 3 [[2d6 - 3d6]] this isn't doing anything when i try to roll it, can you abbreviate a bit less? EDIT: Actually my chat is broken, will have to test again if it ever gets fixed
1550173935
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Yes, like that. The most common fix for a broken chat is to clear your chat archive from the settings drop down on the game's splash screen. Note that this is not  the same as clear current chat history from in game.
1550174091

Edited 1550174179
I am not the game owner, I don't see a settings dropdown Issues forum link
So, looking at the chat history your forumla is only doing arithmetic on the results . I need to do arithmetic on the number of dice being rolled, before they are actually rolled.  There are 2 different sets of dice (d6's), if there are more of one set then one thing happens, if there are more of the other set then a different thing happens.
1550175556
Scott C.
Forum Champion
Sheet Author
API Scripter
Compendium Curator
Ah, then, this should work for you: [[0 + [[2[Advantage] - 3[Disadvantage] ]]d6]]
Oh awesome, thats some weird parsing but as long as the sign is preserved through to the result i don't care hah. Thanks very much!
1550177905
Gen Kitty
Forum Champion
So would you like this closed to restore your vote, or would you like to maintain this suggestion?
I'm split: On the one hand its technically possible within the current parser and I have an answer On the other hand, its not documented anywhere and is not immediately intuitive to someone who doesn't know haskell (or hasn't dipped their mind into the madness that is JS), or who hasn't been using the engine extensively... and for the third hand the post only has one vote :/ I guess close it, I think there is still an issue with the product but I have an answer for my case.
1550261602
Kenton
Forum Champion
Translator
Before I close this at your request, I'd like to get this documented in the Dice Rolling page of the Wiki . Would you like to do it, or should I? What game system were you using this for? I'd like to include it as an example to help people searching in the future.
Sure, its for the Lancer  RPG
Thanks for the suggestion! After 30 days, Suggestions and Ideas with fewer than 10 votes are closed and the votes are refunded to promote freshness. Your suggestion didn't build the right momentum this time, but feel free to submit it again! We find that the best suggestions describe the problem you are having, and the solution you want. You can learn more about the process of making suggestions on the Roll20 Wiki! More details can be found here .