FG Spreadshirt Swag
  1. #1

    How to attach Information to a roll in Chat

    Hi,

    I want to attach information (a string) to the result of a roll when the roll action is started.
    To be more precise I want something which passes through the
    Code:
    ActionsManager.performAction
    command and can then be accessed in the dragobject when the result is dragged out of chat.

    Is it possible to attach widgets to the chat representation of the roll based on this information?

    I hope something likes this is possible.

    Best Regards

  2. #2
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    28,655

    FG Con 16 FG Online RPG Convention - Friday April 16th Sunday 18th, 2021.
    FG Con 17: October 15th 17th, 2021.

    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
    You mean Initiating an action?

    I don't see how this translates to my question. Could you be more precise?

  4. #4
    What that guide shows you is how the roll system is built and can be manipulated. You will have to understand this system first to be able to add the chat output you are looking to add. Once it's outputting to chat, then the output can be dragged from the chat and dropped. This however, then will lead down a whole other system. So what I am getting at is it's not a simple step by step answer to your question. Will require learning a bit more of how things work first.
    Dominic Morta
    Ruleset Developer
    Smiteworks

    How to provide an Unity Connection issue?-Connection Issues and What to Provide

    Unity Updater issue?-Updater Issues

    Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained

    Comcast or Cox ISP User?-Comcast XFinity and Cox Users

    Have a suggestion?-Idea Informer

  5. #5
    I have the rolls and the resulthandler working.

    Maybe it is not clear what I am asking.
    rolldrag.png
    The roll result in chat has the attached dragdata.
    I would like to add something e.g. in the custom entry or add a extra slot to this dragobject.
    And this something should be added to the rRoll which is given to ActionsManager.performAction (or be added in the resulthandler).
    So far I can get strings from the the rRoll which is passed to performAction throught to the resulthandler, but the dragdata from the chat message does not contain this information.

  6. #6
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    28,655
    The post I referenced has a link to the FG dragdata object: https://www.fantasygrounds.com/refdoc/dragdata.xcp

    Does the details on the dragdata object help?

    FG Con 16 FG Online RPG Convention - Friday April 16th Sunday 18th, 2021.
    FG Con 17: October 15th 17th, 2021.

    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!

  7. #7
    Also, the dragdata changes from the chat as a seperate object as well. Here is an example of an attack chat output and it's dragdata

    Capture.PNG
    Dominic Morta
    Ruleset Developer
    Smiteworks

    How to provide an Unity Connection issue?-Connection Issues and What to Provide

    Unity Updater issue?-Updater Issues

    Classic and Unity Port Forwarding?-Fantasy Grounds Connections Explained

    Comcast or Cox ISP User?-Comcast XFinity and Cox Users

    Have a suggestion?-Idea Informer

  8. #8
    Trenloe's Avatar
    Join Date
    May 2011
    Location
    Newcastle, UK (for a bit)
    Posts
    28,655
    Ah, sorry - I was misunderstanding what you were referring to.

    You can't really do what you're asking. You're pretty much limited to the description text, the dice values, the action type, and a few other things. Basically what was added to the message data structure before being sent to the chat window using Comm.deliverChatMessage.

    Details on the message data structure here: https://fantasygroundsunity.atlassia...996644567/Comm

    Which is limited. That's why FG actions tend to pass data using values in the description - standard practice to to enclose these in square bracks [ ... ]. You can see this in the example superteddy57 provides above - [ATTACK{M)] and [vs. KAC] - making the attack type and target AC type available if the attack roll is dragged from the chat window.

    I mention this in post #2 of the thread I linked to: "Note that the way modRoll gets which ability to use appears somewhat strange at first glance. It parses it out of the roll description using local sAbility = string.match(rRoll.sDesc, "%[ABILITY%] (%w+) check"); It isn't passed as a parameter in rRoll. This is pretty standard practice in FG rulesets - it allows data to be passed asynchronously and also allows the roll to keep it's data well after the roll has finished (so that the result can be drag/dropped from the chat window, for example). The data is usually identified by a keyword in square brackets [] - you've probably seen this a few times in FG roll results in the chat window."
    Last edited by Trenloe; January 20th, 2021 at 20:21.

    FG Con 16 FG Online RPG Convention - Friday April 16th Sunday 18th, 2021.
    FG Con 17: October 15th 17th, 2021.

    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!

  9. #9
    Ok thank you. Sorry for the confusion.

    Yes I am aware of the version where the information is embedded in the message text (which I wanted to avoid since it clutters the message).

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
  •  
Starfinder Playlist

Log in

Log in