PDA

View Full Version : 5E: manager_combat2.lua - addRightClickDiceToClauses?



Varsuuk
March 16th, 2025, 04:57
I have been using 5E (due to its automation) as a guide in my ruleset work.

I have removed many methods and added others based on what applies to my setup.
I left the call to addRightClickDiceToClauses(rRoll) in my code but only because I didn't know what it does ;)

I mean, I am not sure how something causes the "if #rRoll.aDice > nOrigDamageDice" to be true. From the name of the method, I'd expect some way to select the damage button and right-click add more dice to it... but I have no idea how to do that in 5E if that is the right reading of this to start with.

Moon Wizard
March 17th, 2025, 16:43
If you are dragging a dice roll, and you right click; it adds dice to the roll. When adding dice in this way, that function attempts to map the new dice to an existing damage clause in order to assign a damage type.

Regards,
JPG

Varsuuk
March 18th, 2025, 05:42
I figured as much from the name and code... but it didn't work when I tried it in 5E.

Steps:
From Character sheet, rolled damage on a club (for example)
Put cursor over the white text window in Chat window where the roll is described and totaled.
left click-hold and drag (see a very light DMG icon)
right-click - makes another copy appear in the chat window (the total) no popup.

Interestingly enough, I didn't know this feature and its cool - I can rightclick on the damage roll and I get a cool menu that lets me adjust the dmg 1/2, x2/ +/-, etc... but not add-dice.

Mephisto
March 18th, 2025, 11:15
This is to add the dice before the roll, when you start the drag and the dice get visible in the cursor "hand". :)

Varsuuk
March 19th, 2025, 04:16
I’ll try again, but every time I started dragging, right click just ended it.

If you mean right click on top of the damage roll results window then YES I got a context menu. I’ll have to look again but all I saw on it was negate, x2, 1/2, forgot what else didn’t see a add dice like you get when going to drag dice from bottom of screen and right click.

But maybe I missed it in a submenu. At least now I realize it’s right click BEFORE drag I was not understanding how could do both :)

Varsuuk
March 19th, 2025, 04:47
I tried to do rightclick pre-moving (ie cursor a hand) and got the context menu I'll paste here. One I begin the drag I am unable to right-click - unlike when I pickup dice from bottom and right click then - that spawns dice like Tribbles...

63826

Moon Wizard
March 19th, 2025, 07:43
Try dragging a damage roll from the damage button on the PC sheet; then right click a couple times; then release the dice in the chat window.
This will trigger the code that this function handles to work.

Regards,
JPG

LordEntrails
March 20th, 2025, 15:48
You can also get to this code by picking up a die off the desktop with a left click hold/drag and right clicking to add dice.