PDA

View Full Version : /roll result for each dice



Tchikibo
February 20th, 2025, 21:57
Hello,
I'm coding different rolls for a ruleset I am developing. I have stumbled uppon a problem. I know there is a way to register a roll to retrieve its informations after the roll, but I have no return on the roll functions so I don't understand the mechanic for it. I have tried to unpack how it is treated with the adv and dis in 5e, but I can't wrap my head around how it works. Can somebody help me please ? I want to compare the dices among one rolls.

bayne7400
February 20th, 2025, 22:29
You need to setup a roll handler. Look at any of the manager_action_ files in 5E. They are declared onInit(). It would be the result handler. The rRoll table will be passed into that function.

Mephisto
February 21st, 2025, 09:30
To get some explanation what happens in a lua file, you can upload the code to ChatGPT and ask, how a specific function works in detail. You usually get a very nice explanation what is happening and what variables are used for what. You can even upload multiple files in a zip.

Tchikibo
February 21st, 2025, 12:51
Yes thank you ! The handler is the key. I had check in the manager_actions from CoreRPG and the one from 5e, I hadn't though of looking at specific calls like attack of check. It should work with this lead. Thank you

Tchikibo
February 21st, 2025, 12:52
Thank you, I may try the ChatGPT lead. But I like to try and investigate. Gives me a better understanding of the code.

Trenloe
February 21st, 2025, 15:43
This thread may also help: https://www.fantasygrounds.com/forums/showthread.php?35531-Coding-dice-rolls-(actions)-in-CoreRPG

Tchikibo
February 22nd, 2025, 17:19
Oooh, nice, thank you for this thread. I will study the subject