Skip to content

WWYDF/TalkState

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TalkState

Sends active talking state to Memory. Supposed to be used in junction with the Positional Audio Mod for GTFO.

⚠️ Linux and MacOS support is unknown! ⚠️

Installation Guide

Configure OpenPA

  1. Make sure you have my Positional Audio Mod for GTFO installed in r2modman.
  2. Run the game modded once, then close it.
  3. Open r2modman, and go to the Config Editor.
  4. Click on BepInEx\config\net.devante.gtfo.positionalaudio.cfg, then Edit Config.
  5. Change Enabled to true.

Configure Mumble

  1. Download the latest .dll on the Releases page.
  2. Open Mumble and open Settings.
  3. Click on the Plugins tab.
  4. Click Install plugin...
  5. Select the downloaded .dll.
  6. Click Yes.
  7. Scroll down, and check the box next to TalkState to Enabled, with KeyEvents as well.
  8. Click Apply, then OK.
  9. Connect to a Server, and launch your game.

As long as the plugin is loaded, it will be sending your voice state to memory. Twice each time you speak; once for talking, once for not talking.


Integrating with a different mod

If you would like to use this to send talking data to your own mod, you certainly can.

It uses a Memory Linked File @ %temp%\posaudio_mumlink to store a string of the current state. My mod uses the following code to pull the data from the Memory Linked File to the BepInEx Plugin in C#.

static void ReadMemoryMappedFile()
{
    var character = Player.PlayerManager.GetLocalPlayerAgent();
    const string memoryMappedFileName = "posaudio_mumlink";
    const int dataSize = 1024;
    Console.WriteLine($"Initiated RMMF!");

    while (true)
    {
        using (var mmf = MemoryMappedFile.OpenExisting(memoryMappedFileName))
        {
            using (var accessor = mmf.CreateViewAccessor(0, dataSize))
            {
                byte[] dataBytes = new byte[dataSize];
                accessor.ReadArray(0, dataBytes, 0, dataSize);

                string receivedData = Encoding.UTF8.GetString(dataBytes).TrimEnd('\0');
                // Console.WriteLine($"Received Data: {receivedData}");

                if (receivedData == "Talking")
                {
			// do stuff;
                }
            }
        }
        Thread.Sleep(90); // Sleep for 90 milliseconds.
		// Adjust update frequency if CPU performance is bad.
    }
}

I would 100% change the way this updates. GTFO is stinky and requires you to update the values faster than the game in order for it to work, so you shouldn't have to take such an aggressive approach like I did.


Known Issues


About

Sends active talking state to Memory. Supposed to be used in junction with the Positional Audio Mod for GTFO.

Resources

Stars

Watchers

Forks

Packages

No packages published