DMsGuild
  1. #1

    Removing modifier from dice results

    I am working on a Warhammer 4th edt ruleset, and I need to remove the modifier from the dice total in the white box when rolling dice.

    Basically in WH you add a modifer to your skill, not the dice roll. So I've edited the rollOutcome() so the chat results are correct.
    But the modifier is still shown in the white box with the dice roll. I would like to just have ONLY the die result in the white box.

    Is it possible to code the modifier away from the die roll result?

    I am using the Ruleset Wizard and made a script for the roll. Could I just add another function to this script?

  2. #2
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    25,225
    Blog Entries
    1
    Quote Originally Posted by ShakyLuigi View Post
    I am working on a Warhammer 4th edt ruleset, and I need to remove the modifier from the dice total in the white box when rolling dice.

    Basically in WH you add a modifer to your skill, not the dice roll. So I've edited the rollOutcome() so the chat results are correct.
    But the modifier is still shown in the white box with the dice roll. I would like to just have ONLY the die result in the white box.

    Is it possible to code the modifier away from the die roll result?

    I am using the Ruleset Wizard and made a script for the roll. Could I just add another function to this script?
    Something like:

    Code:
    function onBeforeDiceRoll()
    	DiceRollString ="1d20";
    end

  3. #3
    I tried just adding that code in the beginning of the script, but that didn't seem to work. Probably just put it in the wrong place.
    I'll explain a bit more in detail what I am doing.

    I have instructed the numberfield to run skillroll.SkillHandler when rolling dice.

    Code:
    function SkillHandler(rSource, rTarget, rRoll)
    
        local rMessage = ActionsManager.createActionMessage(rSource, rRoll);
            --local adv = DB.getValue(ActorManager.getCreatureNode(rSource), "advantage_field", 0);
        local mod = rRoll.nMod
        local nTarget = rRoll.skill+mod
        local nTotal = ActionsManager.total(rRoll)-mod;
        
        rMessage.text = rMessage.text;
               
        rMessage.text = rMessage.text .. ": " .. "[".. nTarget .."]" .. " vs. [" .. nTotal .. "]" .. "\n"
        .."Outcome: " .. rollOutcome(nTotal, nTarget, adv);
       
        if rTarget then
            rMessage.text = rMessage.text .. " vs " .. rTarget.sName;
        end
        
        Comm.deliverChatMessage(rMessage);
        
    end
    This just controls what is shown in the chat, except for the white field with the dice roll.
    What I would like is that the field I marked in red, in the picture below, is not there.
    And the result on the right most place should be equal to the die result.
    Is this even possible?

    Capture.JPG

  4. #4
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    15,537
    Blog Entries
    9
    I bet if you go back and look at rRoll, you will find it is a function that adds in the modifier. Sk either you need to overwrite that where it is defined, or don't use it and just use the diceRollString like damned suggested.

    Note, on my p hone so can't open up the rulesets to check, and just getting into doing myself so I could well be wrong. But that's what I would look at.

    Problems? See; How to Report Issues, Bugs & Problems
    On Licensing & Distributing Community Content
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
    Note, I am not a SmiteWorks employee or representative, I'm just a user like you.

  5. #5
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    25,225
    Blog Entries
    1
    My specific code was showing the absolute bare minimum for a onBeforeDiceRoll() it was unlikely to be exactly what you want.
    In this case I think you should approach it differently.

    In your NumberField set Use Modifier Stack to False
    Set Re3set Modifier Stack to False

    in your Roll use something like:

    Code:
    local nMod = ModifierStack.getSum();
    ModifierStack.reset();
    This should not grab the Modifier Stack in your roll but grab it in processing and then you can use nMod in your calculations.

  6. #6
    Thanks damned. That worked perfectly! Just need to fix up the script for the results, but that's the easy part.

    This forum is helping me immensly with this project. So just a general thanks to everyone here!

  7. #7
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    25,225
    Blog Entries
    1
    Keep plugging away it it!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
5E Storm Kings Thunder Playlist

Log in

Log in