An interactive API to allow for Twitch Chat to interact with your game
- Download the latest release for your game version
- Locate your Beat Saber install folder
- Extract the zip file to the install folder
Simple integration of ChatModifiers
internal class ExampleModifier
{
internal static ChatModifiers.API.CustomModifier Example = new ChatModifiers.API.CustomModifier(
"Example Modifier", // Name
"Does blah blah blah", // Description
"ExamplePlugin.Images.Icon.png", // Assembly path to the icon, will be used in the gameplay setup menu and the settings menu,
"example", // Command keyword, ChatModifiers will know to execute this modifiers function when the keyword is used
ExampleFunction, // Action linking the ExampleFunction below
new ChatModifiers.API.ArgumentInfo[] { // Arguments listed in this array will be positioned the same within the object[] args in the example function.
new ChatModifiers.API.ArgumentInfo("example", typeof(int)) // This ArgumentInfo will activate when any integer is typed after "!example". Any Type should work with this.
},
Areas.Game, // The area that the command will execute in. Areas are as such: None = 0, Menu = 1, Game = 2, Both = 3
new System.Collections.Generic.Dictionary<string, object> { { "TestKey", "TestValue" } } // The config, where the key is the name of the setting, and the value is the default value of the setting
)
private static void ExampleFunction(ChatModifiers.API.MessageInfo messageInfo, object[] args)
{
}
}
internal class Plugin
{
// Base code for Plugin.cs
[OnEnable]
public void OnEnable() => ChatModifiers.API.RegistrationManager.RegisterModifier(ExampleModifier.Example);
}To change your CustomModifier settings (You will need to cast it to whatever Type you are using, this may require extra work)
customModifier will just be your instance of CustomModifier
[UIValue("TestSettingValue")]
public string TestSettingValue
{
get
{
if (customModifier != null)
{
return customModifier.ModifierSettings.AdditionalSettings["KeyTest"].ToString();
}
return null;
}
set
{
if (customModifier != null)
{
customModifier.ModifierSettings.AdditionalSettings["KeyTest"] = (object)value;
customModifier.SaveSettings();
}
}
}There is an extra optional field for ViewController in order to show your settings within a list of other CustomModifiers, simply define the ViewController and it will appear within the settings menu for ChatModifiers, FlowCoordinators will be handled for you.
|
|
|
|



