Moerill / Mess

MIT License
17 stars 10 forks source link

Roll Improvements: support for "dice so nice" module and roll sound #21

Closed ultrakorne closed 4 years ago

ultrakorne commented 4 years ago

Dice so nice is the 3d dice module and a lot of dice roll modules support it already.

I am adding this as an enhancement request because with my party this was the deciding factor to wait for the future to try mess in a real session because my players want the roll experience they are used to.

Moerill commented 4 years ago

This is actually not so easy with the multiple possible automatical rolls at once, since dice so nice only allows one instance of rolls at a time (and a maximum of 20) what is your preferred method here? if its not much work i may think about adding it, since i'm partially interested in using dice so nice as well.

ultrakorne commented 4 years ago

So the problem is when both hit and dmg are selected that it is required to have 2 rolls at once right? (if I m not mistaken minorQOL with the fast rolls on is just chaining them one after the other)

From a player point of view this will be my ideal expectation:

ultrakorne commented 4 years ago

for example if the hit is 1d20+7 and damage is 2d8+4 you roll 1 fomula and then you should be able to get individual results from the roll and decompose them into 2.

image

Moerill commented 4 years ago

Main problem is when you attack 2 or more different targets its starting to be a rather long wait time, for each roll to finish and having 2 different attack rolls in one roll is kinda confusing as well.

ultrakorne commented 4 years ago

when you attack multiple targets then it can be skipped, I would say there is no expectation of rolls in that scenario.

The main use case for me is with no target selected.

This is a feature that mostly will be enjoyed by whom looks for less automation and wants to roll everything or most of the things separately

Moerill commented 4 years ago

ok so my suggestion, which i'd be okay to try would be to just make 3d dice roll, when clicking the buttons yourself. This aligns (for me) with the idea of wanting to take time to wait for rolls and thus being ok with making that one extra click.

This would mean that multi-target woudl be ok, as long as no autoroll is selected.

Moerill commented 4 years ago

Ups accidently closed this. This will be moved to a later version.

Moerill commented 4 years ago

if this will happen it will not happen before FVTT 0.7.x, due to incoming dice API changes and resulting dice so nice changes.

bsleys commented 4 years ago

I don't know what's in the FVTT 0.7 changes are but it looks like the dice API Changes are out with 2.0. I was thinking of taking a shot at getting this working but will leave alone if you have something in the works or I'm missing something.

Bob

Moerill commented 4 years ago

i have nothing in the works currently, so feel free to take your shot at it! (:

and i thought the general FVTT dice api does go through some changes in 0.7 buuuut simone and atro did talk about the changes and they're already taken into account for the v2 of dice so nice.. soooo.. we can hope that it stais like that?

bsleys commented 4 years ago

OK so I think this tuned out to be easier than I thought it was going to be.

So I added to index.js the following. If you have a better place to store if DSN is on/off then obviously feel free to adjust.

Hooks.once('diceSoNiceReady', (dice3d) => {
    game.mess.diceSoNice = true;
});

Then in dice.js or any r.roll() if I missed any just add the following after the r.roll(); I only found r.roll() in dice.js inside rollToHit and rollDmg.

    r.roll();
    // if Dice so Nice is enabled wait for the dice to roll
    if (game.mess.diceSoNice == true) 
        await game.dice3d.showForRoll(r).then(displayed => { });

This will delay the update of the card till the dice roll is complete.

If you have a bunch hit and dmg auto rolls set then each roll with be done is succession and then the card displayed. It would probably be nicer to throw all the dice at once or something but at least it works. I figure if the user wants to use DSN then they are willing to wait for the dice to roll.

I noticed one bug in that if the user turns DSN on/off via its config option, ie not disable the mod but simply turns it on/off, they need to reload the page to get things in sync.

Bob

Moerill commented 4 years ago

Did it a little bit different: For automatic rolls: 1) rolls to Hit 2) rolls all dmg die together 3) renders chat card If multiple target, the above will be repeated for each target

For manual rolls: 1) rolls roll and disables all buttons 2) updates card on roll completion

For both it respects the current selected rollMode for whether to sync or not s ync dice to every user

Also finally added roll sounds.