I know you've already got this working, but since you have a Pro sub I figured I'd toss out a quick scriptcards api solution. You mentioned complicated house rules - scriptcards can support pretty involved conditional logic, etc., as it is a sort of light procedural language that doesn't require compiling additional js code. So, you may be able to fully incorporate your GM's dice mechanics into a more comprehensive solution. There is definitely a syntax learning curve, but the script thread is full of people willing to help out! Here's a simple(-ish) annotated scriptcard for rolling and displaying a variable number of dice: !scriptcard {{
--:INITIALIZE VARIABLES|
--=numDice|?{How many dice?|1}
--=dieSize|?{What type?|d4,4|d6,6|d8,8|d10,10|d12,12|d20,20|d100,100}
--=&diceOutput|
--=i|0
--:TITLE CONTENT|
--#title|Dynamic Dice Rolling Example
--#leftsub|Rolling [$numDice]d[$dieSize]
--:LOOP THROUGH NUMDICE, CALLING THE ROLLDIE PROCEDURE AND PASSING DIESIZE AS PARAMETER|
--:Loop|
-->RollDie|[$dieSize]
--=i|[$i]+1
--?[$i] -lt [$numDice]|Loop
--+Rolls|[&diceOutput]
--X| End Macro
--:PROCEDURES|
--:RollDie| accepts dieSize as the first and only parameter
--:ROLL ONE DIE OF TYPE DIESIZE|
--=thisRoll|1d[%1%]
--:APPEND THE FORMATTED DIE ROLL TO THE OUTPUT STRING|
--&diceOutput|+[$thisRoll]
--<|
}}