-
January 20th, 2021, 16:06 #1
- Join Date
- Sep 2018
- Posts
- 75
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 theCode:ActionsManager.performAction
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
-
January 20th, 2021, 17:12 #2
See post #3 here: https://www.fantasygrounds.com/forum...ns)-in-CoreRPG
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!
-
January 20th, 2021, 17:31 #3
- Join Date
- Sep 2018
- Posts
- 75
You mean Initiating an action?
I don't see how this translates to my question. Could you be more precise?
-
January 20th, 2021, 17:36 #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 zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it
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?-Feature Request
-
January 20th, 2021, 18:07 #5
- Join Date
- Sep 2018
- Posts
- 75
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.
-
January 20th, 2021, 19:00 #6
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?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!
-
January 20th, 2021, 19:05 #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.PNGDominic Morta
Ruleset Developer
Smiteworks
How to zip up your campaign if the Developers ask for it-How to zip up your campaign if the Developers ask for it
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?-Feature Request
-
January 20th, 2021, 19:19 #8
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 19:21.
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!
-
January 21st, 2021, 10:24 #9
- Join Date
- Sep 2018
- Posts
- 75
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)
Bookmarks