1. #1

    Dice results display.

    Hello,

    I am trying to set up a custom dice display in the chat. I have included my custom icons, and used the Mutant extension as my base to write the code. The problem I'm having is, when I roll a d6, whenever I roll a 3 or 4, I want it to show a blank dice with no number. All other rolls, I have set up custom icons.

    I went ahead and installed all 6 icons, two blanks for the 3 and 4. When I roll a 1, 2, 5, and 6 roll and display the custom icons. When a 3 or 4 are rolled, it displays the icon with the standard number on it. I know that comm.deliverChatMessage(rMessage); Is taking the value from dice.result, and displaying that in the chat box on top of the icon. How do I turn that off? I tried putting an if statement in that said if 3 or 4 are rolled, dice.result = 0, but that shows a zero. when I set dice.result to either " " or nil, hoping that would do it, the result is a -1 on the dice face. What can I do to not have the image show up without the number superimposed on it?
    Add me on Twitch: twitch.tv/statik367

    If you like what I am doing, you can support me via PayPal: paypal.me/wesleytoma
    Or Venmo: venmo.com/Wesley-Toma-Lee

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    24,524
    The issue is that FG uses a font with a hard coded name - dieresult to display the number rolled on top of the die result graphic. So, to stop the number appearing, you need to use a dieresult font that has no numbers in it. The problem then, is that all rolls don't show the numbers - as you can't change the dieresult font for each die type - it's for all dice.

    For the Star Wars: Edge of the Empire ruleset the dieresult font has the numbers removed and the code has all of the dice icons for the "normal" number dice used with the result embedded in the graphics. Thus, when a d20 is rolled, for example, and a 6 is returned - the d20.6 graphics is used which has the outline of the dice and the number 6 within the graphic.

    It's a lot of custom work just to do this, but I believe this is the only way if you *really* want to remove the number from your custom dice. Have a look at the Star Wars: Edge of the Empire ruleset.
    FG Con 16 Fantasy Grounds Online RPG Convention - Friday April 24th to Sunday April 26th, 2020
    Register at www.fg-con.com for all the latest info.

    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  3. #3
    I looked at SW, and I saw what I thought was what it did. I thought it used the convertDiceToString() function, but it doesn't seem to be calling that. I can't seem to figure out how the code changes the icon from, basically d20 to d20.1 for example. Can you point me to the right place to look to find the code?
    Add me on Twitch: twitch.tv/statik367

    If you like what I am doing, you can support me via PayPal: paypal.me/wesleytoma
    Or Venmo: venmo.com/Wesley-Toma-Lee

  4. #4
    After doing some deep diving, I found out that I wasn't even in the correct file. I found the chat manager file, and copied over the relevant functions. The issue I have now is how do I get the dice to call the processDice function?

    I copied over the special_msgtype_dice variable, and the important lines in the onInit file.
    Add me on Twitch: twitch.tv/statik367

    If you like what I am doing, you can support me via PayPal: paypal.me/wesleytoma
    Or Venmo: venmo.com/Wesley-Toma-Lee

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    24,524
    I’m confused as to which stage you’re at and what the exact issue is.

    Have you migrated over a dieresult font that has no numbers in it?

    Do you have the dice icons showing the correct numbers in the graphics? Have you assigned those in XML to .1, .2, .3 etc.?

    What is the exact thing you’re trying to do at this point?
    FG Con 16 Fantasy Grounds Online RPG Convention - Friday April 24th to Sunday April 26th, 2020
    Register at www.fg-con.com for all the latest info.

    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

  6. #6
    I'm sorry. It's amazing what a nights rest can do.

    I figured it out. the piece I was missing was I was creating the dice handler, but I was not calling it when I threw the dice. I figured it out, and no it works perfectly.

    Thank you for being the sounding board for me to get this working.
    Add me on Twitch: twitch.tv/statik367

    If you like what I am doing, you can support me via PayPal: paypal.me/wesleytoma
    Or Venmo: venmo.com/Wesley-Toma-Lee

  7. #7
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    24,524
    Cool. Glad you got it working. :-)
    FG Con 16 Fantasy Grounds Online RPG Convention - Friday April 24th to Sunday April 26th, 2020
    Register at www.fg-con.com for all the latest info.

    Private Messages: My inbox is forever filling up with PMs. Please don't send me PMs unless they are actually private/personal messages. General FG questions should be asked in the forums - don't be afraid, the FG community don't bite and you're giving everyone the chance to respond and learn!

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
  •  

Log in

Log in