Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with rerolling #141

Open
ACleverDisguise opened this issue Feb 22, 2022 · 3 comments
Open

Problems with rerolling #141

ACleverDisguise opened this issue Feb 22, 2022 · 3 comments
Assignees

Comments

@ACleverDisguise
Copy link

The r/R modifiers don't seem to work in any way that I want them to.

What I'm trying to accomplish is "roll 3d6, rerolling on any sum less than 10".

Here's what I've tried.

!3d6r[<10]
!3d6r[<10]
!(3d6)r[<10]
!3d6R[<10]
!3d6R[<10]
!(3d6)R[<10]

!3d6r[?<10]
!3d6r[?<10]
!(3d6)r[?<10]
!3d6R[?<10]
!3d6R[?<10]
!(3d6)R[?<10]

!3d6r[:<10]
!3d6r[:<10]
!(3d6)r[:<10]
!3d6R[:<10]
!3d6R[:<10]
!(3d6)R[:<10]

In all cases I got nothing like what I wanted. Either I got no result, timeout, or results that were clearly below 10 after several repeat rolls.

What's the trick? Or is this a bug in the r/R validator?

@obiwankennedy
Copy link
Member

First of all, the right command should be something like that: !3d6r[:<10]
Yes, it does not do what you want but the other syntaxes are wrong.

!3d6r[<10] is always true
!3d6r[?<10] is always true

I'm investigating the issue about the right syntax but I thing the R/r/a/e operator does not manage validator's compare method, they always do it as "on each dice".

@ACleverDisguise
Copy link
Author

Well, when I tried the syntax that looked right and it failed, I also tried every other variant (because the docs aren't written for comprehension). I even tried * and . as operators, knowing that they're not going to work either, just to be complete. Grouping. Lower-case or upper-case R. *, ., :, or nothing. It all failed.

So how would I go about making a "3d6, reroll if under 10" using the DiceParser?

@obiwankennedy
Copy link
Member

As I said, I'm investigating on the issue about the right syntax. And it is was I thought Reroll does not manage compare methods for validator. I'm trying to add its support but it is an important change.

As a work around, you can use the if operator:

!3d6;$1i:[<10]{3d6};"Final score: $2"

If you want to check each result:

!3d6;$1i:[<10]{3d6};"Results: $1 - $2"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants