PDA

View Full Version : Dice Modification



dragonmarked dm
February 9th, 2010, 19:42
I'm not new to fantasy grounds, but am new to the programing side of things. I've figured out how to create rulesets w/ character sheets and such. What I know little about is the scripting and such.

We're playing A song of Ice and Fire, and I would like to create a custom dice for rolling "x" amount of dice, and keeping "x" highest dice such as roll 4d6 and keep the highest 2.

Is that even possible in FG, and if so how would I go about it (knowing very little about scripting, but slowing learning)

Moon Wizard
February 9th, 2010, 23:53
What you want is to set up a new "roll type" to support keep the highest dice scenarios. If you look through code, such as d20_JPG or 4E_JPG, you can see that you can set the dice roll type (such as dice, attack, damage, ...) whenever the user drags from the object you enable, or when you call the chatwindow.throwDice function.

Then, in the chatwindow.onDiceLanded function, you can check the roll type before building the message that gets sent to the chat window. When you build the message, you should be able to perform any custom calculations and choose which dice and results are passed on to the message.

Cheers,
JPG

dragonmarked dm
February 10th, 2010, 00:02
thanks for the reply. I'll give it a try when I get home tonight.