#DsN integration problem
1 messages ยท Page 1 of 1 (latest)
Ah, sorry. I have little expertise in this area :/
Is this what you are looking for?
Yup
Is that a Pool or a single Roll?
because this should not be empty :
ChatMessage in v9 can only contains a single Roll
Attaching a pool will become possible in v10 afaik
I'm not sure what the right answer is. I simply created a roll from the roll formula and that's it.
Just checked the same thing but with the Foundry's roll class. _dice array is empty there too.
Ok indeed, sorry I forgot about the getter "dice".
Can you click on the "dice: (...)" in your object and show me the screenshot please?
Ok, do you see the first .faces at the start of a SKDie object? That's what determines the number of face on a dice
every results in this SKDie are expected to have the same number of face
I guess this is not the case in your system?
Nope. But this value is overwritten to the higher face value. At this point I don't really mind if an incorrect die starts rolling as long as no errors happen and the value shown is the value that was rolled.
FYI, this is the error DsN throws:
Yes because DsN can't roll a d4 that rolls a 8 ๐
No matter what dice is being rolled, the DicePreset always has .shape = d4
I'll add a feature in the backlog to check for this kind of unexpected result
Even if I type in chat /r d20, DsN will error out on values > 4
However I can't make this compatible with DsN entirely since .results are not supposed to have a .faces value.
I can remove the error but if you wish to be comaptible with DsN you either need to create your new dice in another way or to manually create the Data to be sent to DsN and call the API: https://gitlab.com/riccisi/foundryvtt-dice-so-nice/-/wikis/API/Roll#using-a-custom-roll-system
It really looks like I have configured something wrong or not configured at all, but I can't figure out what exactly
probably because if you check roll.dice[0].faces you'll find a 4
Alright, I'll check out that route and dig around some more.
Thanks for the assistance.
No problem, do not hesitate to come back to me if you need further help!
I suspect this is the place where I'm lacking some configuration...
No, really I assure you. Compare your result with one from core foundry. Like just roll a d20 and show me the ".dice"
It should look like this
Umm... it does look like this.
console.log(g);```
that should work perfectly fine
Is your system available on github or gitlab so I could test?
that should work perfectly fine
It doesn't ๐
Is your system available on github or gitlab so I could test?
It's on github in a private repo. I guess I can open it up.
If that's fine for you then that's probably the easiest way to find out what's wrong
There you go: https://github.com/maxstar/spellbound-kingdoms
I hope the system is more or less in a working condition ๐
Ooooh I found the issue, ok. This was on my side. I guess you are the first person that override the base Die class. I recently made DsN compatible with custom Roll class but not with custom Die class.
Therefore it was not able to parse the "d20"
changed it to this and now it works
I'll add this to v4.5.0 that release today or tomorrow
That won't fix your issue with exploding dice that change their faces number however :<
I'll add this to v4.5.0 that release today or tomorrow
Yay!
I though I was going insane ๐
That won't fix your issue with exploding dice that change their faces number however :<
Well, I'll survive that. Not a game breaking issue.
Thanks a lot.
I found a workaround if you want to integrate Dice So Nice tho, by recreating a Roll object from all your results, just for DsN:
let dice = [];
let roll = await new SKRoll("{{1d8xkh[base], {d6xkh, d4xkh}kl[penalty]}kl, {d4xkh, d12xkh}kh[bonus]}kh").evaluate();
roll.dice.forEach((die) => {
die.results.forEach((result) =>{
let newDie = new SKDie({faces:result.faces, number:1});
newDie.results = [result];
dice.push(newDie);
});
});
let dsnRoll = new Roll("1");
dsnRoll.terms = dice;
game.dice3d.showForRoll(dsnRoll, game.user, true);
Details of the showForRoll function here: https://gitlab.com/riccisi/foundryvtt-dice-so-nice/-/wikis/API/Roll#using-the-fvtt-roll-class
hmm nvm it would not respect the exploding order
Well ยฏ_(ใ)_/ยฏ
hmm nvm it would not respect the exploding order
But it will show a die with the correct number of faces?
yes
If you were to integrate dsn this way, you would need to toggle on and off the automated message hook before and after rolling your system-specific rolls.
game.dice3d.messageHookDisabled = true;
//do your roll here, create your message, and then once the message has been created
game.dice3d.messageHookDisabled = false;
or else it would show the 3D dice twice