PDA

View Full Version : Access to die roll results in the chat window?



bracken
June 8th, 2020, 08:22
Hi Everyone,

When the results of a die roll are displayed in the chat window it is possible to right-click on the box to open a radial menu that has access to the results of that specific roll as you can then "modify" the result to halve it, double it, reset it etc. Is it possible to extend that radial menu in an extension getting access to the results in the underlying diebox? If that is not possible, can you access a specific diebox in the chat window through a drag-drop operation. I have tried hunting through the code in CoreRPG and through the forums but not had any success so far.

Thanks,
Bracken

damned
June 8th, 2020, 10:33
Can you provide more info about what you are trying to do?

bracken
June 8th, 2020, 11:01
Hi Damned,

I was exploring the possibility of automating other mechanics such as re-rolls of a previous roll + modifiers even if subsequent rolls have occurred. Other mechanics from some systems such as "pushing" rolls for year zero engine rulesets could be implemented this way. I have considered, and seen, solutions where the most recent roll is logged and then you can work with that. However, that doesn't help much if a different roll has occurred in the meantime.

The fact that we can scroll back through chat and make non-destructive modifications to historic rolls just seems perfect for something like this. Maybe you made a number of judgement calls etc on a roll a while back and want to rremain consistent with a previous roll ... just scroll back through the chat, right-click and select a "re-roll" option added by an extension.

At the moment I specifically want to try and implement the "push" mechanic this way ... it seems so easy to explain to my players. Want to "push" that roll you made, easy, just right-click and select "push" from the radial.

Sorry for the ramble.
Bracken

damned
June 8th, 2020, 14:49
To the best of my knowledge once the output is written to Chat the system has already finished with the roll and no longer knows anything about it.
It doesnt retain who rolled, what they were rolling or who they were targeting etc.
The right click option is interacting only with the displayed number and nothing else.
I imagine you would need to build in a system that collected and kept the data from every roll and somehow also linked to the Chat Output.
I dont know if it is even possible.

bracken
June 8th, 2020, 15:48
Hi Damned,

Thanks for that. The main reason I hoped it was more than that is because with the built in radial menu you can select to halve the result, e.g. 20 -> 10. If you then choose to double the result it displays 40, i.e. double the original value not the modified value. At the very least it means that the result in each diebox is recorded as you can alter several different results and you can always return to or modify the original values.

However, just my hoping that this was possible doesn't make it so. Never mind, I'll switch back to other workable if less satisfying approaches ... as quite often ends up being the way in software development :D.

damned
June 9th, 2020, 01:47
I think the right click is interacting with the number as displayed in Chat and not anywhere else - eg not retained in the DB.

Cupcakus
June 12th, 2020, 00:55
I was able to do this for my Grognard Extension (https://www.fantasygrounds.com/forums/showthread.php?55918-Fantasy-Grounds-to-Discord-(Grognard-Bot)) that tracks all the player's die rolls by basically intercepting the chat events. There's slightly different approaches if you want to get the final result after all dice are added together and modifiers are applied, or if you want to get the individual dice results.

bracken
June 12th, 2020, 08:06
Thanks for that, Cupcakus. I'll have a look at your extension as soon as I get a chance.