DICE PACKS BUNDLE
  1. #1

    Help accesing modifier stack before rolling dice

    Hello, i'm trying to access the value of the modifier stack just before the throwing dice animation happens.

    I have this script:

    function getRoll(rActor, sAbilityStat, vCantidadDados)
    local rRoll = {};
    local dMod = 0;
    --I need the value of the stack here as a number, say, dMod = -2
    local dados = d6s(vCantidadDados + dMod );
    rRoll.sType = "ability";
    rRoll.aDice = dados;
    rRoll.nMod = 0;
    rRoll.sDesc = StringManager.capitalize(sAbilityStat);
    rRoll.sDesc = rRoll.sDesc .. ": ";

    return rRoll;
    end

    The idea is to pass the modifier to the function that populates aDice so it can increase/decrease the amount of dice to throw.
    What'd be the best way to do this?

    Thanks in advance.

  2. #2

  3. #3
    Download and unpack my Shadowrun 5E extension for MoreCore. This adds dice to the dice pool from the modifier stack.

    https://fantasygrounds.com/forums/sh...ore-Extension)

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,410
    Have a look at the functions available in the CoreRPG ruleset (which is used by most rulesets) desktop\scripts\modifierstack.lua file. This is the ModifierStack global script package and the functions can be called with ModifierStack.<function name>...

    For example: ModifierStack.getSum() returns the total in the modifier stack.
    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  5. #5
    Thank you both, that was very helpful and it's working now.

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
FG Spreadshirt Swag

Log in

Log in