FG Spreadshirt Swag

Thread: Chat output

  1. #1
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    253

    Chat output

    Is it possible to have output in the chat so that it is more elaborate?

    For example if I roll initiative in D&D I get this. I can make the writing more detailed, but it remains
    a text message and I would like to be able to have a more graphically controlled output instead
    Immagine.png
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    The format of the chat message structure is documented in the Comm package in the Wiki here: https://fantasygroundsunity.atlassia...996644567/Comm

    The most you can do is change the icon, change the font/colour for the whole text, add links and assign a frame (edge/background graphics).

    To change the frame you need to use the "mode" which needs to be defined in the XML - <chatsettings> in CoreRPG gameelements.xml. A good example of using custom frames is damned's "Sharing is Caring" extension: https://forge.fantasygrounds.com/shop/items/549/view
    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
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    253
    Ty, as usual.

    As far as I can see, it's a free extension, but the code isn't public, right?
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

  4. #4
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    Quote Originally Posted by Xarxus View Post
    As far as I can see, it's a free extension, but the code isn't public, right?
    Correct. I more included it for the screenshots as an example that can be done.

    Everything you should need is in my first post.
    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!

  5. #5
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Colorado, USA
    Posts
    33,404
    Also, there's a "Forum thread" link in the Forge page. Follow that link and the first post of the thread has an example for FGC - whereas it's for FGC, a lot of the code can be used as an example, but make sure you check CoreRPG code for the latest implementations.
    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
    Xarxus's Avatar
    Join Date
    Mar 2019
    Location
    Rome (Italy)
    Posts
    253
    Ty Trenloe


    I went ahead with my tests on how to format the chat output and built a simple function to display the results of the dice with colors.
    Here is the function.
    Code:
    function onButtonPress()	
    	local rMessage = { sender = "GM", text = "Final result", secret = false, font = "systemfont", diemodifier = 0, 
    		dice = { 
    			{ result = 10, type = "r10" },
    			{ result = 10, type = "r10" },
    			{ result = 4,  type = "d10" },
    			{ result = 10, type = "r10" },
    		}
    	}
    
    	Comm.deliverChatMessage(rMessage);
    end
    This is the 4d10 output Immagine_d10.png

    As you can see I entered 2 red results first, then a normal one, and finally a red result again.

    Something is wrong with the writing above the dice, it doesn't group by dice type.
    I think I need to sort the table, right?
    There is a way to customize that writing. For example putting 4d10, regardless of color?

    I then decided to make a new test by changing the type of die to 100.
    Also in this case the order is not correct and I think I have to sort the table, but the upper writing is worse than the p
    revious one. It seems to me there is a bug. Am I wrong?

    This is the 4d100 output Immagine_d100.png
    FGU ULTIMATE License
    Click here for RPG Music or here for Dwarves songs on Spotify

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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
  •  
DICE PACKS BUNDLE

Log in

Log in