NPBruce / valkyrie

Valkyrie GM for Fantasy Flight Board Games
Apache License 2.0
504 stars 105 forks source link

Interest/viability of a TableTop simulator Hook? #1445

Open PolyphonyRequiem opened 3 years ago

PolyphonyRequiem commented 3 years ago

Description of Problem or Question

To the Valkyrie devs. I've only started skimming the codebase. Would it be possible for Valkyrie to emit events when things occur that could be then transformed into TCP messages sent to TTS over the editor API and interpreted by a TTS-mod-side handler? I could implement all of the TTS stuff without too much difficulty, and I'm happy to implement the editor API server for .NET (since I've already done it in Node and far more familiar with C# and F# than TypeScript anyhow.)

I guess my biggest question is, is hooking events like tile reveal, game text display, token placement, even puzzle steps 'hookable' in a way that we could emit events?

Is the reverse viable? (external automation steps?) I'm less interested in this scenario for many reasons.

NPBruce commented 3 years ago

There is no reason this couldn't be done, but I'm not sure that it is a priority. You are welcome to have a look and see if you can do it, Valkyrie is all C#.

PolyphonyRequiem commented 3 years ago

Honestly, if you can point me to one location I hook something, say mythos event text for example?

NPBruce commented 3 years ago

This: https://github.com/NPBruce/valkyrie/blob/63d07f717ba38c212d7208f01b895be5a878c01b/unity/Assets/Scripts/Quest/RoundControllerMoM.cs#L12

Will give you the start of Mythos, but that will happen regardless of if any Mythos events are present. If you only care when there is an event you probably want to do it here:

https://github.com/NPBruce/valkyrie/blob/63d07f717ba38c212d7208f01b895be5a878c01b/unity/Assets/Scripts/Quest/DialogWindow.cs#L20

And check for Game.Get().quest.phase == Quest.MoMPhase.mythos

..and this would trigger multiple times if there is more than one dialog.... so it really depends what you are trying to do.

Maybe just sneding Game.Get().quest.phase on changes is a good start?

PolyphonyRequiem commented 3 years ago

Absolutely. As long as I can get TTS echo working we have a viable hook.