PDA

View Full Version : Change colour on 1 dice



Arion
July 7th, 2015, 15:07
When Neil wrote the (fantastic!) Advanced Fighting Fantasy ruleset, he set up combat dice so that it rolled 3D6 and coloured one of them as the damage/armour roll. Is it possible to create an extension that does this for a defined 3D6 roll? I don't need it to add or subtract that roll or only add two of them etc, simply to set up a custom dice set that rolls 2 normal coloured D6s and one different colour one.

kylania
July 7th, 2015, 15:38
This thread (https://steamcommunity.com/app/252690/discussions/2/617329505862260288/?insideModal=1) has some information about that.

Trenloe
July 7th, 2015, 16:37
You want to colour one of the dice results reported in the chat window? Similar to the colouring of dice result in a d20 system when a critical is rolled?

If so, it looks like the colour is controlled by adding a "p" in front of the dice (for purple) or "g" (for green). Do a search for "p" in the 3.5e scripts\manager_action_damage.lua script for an example.

Arion
July 7th, 2015, 16:57
You want to colour one of the dice results reported in the chat window? Similar to the colouring of dice result in a d20 system when a critical is rolled?

If so, it looks like the colour is controlled by adding a "p" in front of the dice (for purple) or "g" (for green). Do a search for "p" in the 3.5e scripts\manager_action_damage.lua script for an example.

Sort of, but the colour is always applied to that dice. I have been playing around with adding a customdie to a copy of the core ruleset, based on the custom die in the AFF ruleset. Then i could just add a custom die and two normal D6's to a quickslot to get what i am after. But although i can get the custom die into the core ruleset, i cannot get it to show the custom "dice face" in the chat window...

kylania
July 7th, 2015, 17:41
Is there a way to use that "p" or "g" along with a hotkey or /die command?

Trenloe
July 7th, 2015, 17:46
Sort of, but the colour is always applied to that dice.
That's exactly how it works. You add g6 (for example) to add a green d6 to the dice list before they are rolled - this notation is only valid within the dice table code, used within a dragdata object: https://www.fantasygrounds.com/refdoc/dragdata.xcp or a comm message data structure: https://www.fantasygrounds.com/refdoc/Comm.xcp.

This is done for a critical damage roll, for example:

https://dl.dropboxusercontent.com/u/39085830/Screenshots/Fantasy%20Grounds/gd6%20colour%20example.jpg

This works in the 3.5e ruleset, but not CoreRPG - the green and purple dice are defined in gameelements.xml - there are red and blue dice in there too. Use the following to roll 3d6 with one of the d6 always shown as green:


function throwGreenDie()

aDice = {};
table.insert(aDice, "g6");
table.insert(aDice, "d6");
table.insert(aDice, "d6");
sDesc = "Test";
nMod = 0;

local rRoll = { sType = "dice", sDesc = sDesc, aDice = aDice, nMod = nMod };
ActionsManager.performAction(nil,nil,rRoll);

end

This gives:

https://dl.dropboxusercontent.com/u/39085830/Screenshots/Fantasy%20Grounds/3d6%20green.jpg

Because the green g6 is added to the aDice table first it is always the first in the result.

Trenloe
July 7th, 2015, 17:53
Is there a way to use that "p" or "g" along with a hotkey or /die command?
The CoreRPG convertStringToDice (in scripts\manager_string.lua) function would need to be modified to support the purple, green, blue and red dice (or similar coloured dice in other rulesets).

Trenloe
July 7th, 2015, 18:29
The CoreRPG convertStringToDice (in scripts\manager_string.lua) function would need to be modified to support the purple, green, blue and red dice (or similar coloured dice in other rulesets).
To expand on this. The convertStringToDice function in CoreRPG only matches dXX (where XX is a number). So, you can add the custom coloured dice from gameelements.xml in the 3.5E (or similar) ruleset, but they would have to be numerical. For example: d1006 for a red d6, d0016 for blue, etc.. (The numbering doesn't matter as long as it doesn't clash with an existing die definition and is purely numeric - I've used RGB (red-green-blue) for the first three digits - so 100 is red, 001 is blue, 111 is green, etc.. These all have to match with the <die> definition and associated die icon in the FG XML.

See the attached for a simple extension - enable the "Red d6" extension in any ruleset. This adds a red d6 with the definition d1006 and the associated icon definition and icon graphics file. You can roll 3d6 with one of them red with /die 2d6+d1006 This can be dragged to a hotkey slot.

https://dl.dropboxusercontent.com/u/39085830/Screenshots/Fantasy%20Grounds/Red%20d6%20extension.jpg

Arion
July 7th, 2015, 18:35
To expand on this. The convertStringToDice function in CoreRPG only matches dXX (where XX is a number). So, you can add the custom coloured dice from gameelements.xml in the 3.5E (or similar) ruleset, but they would have to be numerical. For example: d1006 for a red d6, d0016 for blue, etc.. The numbering doesn't matter as long as it doesn't clash with an existing die definition and is purely numeric - I've used RGB (red-green-blue) for the first three digits - so 100 is red, 001 is blue, 111 is green, etc.. These all have to match with the <die> definition and associated die icon in the FG XML.

See the attached for a simple extension - enable "Red d6" in any ruleset. This adds a red d6 with the definition d1006 and the associated icon definition and icon graphics file. You can roll 3d6 with one of them red with /die 2d6+d1006 This can be dragged to a hotkey slot.

https://dl.dropboxusercontent.com/u/39085830/Screenshots/Fantasy%20Grounds/Red%20d6%20extension.jpg

Fantastic! I am ever in awe of the skill that allows you to do that... I am very much indebted to you!

[I will also look at the coding and see if i can learn something]

kylania
July 7th, 2015, 18:42
That's so cool! Thanks for the example.

Blackfoot
July 11th, 2015, 20:20
I do this in my Champions Ruleset to handle the 'Stun Modifier' for 'Killing Damage'... (it's basically an extra die that is multiplied by the result to determine damage)
I pull the die out and color it red but all the dice are rolled together... then reported separately.
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=10479

Mask_of_winter
July 20th, 2015, 20:09
And now I can run some Dragon Age, Fantasy AGE or Titan's Grave!

5 Gold and a party for Trenloe!

Trenloe
July 20th, 2015, 20:14
5 Gold and a party for Trenloe!
Jim's organising the party: https://www.fantasygrounds.com/forums/showthread.php?25151-Volunteers-Needed-Gen-Con-Bearded-Booth-Babes-please-apply-%28beards-optional%29&p=221978&viewfull=1#post221978

Or perhaps he's cancelled it. Damn...

Mask_of_winter
July 20th, 2015, 20:32
Jim's organising the party: https://www.fantasygrounds.com/forums/showthread.php?25151-Volunteers-Needed-Gen-Con-Bearded-Booth-Babes-please-apply-%28beards-optional%29&p=221978&viewfull=1#post221978

Or perhaps he's cancelled it. Damn...
Now that's what I call a party!

jshauber
July 20th, 2015, 20:45
I had to cancel the strippers, but if any are going to be in Indy next weekend I know quite a few good spots to sit and have a couple of brews!!!