Adding new die to existing dice collection
Hi :)
I now learned how to code a trigger for dice rolls with their chat message etc., in my case a d100 triggered by an effect. However, the problem is that the number of d100 is arbitrary in my code (so, it can be that it has to be 2d100 instead of just d100) and that depends on the situation, like a DMG effect can add an additional die to the damage in 3.5e. I do not know how to add additional d100 to the existing one, I tried table.insert like I saw it in the coding of the DMG effect but that does somehow not work. To break down my code I try at some point in my code:
Code:
local bDice = {};
bDice = table.insert(bDice, {"d100, d10"});
But the outcome is only a nil value. I thought that I maybe insert the additional d100 wrong but replacing {"d100, d10"} with a "d6" (as string, I guess(?)) does not work, too, so this does somehow not work for other types of dice.
Do I use the insert function somehow wrong? I tried to do it similar to other parts in existing code but something is going wrong here for me :)
Best,
Kelrugem
EDIT: Oh, of course, bDice will be the variable defining the type of die of my roll, so it will be in some "rRoll" and rRoll.aDice = bDice (following the guideline in the comments at the very top of manager_actions.lua in CoreRPG).