-
January 27th, 2020, 17:47 #1
- Join Date
- Dec 2016
- Posts
- 2
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.
-
January 27th, 2020, 21:42 #2
Welcome vPumpkinG
something like this:
ModifierStack.addSlot(desc, value);
-
January 27th, 2020, 21:48 #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)
-
January 27th, 2020, 23:04 #4
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!
-
January 27th, 2020, 23:14 #5
- Join Date
- Dec 2016
- Posts
- 2
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