5E Character Create Playlist
  1. #1

    Roll functionality in FGU

    Hi all,
    in the ruleset I'm working on I make extensive use of the native "roll" functionality of FGU in my lua scripts. It works very well, but there is a "cosmetic" thing I would like to get rid of. When I do a "roll", it always shows the rolls syntax as a header (4D6+2g6)d2 in this case). Is there a way/switch to suppress this syntax in a roll initiated by a UI element?

    Example.jpg
    Last edited by Mephisto; August 28th, 2021 at 12:12.

  2. #2
    No, there is no way to suppress the expression.

    Regards,
    JPG

  3. #3
    Quote Originally Posted by Mephisto View Post
    Hi all,
    in the ruleset I'm working on I make extensive use of the native "roll" functionality of FGU in my lua scripts. It works very well, but there is a "cosmetic" thing I would like to get rid of. When I do a "roll", it always shows the rolls syntax as a header (4D6+2g6)d2 in this case). Is there a way/switch to suppress this syntax in a roll initiated by a UI element?

    Example.jpg
    You can accomplish this if you override Comm.deliverChatMessage. You must call the old Comm.deliverChatMessage after you process it as follows. The dice role assigned to a number field double-click will ultimately call this function to deliver the dice results. If you set the "expr" field received to this function to something invalid such as a space character (" ") then the text above the dice will disappear. See the picture below for the ChatMessage arguments on dice roll and the results when the expr field in those arguments is set to " ".

    Let me know if you want me to add this to the insta-dice extension.

    instadice.PNG

  4. #4
    Hmm, thanks for pointing that out. I wasn’t aware that ripping out the expr would work that easily for that without causing issues; but I haven’t thought of trying that or had a reason to try.

    Regards,
    JPG

  5. #5
    Thank you so much, jharp! That is amazingly simple!

    I will code it to much ruleset but I think it would also be a nice addition to the insta-dice extension.

    Just to be clear for anyone trying to do the same, make sure to use rMessage.dice.expr = " " and not rMessage.expr. The expr "hides" inside the dice table.
    Last edited by Mephisto; August 28th, 2021 at 22:08.

  6. #6
    Mmm, while it works fine on the GM side, it doesn't seem to work from the client side. If I suppress the expression, only the description of the roll shows up, but no dice or result.
    Last edited by Mephisto; August 28th, 2021 at 22:13.

  7. #7
    Hmmm. Ok I'll see if I can find something that will make it work.

  8. #8
    Quote Originally Posted by Mephisto View Post
    Mmm, while it works fine on the GM side, it doesn't seem to work from the client side. If I suppress the expression, only the description of the roll shows up, but no dice or result.
    Ok. I have managed to get it to work on the player side but it is not without some concerns. The display of the dice in the manner that you wish seems somehow connected to the secret field. If the GM does a non-secret roll it will fail to work even for the GM.

    However, if you capture the deliver you can alter the expr field as previously discussed and then call the addChatMessage instead for the client. This will work as desired for both the player and the GM. I think with some intelligent programming on both sides you can likely have each node use addChatMessage and deliver an OOB message to the other people to have that kick off. Sort of a replacement for deliver.

    I'm certain a solution exists with this but it will need more testing for certain.

    Jason

Thread Information

Users Browsing this Thread

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
STAR TREK 2d20

Log in

Log in