-
September 3rd, 2024, 15:08 #1
- Join Date
- Apr 2020
- Posts
- 5
Segregated dice results among one sole multiple roll
Hello all,
My title may not appear as clear as I want. I'll explain my intention.
I am coding an entire ruleset based on the CoreRPG ruleset and am implementing new mechanics for rolls.
What I want is to extract as much data from the roll as possible. Not just the total result. For exemple, for custom saving rolls, I have made custom d20's. One dLife and one dDeath.
For a test, I want my players to roll what part wins among them. Thus, I want to compare both dice result as well as the total. How could I achieve such result ?
Thank you in advance.
-
September 3rd, 2024, 15:23 #2
You can see many examples of how to setup and register result handlers for rolls in CoreRPG and 5E. In that function it is prior to outputting the result to chat. In the rRoll, that is passed into the resulting function, will contain a table of the roll. This nested table can be accessed by using rRoll.aDice. This would contain more data and can be manipulated to adjust the chat output.
Dominic Morta
Ruleset Developer
Smiteworks
How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it
How to provide an Unity Connection issue?-Connection Issues and What to Provide
Unity Updater issue?-Updater Issues
Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained
Comcast or Cox ISP User?-Comcast XFinity and Cox Users
Have a suggestion?-Feature Request
-
September 3rd, 2024, 16:39 #3
FG dice rolls are asynchronous - i.e. the FG code sets up the dice structure and then the roll begins, and the FG code ends at that point. The FG code picks up again in the result handler after the dice have landed.
To compare multiple dice rolls from different players you'll need to track the results of all dice rolls and then know when all dice rolls have been completed, and write code to then review the results and output an appropriate message.
So, what you want to do can get pretty complex, especially if you're not familiar with FG asynchronous rolls, script variable scope and OOB messaging.
The 5E scripts\manager_action_damage.lua file has an example of tracking result states in a local LUA table. See the "TRACK DAMAGE STATE" section at the end of that file.
The key is that the roll results should be tracked in a central place - in the 5E damage state tracking this is in the script space for that script - the "ActionDamage" global script package. So a lot of the code (setting and reviewing results) will need to be handled by the GM via OOB messaging from the player side.Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!
-
September 3rd, 2024, 18:18 #4
- Join Date
- Apr 2020
- Posts
- 5
Thank you a lot,
I will try to play around with the rolls and try to poke around where you nudged me.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks