View Full Version : Internal links / URL scheme
jaharmi
January 27th, 2024, 15:06
Is there any sort of internal links / URL scheme available in Fantasy Grounds? (If not, yes, I can submit an idea in the ideas site. I’m asking what exists before I take that step, since I haven’t found anything yet.)
I’m thinking of something like the following, which would allow for a local URL link on a device to open up to specific areas within Fantasy Grounds, its UI, and its GM/user content.
fg://x/y/z
I don’t know how the x, y, and z would be structured. I’m thinking it would be structured so common elements are always available, no matter what ruleset or contents/module is in use. This would be excellent for local automation, in much the same way that local automation on the iPhone was spurred by the “x-callback-url” trend. It would also be useful for actually launching FG, or activating the FG window, compared to methods like virtually pressing keys to “click” Hotbar hotkeys / keyboard combinations.
Zacchaeus
January 27th, 2024, 15:39
Not exactly sure what you are after but you can't open bits of FG; you can only open all of it or none of it.
You can set links within FG to open something else; like a sound file or a pdf or web browser but I don't think that's what you are after.
LordEntrails
January 29th, 2024, 00:51
Nothing I know of or have heard of.
Withing FG there is a reference scheme for internal links (i.e. links to stories entries, classes, items, etc) but that's not going to help.
Due to IP and licensing, I would be surprised if such was made available. It seems like it would be an easy way to scrape content with a bot. But you should probably clarify your use case so the devs can consider it. They are much more informed than I am :)
jaharmi
January 29th, 2024, 02:43
I don’t know if this kind of thing is as common on other platforms as it is on macOS and iOS — especially earlier iOS. I’m not thinking primarily of connecting a custom URL scheme to published content / adventures, but to parts of FG itself.
The links I’m talking about are basically:
- Custom app URL scheme (“fg://“) that launches/opens Fantasy Grounds.
- The rest of the URL after that is passed to Fantasy Grounds. Since Fantasy Grounds already has some form of internal links — which we can use by dragging shields / etc. to the Hotbar — this URL content could serve as either an API (of sorts) or to match a URL to an existing internal FG link.
The closest analogy that a lot of people may be familiar with would probably be internal browser URLs, like “chrome://whats-new” or “chrome://about” or “chrome://history”. (The “chrome://“ scheme does not seem to be registered with macOS.)
On macOS and iOS, it is somewhat common for some apps to expose those custom URL schemes (https://developer.apple.com/documentation/xcode/defining-a-custom-url-scheme-for-your-app) to expose "a way to reference resources inside your app.” Many system and regular apps on macOS offer custom URL schemes; you can use URLs to launch (and take actions in / navigate to resources in) in apps as diverse System Settings, 1Password, Clock, Microsoft Edge, and GitHub Desktop. This is also referred to as deep linking, which is supported by Unity on some platforms (https://docs.unity3d.com/2020.3/Documentation/Manual/enabling-deep-linking.html).
Historically, the x-callback-url specification (https://x-callback-url.com) also provided a means of inter-application communication on iOS.
What I’m thinking of is connecting a custom FG URL scheme (i.e. available externally to the OS and other apps) to what FG already seems to do internally.
- fg:// - just launch the app
- fg://hotbar/1/1 - launch the app, act as if the first button in the default Hotbar had been clicked
- fg://tool/combat - open (or maybe toggle closed) the Combat Tracker
- fg://tool/combat?state=open - open the Combat Tracker
- fg://host/campaign?id=EC41633E-F9C6-46F6-BFC1-1C34AA8A4D23 - launch the app and host the campaign with some identifier (just made this up)
- fg://connect/campaign?id=EC41633E-F9C6-46F6-BFC1-1C34AA8A4D23 - launch the app and connect to the specified campaign
- fg://chat/dm?text=You%20are%20standing%20in%20an%20open%20fi eld%20west%20of%20a%20white%20house%2C%20with%20a% 20boarded%20front%20door.&source=gm - Send text to the Chat window
Note that this doesn’t take into account how FG, when launched, needs to host or connect to a campaign. I’m just trying to give some more concrete examples. These and other ideas could be very helpful for automation, setting up a game session, etc.
With internal linking already available, the change would be to provide the external custom URL scheme, and tie that with the existing internal links. Over time, perhaps that can expand to new kinds of functionality. Even a few basic options would start to be beneficial, such as when using a Stream Deck or other automation software that can open URLs.
Moon Wizard
January 30th, 2024, 02:37
You can do this today with extensions. We use this to handle sound links (soundplay, soundstop, soundstopall). Look at the SoundManager script in CoreRPG for example.
Basically, every link in FG is defined by two strings (display window class and record path). If you intercept special link "classes", you can parse the second string path however you like.
Regards,
JPG
Powered by vBulletin® Version 4.2.1 Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.