View Full Version : Grouping Dice Results
CrawlingChaox
September 4th, 2016, 04:10
Apologies if this seems really basic. I've been looking all over the forums and FG options for two hours now, and this doesn't seem to have come up anywhere.
I'm looking for a way to group dice results (reason: trying to play a One Roll Engine game on the CoreRPG ruleset). Normally, if I roll 5d10, the results will look somewhat like...
6, 8, 3, 4, 3
Is there a way to group the dice results so they show up grouped and in order? The example roll would then become
3, 3, 4, 6, 8
It's not strictly necessary, but it would definitely make an ORE game go like a breeze, rolling-wise. I don't know if it's been done or if it's at all possible.
Thanks!
damned
September 4th, 2016, 05:01
There is no inbuilt way to do this. You would need to do via an extension where you grab the results before they are displayed to chat and then manipulate them and then finish writing to chat.
CrawlingChaox
September 4th, 2016, 05:06
I'm ok with tinkering with the program a bit, but I'll need some directions (it's been years since I actually coded anything).
Actually, I did find just now a piece of code that seems to do just what I want it to, but it might be a bit outdated:
https://www.fantasygrounds.com/forums/showthread.php?9246-How-to-Sort-Dice-Roll-Results&p=66060&viewfull=1#post66060
If anyone can tell me if this will be compatible with the latest version, I'd appreciate it. Also, I couldn't find (on a first look) the chat_chat.lua they were talking about. Has it been renamed, by any chance?
EDIT: If my delving is correct, the incriminated piece of code is in manager_actions.lua, but I can't seem to find a way to position the aforementioned piece of code within it.
Trenloe
September 4th, 2016, 05:30
Try the attached extension. It uses chat command slash handlers (it's quick and easy and damned's excellent MoreCore extension/ruleset will support these in FG v3.2).
Use: /orderresult <dice string>
Where <dice string> is a standard basic RPG dice notation, rolling any number of a single type of dice: XdY - where X is the number of dY dice to roll.
You can probably shorten it to /order unless (by some weird chance) there is another extension you're using that uses the /order slash handler.
For example: /order 5d10
https://www.fantasygrounds.com/forums/attachment.php?attachmentid=15200
Download the attached "Order Dice Result.ext file", place it in your <FG app data>\extension directory, restart FG (if it's running) and enable the "Order Dice results" extension (CoreRPG and related rulesets only).
EDIT: Minor edit to extension to allow active identity (PC, GM ID, etc.) to be shown in the roll.
Trenloe
September 4th, 2016, 05:33
Actually, I did find just now a piece of code that seems to do just what I want it to, but it might be a bit outdated:
https://www.fantasygrounds.com/forums/showthread.php?9246-How-to-Sort-Dice-Roll-Results&p=66060&viewfull=1#post66060
Yeah, I spent a bit of time messing around with various lines of code, until I realised that I could get the standard LUA table.sort to work on the dice table (array) with:
table.sort(rRoll.aDice, function(a,b) return a.result<b.result end)
That's it!
:)
CrawlingChaox
September 4th, 2016, 05:38
As always, Trenloe, you are the man.
Just one last question: will I be able to link an /order 6d10 (for example) in a character sheet so that's the command being executed instead of the standard dice roll? So far I've only been able to add dice to a sheet manually, by clicking and dragging.
Trenloe
September 4th, 2016, 05:44
Just one last question: will I be able to link an /order 6d10 (for example) in a character sheet so that's the command being executed instead of the standard dice roll? So far I've only been able to add dice to a sheet manually, by clicking and dragging.
Not at present. But in the upcoming v3.2 release of FG damned plans to have this functionality available in his MoreCore extension/ruleset. Info on current version of this here: https://www.fantasygrounds.com/forums/showthread.php?23281-More-Core-extension-for-CoreRPG If you're using CoreRPG you probably want to use MoreCore.
The best you can do at present is drag the /order 6d10 to a hotkey slot at the bottom of the FG window and do quick rolls from there.
CrawlingChaox
September 4th, 2016, 05:51
Well, that settles it. Thanks for the great help, I have a couple of very young players in this game and I'm trying to make it as easy as possible for them.
Trenloe
September 4th, 2016, 18:42
damned reminded me that the extension needed a minor change to allow active identity (PC, GM ID, etc.) to be shown in the roll. Updated the extension in post #4.
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.