Rolls twice in chat

Issue #87 resolved
Cam created an issue

I get two dice results even when advantage/disadvantage are not selected. If this isn’t a bug is there a setting to turn this off?

Comments (13)

  1. Kim Mantas repo owner

    Yes it’s not a bug, it will always roll at least 2d20. If advantage or disadvantage is applied to the roll it will colour them appropriately. There’s no setting to turn it off.

  2. Eadorin

    Because I’m too lazy to fork + pull + request merge + try to get my Bitbucket ssh keys working….. :

    js/rules/rolls.js :
    Line 415-417

    let n  = (game.settings.get('obsidian','rollTwoDice')) ? 2 : 1;
    
            if (rollMod && rollMod.mode != "reg") {
    

    js/main.js :
    Line 46-56+:

        Hooks.once('ready',function() {
            game.settings.register('obsidian', 'rollTwoDice', {
            name: "OBSIDIAN.ConfigNumDiceHead",
            hint: "OBSIDIAN.ConfigNumDiceMessage",
            scope: "world",
            config: true,
            default: false,
            type: Boolean
          });
        });
    

    lang/en.json :
    Line 591-592+:

        "OBSIDIAN.ConfigNumDiceHead": "Always roll two dice",
        "OBSIDIAN.ConfigNumDiceMessage": "If left unchecked, will only roll a single die for abilities by default",
    

  3. Zach Korman

    Changing those lines of code doesn’t let me choose it as a character sheet option in foundry. It worked before I edited it, then when I changed the code it stopped coming up as an option.

  4. Eadorin

    What exactly do you mean “choose it as a character sheet option?” Choose what?

    Also, where are you trying to change it, Zach? The place to change between 1 and 2 dice is in Game Settings → Configure Settings → Module Settings (tab) → Obsidian. (once you add my code)

  5. Zach Korman

    In Foundry, after activating Obsidian, I can change the sheet for my players. After changing the code to make only 1 roll, the obsidian character sheet no long presents its self. It also doesn’t show up in any game settings.

  6. Cam reporter

    I got it working by putting the second bit of code underneath

    Hooks.once('ready', function () {
        let fontSheet = 'font';
        if (game.i18n.lang === 'ja') {
            fontSheet = 'ja';
        }
    

    in js/main.js

  7. Zach Korman

    Alright, after leaving that in, I get it to show up… Now it isn’t letting me make rolls. Everything else works though.

  8. Log in to comment