3d-dice / dice-box-threejs

3D Dice implemented with ThreeJS and Cannon ES
MIT License
34 stars 12 forks source link

What is notation format for multiple deterministic die types and values? #3

Closed lucasishuman closed 2 years ago

lucasishuman commented 2 years ago

In the README it shows that you can specify the results for a given roll like ~

// rolls six dice that will land on 4's
const notation = '6d6@4,4,4,4,4,4';
Box.roll(notation)

How can one specify multiple values for multiple dice types? I don't see anything in the docs like this, so maybe it's not currently supported?

I'm looking for something like...

// rolls 2d4 with values of 1, 3 and 2d6 with values of 4, 4 and 1d20 with value of 14
const notation = '2d4@1,3&2d6@4,4&1d20@14';
Box.roll(notation)

Thanks!

frankieali commented 2 years ago

You can do 3d6+3d10@3,3,3,8,8,8. The deterministic values are assigned in the order they're processed from left to right. If a value is not assigned then the die will roll as normal.

Box.roll(['2d4@1,3','2d6@4,4','1d20@14']) would be nice to have but I did not set up the dice parser in this project.

lucasishuman commented 2 years ago

Excellent - thank you for the info.