PDA

View Full Version : Can extensions send data OUT of FG?



JimSocks
November 22nd, 2021, 00:54
I am an avid woodworker, and I want to make a gaming table to rule them all. I am using CNC to rout out cavities under the tabletop, for lights that shine through to the topside of the wood when lit, but are otherwise invisible.

One of these I want to be a big alert that says basically "GET READY, YOUR TURN IS NEXT!"

To do that, I would need to write an extension that looks in the CT for who's turn comes after the current turn, and if they are a PC send a string OUT of FG that I can pick up in another program I write for this purpose. The other program would receive the message and determine which seat that player has been assigned (by me, in the program's settings), then light up the lights appropriately.

Before I start down this road, I always like to do a quick sanity check with the pros here- is this possible?

LordEntrails
November 22nd, 2021, 01:57
Yes. I don't know how, but I know the various Syrinscape and sound extensions send data out of FG. Or at least watch the log file and scrape it for actions. Not sure chat log scraping would work for your use case. But maybe dig into those extensions and see how they work?

Moon Wizard
November 22nd, 2021, 02:38
Those extensions call URLs. You can probably write an extension to send specific URLs with a unique protocol/scheme and parameters based on your combat tracker to table mapping; and then have an external program intercept the unique URL protocol to map to hardware.

Regards,
JPG

jharp
November 22nd, 2021, 03:01
How do you call a URL from FG?

Moon Wizard
November 22nd, 2021, 03:04
You can call Interface.openWindow("url", "<URL>");

JPG

jharp
November 22nd, 2021, 03:06
Learn something new everyday.

Jason

jharp
November 22nd, 2021, 04:19
Moon can you check your direct messages. Thx

JimSocks
November 22nd, 2021, 12:42
Those extensions call URLs. You can probably write an extension to send specific URLs with a unique protocol/scheme and parameters based on your combat tracker to table mapping; and then have an external program intercept the unique URL protocol to map to hardware.

Regards,
JPG

This is wonderful news, thanks Moon. This method should absolutely work for my needs!

I figure, I’ll write an extension that features a GUI window depicting my table, with circular holes on the picture at each seat for tokens. Maybe I can drag the tokens for each PC from the combat tracker, into the “seat holes” to assign that character to a seat. The extension will send URL strings out with “seat1turn” and “seat2next” for instance, and my external program will interpret those and send out signals to the hardware lights at the given seats.

...I better make more than one hole per seat, for when PCs control more than one character

Quick question for the group: does anyone know if URLs are how the Syrinscape extension works when it’s NOT using the online player? Syrinscape has a desktop app too, and I wonder if that program is intercepting the URLs also or getting the data some other neat way? I suppose I will open the hood of that extension and find out!

LordEntrails
November 22nd, 2021, 16:47
I hope you post videos of your table and this function when you are done :)