ModAPI Hub keyboard_arrow_right Mods keyboard_arrow_right ModAPI Twitch Chat Integration Core

ModAPI Twitch Chat Integration Core

Hazard
Subscribe to this mod
Like
ModAPI Twitch Integration Core allows you to connect to a twitch chat of your choosing, and listen to commands that will cause various effects in your game.
v1.1 allows disabling of commands

Open a panel with this key combination: CTRL + SHIFT + F8
Some games dont support modapi hotkeys, so it had to be done like this


In order to use this mod, you will need to configure a save file.
Launch the game once with this mod to create it, and the file will be created inside The Forest instalation folder/Mods/Hazard's Mods/
What to input where is written inside the config file, but here is a website describing it, and heres config file explaination anyways:

Line 1: Port, default 6667, no need to change
Line 2: Host/Adress, default irc.chat.twitch.tv, no need to change either
Line 3: Password/Token. example oauth:089218392jhzihszcxbzkjdhq2. Token can be generated here
Line 4: Username - your twitch username all lowercase, in my case it's hazardusx (i may stream once when i have better internet ;) )
Line 5: Command prefix, default !, its a prefix on every message that an user will have to use in order to proc a command
Line 6: Channel - same as your username, but with # in front (e.x. #hazardusx)

Thats it. Once you did that, you can press connect in the panel in game(CTRL + SHITFT + F8). Once you hop in game, check a box in the panel so all messages are being read and commands executed. Can be disabled at any time.


Nerd area, also known as How to create your own commands

1. Download and run a game with this mod
2. Create a modapi project, open it in Visual Studio
3. Add a reference to ModAPITwitchIntegration.dll, its inside The Forest\TheForest_Data\Managed\
4. Create a class, and in it a static method with [ModAPI.Attributes.ExecuteOnGameStart] attribute
5. Inside the method, use ModAPITwitchIntegration.TwitchMod.Register method. Make sure the key is all lowercase
Example:
Code:
public static classTwitchEvents { [ModAPI.Attributes.ExecuteOnGameStart] public static void Init() { TwitchMod.Register("burn", (s) => LocalPlayer.Stats.Burn()); TwitchMod.Register("hunger", (s) => LocalPlayer.Stats.Fullness = 0); TwitchMod.Register("thirst", (s) => LocalPlayer.Stats.Thirst = 1); TwitchMod.Register("heal", (s) => LocalPlayer.Stats.Health += 100); TwitchMod.Register("getsick", (s) => LocalPlayer.Stats.BloodInfection.GetInfected()); TwitchMod.Register("getcured", (s) => LocalPlayer.Stats.BloodInfection.Cure()); TwitchMod.Register("discharge", (s) => LocalPlayer.Stats.Energy = 0); TwitchMod.Register("regenenergy", (s) => LocalPlayer.Stats.Energy += 100); } }

File ModAPITwitchIntegration-1.3-44a1e7ecf2c6edcdf1a5aae823b2acee.mod
Compatible 1.11b
Version 1.3

videogame_asset The Forest label Bugfixes
  • Version 1.3 (1.11b) 06. Nov 2019
    8.75 kB
    129,794 downloads

Download

Downloading ModAPI...

1 Your download is ready!

Extract the .zip file to
C:/Program Files (x86)/
Or choose another location. Do not extract it inside the Steam game folder.

2 Start ModAPI.exe

3 Enable mods

4 Start the game

You can launch your game regularly through Steam without ModAPI after the first launch.

FAQ