SubnauticaTwitchInteractionMod
A mod for Subnautica that allows Twitch Chat to interact with the game. Works either via direct connection to Twitch or using Crowd Control.
Dev Environment
Publicise dlls
in order to use this (if you're building the solution yourself), you'll be required to first publicise the following .dll files
- Assembly-CSharp
- Assembly-CSharp-firstpass
to do so you can use This but its very possible this just doesn't work for you in which case just ask someone for the resultant .dlls
Remaining dlls
you will need to also include
- 0Harmony
- QModInstaller
- UnityEngine.CoreModule
- UnityEngine.InputLegacyModule
Packaging
When packaging the mod, include the following files:
- TwitchInteraction.dll
- Config.txt.template
- mod.json
- SubCrowdControl.cs
- dependencies/
Where the dependencies folder contains all the referenced dlls that are not already included in Subnautica and QMod (TwitchLib.Unity, Microsoft.Bcl.AsyncInterfaces and the System dlls)
Usage
Twitch
You will need to generate tokens https://twitchtokengenerator.com/ with appropriate permissions. These can then be dumped in a Config.txt file in the qmod folder, an example of what that would look like is in Config.txt.template
Crowd Control
To run the mod with Crowd Control:
- Setup Crowd Control as per their Setup Guide
- Modify the Config.txt to include { "client": "crowdcontrol" }
- Select
Subnauticafrom theGame Selectionportion of Crowd Control and start the server - Run Subnautica. It should connect to the mod automatically.
If you start the server after starting Subnautica it should still connect properly as the mod retries every 30 seconds.
Testing
Use the Crowd Control SDK to test it which mimics the the local Crowd Control server.
- Open
Crowd Control EffectPack SDK - Click on
Load Pack Source - Select
SubCrowdControl.csat the root of this repository. This is also bundled as a part of the mod. - Select
Subnauticafrom the list - Click on
Connectat the bottom of the left hand side - Run Subnautica, and it should connect automatically
- Once it is running, you can use the Play button to create an effect (with an optional delay)