DMsGuild
  1. #1

    [CoreRPG] where is scripting to add dice to draginfo on right click?

    I've got a specific custom die roller that isn't adding to the dragged dice on right click as standard dice (and my other custom rollers) do, but I can't seem to locate the scripting in CoreRPG responsible for adding these dice. Can anyone point me to it?

  2. #2
    For most rulesets, it's handled in the ActionsManager script of the CoreRPG ruleset, when the calling ruleset passes in a call to ActionsManager.performAction with a draginfo value that is not nil and an rRoll value that has dice defined.

    There are lower level APIs if you want to access directly; but you can review ActionsManager to see examples of those if needed. I would use the high-level if you can.

    Regards,
    JPG

  3. #3
    Thanks for the tip -- that's where my search was focused, so it's nice to have that confirmation. I'm still struggling a bit to find the event that's triggering on the right-click to add extra dice, though. I assume that's happening in one of the lower-level APIs you mentioned and that some object those APIs depend upon isn't being populated correctly, but I'm really having a devil of a time tracing the issue. In essence, I have a button with a dice string in it which can be dragged to roll. If the rRoll.aDice resulting from that drag consists of most types of dice (e.g. "d20" or "d10, d10"), right-clicking adds additional dice to the drag as expected. If aDice consists of d100s (e.g. "d100"), though, right-clicking does nothing. As far as I can tell, the rRoll.aDice looks correct the entire way through being processed by ActionsManager, but something about having d100s in there seems to be preventing this from working correctly. (Note that I'm not talking about percentile dice i.e. "d100, d10" here, I'm talking specifically about just having d100s with 00-90 values in the roll.) My best guess is that whatever API code is responsible for selecting the extra die to add on click isn't recognizing the d100 type, but it's hard to say for sure what's going on until I can track down the code involved.

  4. #4
    There is no event for right clicking the dice. An additional dice is simply added to the roll by the client; and you won't see any information on that until the user completes the roll.

    For your use case, that won't work in FGC at all for percentile dice; since that is all manually handled by scripts, and the right-click is not a script event.
    I'm not sure if it will work in FGU, but I believe so. I'd have to have an example to test with.

    Regards,
    JPG

  5. #5
    Hmm, just to make sure I'm understanding you, you're saying the code responsible for adding extra dice on click is inaccessible to scripting, so since it doesn't recognize d100 in FGC there's simply no way I can extend this behavior to handle that die type? That's a bummer if true, but at least you've saved me wasting several more hours of trial and error trying to figure it out!

  6. #6
    OK, I managed a workaround to get this working. Instead of rolling them as d100s, I simply roll them as d10s and then multiply the results of any d10s in the registered result handler. This works fine for me, since these rolls never have both d100s and d10s to disambiguate in the same roll.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
PF2E Playlist

Log in

Log in