| 语言 | Language | 链接/Link |
|---|---|---|
| 中文 | Chinese | 中文自述 |
| English | English | English README |
A lightweight plugin loading system for SCP: Secret Laboratory (SCP SL) in Chinese.
Download "FMOD.zip" and extract it to %appdata% (using Windows as an example).
After extraction, copy the "FMOD" and "SCP Secret Laboratory" folders to %appdata%.
Restart your server.
If "Welcome to FMOD" is displayed, the installation was successful.
The built-in command is fmod.
Subcommands:
list— View loaded plugins.version— Check the FMOD version.reload— Hot-reload the framework and plugins.
一个SCP SL的中文轻量级别的插件加载系统
下载"FMOD.zip"然后复制到%appdata%里(以Windows为例)
(如果无法在github上下载东西或下载太慢的大陆小伙伴,可以访问123Pan下载)
解压然后将里面的"FMOD","SCP Secret Laboratory"文件夹复制到%appdata%里
重启服务器
显示"欢迎使用FMOD"表示安装成功
内置了一个命令"fmod"
子命令:
list --查看已加载的插件
version --查看fmod版本
reload --热重启框架和插件
| 语言 | Language | 链接 |
|---|---|---|
| 中文 | Chinese | 中文教程 |
| English | English | English Tutorial |
由于尚未配置NuGet包,需要手动引用以下DLL文件:
FMOD.dll- 其他相关依赖项
public class Config
{
// IsEnabled属性会自动生成,无需手动声明
public string Hello { get; set; } = "Hello World";
}using FMOD.Plugins;
public class Plugin : Plugin
{
public override string Author => "开发者名称";
public override Version Version => new Version(1, 0);
public override string Name => "插件名称";
public override string Description => "插件功能描述";
public override Type ConfigType => typeof(Config);
public override void OnDisabled()
{
// 在此处注销事件和释放资源
}
public override void OnEnabled()
{
// 插件启用时的初始化代码
Log.Debug("插件启动成功!");
// 获取配置文件实例
var config = GetConfig<Config>();
// 输出调试信息
Log.Debug($"{config.Hello}");
// 输出自定义颜色的信息
Log.CustomInfo($"{config.Hello}", Color.red);
}
}- 按
F6编译项目生成DLL文件 - 将生成的插件文件放置在:
%appdata%/FMOD/Plugins/(服务器端口号)/目录下 - 重启服务器或执行命令
fmod reload进行热重载
Since NuGet packages are not yet configured, you need to manually reference the following DLL files:
FMOD.dll- Other related dependencies
public class Config
{
// The IsEnabled property is automatically generated, no need to declare it manually
public string Hello { get; set; } = "Hello World";
}using FMOD.Plugins;
public class Plugin : Plugin
{
public override string Author => "Developer Name";
public override Version Version => new Version(1, 0);
public override string Name => "Plugin Name";
public override string Description => "Plugin description";
public override Type ConfigType => typeof(Config);
public override void OnDisabled()
{
// Unregister events and release resources here
}
public override void OnEnabled()
{
// Initialization code when plugin is enabled
Log.Debug("Plugin started successfully!");
// Get configuration instance
var config = GetConfig<Config>();
// Output debug information
Log.Debug($"{config.Hello}");
// Output custom colored message
Log.CustomInfo($"{config.Hello}", Color.red);
}
}- Press
F6to compile the project and generate DLL files - Place the generated plugin files in:
%appdata%/FMOD/Plugins/(server-port-number)/directory - Restart the server or execute the command
fmod reloadfor hot reloading
- Ensure all required DLL references are properly added to your project
- Test plugins in a development environment before deploying to production
- Use
Log.Debug()for debugging purposes andLog.CustomInfo()for colored output - The configuration system automatically handles enabling/disabling of plugins