-
January 27th, 2023, 18:24 #1
- Join Date
- Jan 2020
- Posts
- 3
Create a link for recordname and send it via Comm package
Hey everyone,
I am trying to create a message via the Comm package (https://fantasygroundsunity.atlassia...996644567/Comm) that is supposed to have a link to a record from a module.
I am aware that I could drag an item/object inside Fantasy Grounds into the chat box for everyone or on a character portrait to share it individually.
However I specifically want to include the link in a message.
It can be assumed that I am the GM and that I own and have shared the module/data in question.
Up to this point I am able to send messages with the Comm package successfully. When trying to send a link it ends up as a string in the chat box but not as a link to the data.
When scrolling through modules and their xml files the most promising entry I have found yet would be:
Code:<link class="template" recordname="reference.data.nameOrID@moduleName" public="true"> <b>Type of Template: </b>Full Written Name of Module</link>
-
January 27th, 2023, 18:48 #2
Sorry, this is super quick as I'm short on time.
The comm message structure has a "shortcuts" LUA table. Here's some code I have in development for the PFRPG2 ruleset:
Code:local msg = ChatManager.createBaseMessage(ActorManager.resolveActor(nodePower.getChild("......."))); msg.text = "Activity used = " .. sactivitySymbolText .. " " .. getDescription(); msg.font = "reference-r"; -- Add a shortcut to the activity in chat. msg.shortcuts = {}; table.insert(msg.shortcuts, { description = "", class = "reference_activity", recordname = nodePower.getPath() }); -- Make the node public so that non-owning players can click the shortcut in chat. if Session.IsHost then DB.setPublic(nodePower, true); else PCActivitiesManager.notifySetActivityPublic(nodePower); end Comm.deliverChatMessage(msg);
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 27th, 2023, 22:35 #3
- Join Date
- Jan 2020
- Posts
- 3
Hey Trenloe,
perfect answer and remarkable flawless for being short on time!
It literally was exactly what I needed!
Thank you so much!
MOD: Thread moved to WorkshopLast edited by LordEntrails; January 27th, 2023 at 22:42.
-
January 27th, 2023, 23:32 #4Private 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 30th, 2023, 17:03 #5
Could such a link be used to automate a roll, like a parry or evasion to an attack?
-
January 30th, 2023, 18:00 #6
The link opens a window with a specific FG windowclass and a FG database record. In theory you could put code in a custom windowclass to carry out a FG action and then close the window. But this would have to be done in an extension, it's not like a drag/drop action in the hotkey bar.
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)
Bookmarks