src.dmg_dice += O.dmg_dice
Problem description:
I had hoped that I could get away with doing something like this and the roll function would just roll all total dice, but it doesn't look like that's the case.
Suggestions?
Code:
src.dmg_dice += O.dmg_dice Problem description: I had hoped that I could get away with doing something like this and the roll function would just roll all total dice, but it doesn't look like that's the case. Suggestions? |
Nov 1 2021, 6:29 pm
Best response
|
|
You haven't shown us how you're calling roll().
|
roll( ndice= 6, 6 ) |
In response to Lummox JR
|
|
Lummox JR wrote:
You haven't shown us how you're calling roll(). Uh, sorry. var/damage = roll(src.dmg_dice) + src.str - M.def |
In response to Lummox JR
|
|
Oh I guess, the dice are being used as "1d3", stuff like that.
|
Uh, no, what I mean is that like, things in the game can add extra damage dice, and they are like, "1d2", "2d6", as bonus damage.
I was hoping I could just add the dice like that to the player's damage dice, but when it is added, it comes out like "1d61d42d6" and just causes a bunch of error. |
In response to HartWing
|
|
I'm not sure why you wouldn't just do roll(1) + roll(2)?
|
You're adding strings together, is the problem. "1d6" + "1d4" will always be "1d61d4" which the roll() proc can't make sense of.
roll() is actually rather limited in that even if you added a + between them, it can't understand that format. The only formats roll() can understand are: sides The last one can take a - as well. |