RisingV.Scripting
0.1.2
dotnet add package RisingV.Scripting --version 0.1.2
NuGet\Install-Package RisingV.Scripting -Version 0.1.2
<PackageReference Include="RisingV.Scripting" Version="0.1.2" />
<PackageVersion Include="RisingV.Scripting" Version="0.1.2" />
<PackageReference Include="RisingV.Scripting" />
paket add RisingV.Scripting --version 0.1.2
#r "nuget: RisingV.Scripting, 0.1.2"
#addin nuget:?package=RisingV.Scripting&version=0.1.2
#tool nuget:?package=RisingV.Scripting&version=0.1.2
<a href="https://risingv.dev"><p align="center"><img src="https://github.com/RisingV-Mods/RisingV.Scripting/blob/main/assets/images/logo_rounded.png?raw=true" width="400" alt="RisingV.Scripting" /></p></a>
Hot-reloadable C# scripting for live mod prototyping for RisingV.
“RisingV.Scripting is a scripting mod for V Rising that allows you to write reloadable scripts in a sandboxed domain.
It only depends on RisingV.Shared so does not need to be run from a core plugin.”
Features
- Live reload – iterate on scripts without restarting the server
- Sandboxing – executes inside a limited AppDomain with whitelisted assemblies
- Diagnostics – real-time console & overlay logging for script errors
- Command execution – run C# code from the in-game chat commands using
.script run <code>
Note: This may not be the entire list—refer to the API docs for every class, interface, and extension method that RisingV.Scripting provides.
Installation
- Dependency – ensure RisingV.Shared is already installed.
- Download the latest release from Release
- Extract
RisingV.Scripting.<version>.zip
to your VRisingBepInEx
directory. - Restart your dedicated server or client.
- The server or client will install the required DLLs upon first run, and then ask you to restart again.
For development in your mod, install the following:
dotnet add package RisingV.Shared
dotnet add package RisingV.Scripting
Getting started
Add the
RisingV.Scripting
dependency to your plugin class to enable scripting support:// Added to your plugin class [BepInDependency("RisingV.Scripting")]
Add the
ScriptingEngine
to your plugin'sOnInitialize
method:public override void OnInitialize() { EngineManager.AddEngine<ScripingEngine>(); }
or, if you aren't using the
RisingPlugin
base class you can add the engine directly:[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)] [BepInDependency("RisingV.Scripting")] public class Plugin : BasePlugin { public override void Load() { Bootstrap.Load(p => { var engineManager = Bootstrap.SharedComponents.Get<EngineManager>(); engineManager!.AddEngine<ScriptingEngine>(p); }); } }
Creating a new script is as simple as creating a new C# file in the
BepInEx/config/<YOURMOD_GUID>/Scripts
directory.using RisingV.Scripting.Managers; using RisingV.Scripting.RuntimeHost; using RisingV.Shared.Logging; using RisingV.Shared.Managers; using RisingV.Shared.Plugins; // Optional (namespace should match the plugin namespace or remove this line) namespace RisingV.Scripting.Tests; /// <summary> /// Sample script for testing purposes to demonstrate how it can be used. /// </summary> /// <param name="context">The script context containing the script data.</param> public class SampleScript(IScriptContext<ScriptData> context) : Script(context), IReloadableScript { public override void Initialize(ScriptManager manager, List<IPlugin> plugins) { Log.Info("SampleScript initialized."); // Called then the plugin is initializing, before any scripts are loaded. } public override void Load(ScriptManager manager, List<IPlugin> plugins) { Log.Info("SampleScript loaded."); // Called when the Shared Components are loading, after the plugin is initialized. } public override void Unload(ScriptManager manager, List<IPlugin> plugins) { Log.Info("SampleScript unloaded."); // Called when the Shared Components are unloading and before the plugin is terminated or reloading. } public override void Terminate(ScriptManager manager, List<IPlugin> plugins) { Log.Info("SampleScript terminated."); // Called when the plugin is being terminated, after all scripts are unloaded. } public override void Reload(ScriptManager manager, List<IPlugin> plugins, ReloadReason reason) { Log.Info("SampleScript reloaded. Reason: " + reason); // Called when the script is being reloaded, e.g. due to a change in the script file. } }
The script will be automatically compiled and loaded by the Scripting Engine. Make sure the script is marked with IReloadableScript
interface to enable hot-reloading.
Configurations
RisingV.Scripting uses the RisingV.Shared.Config
base class for configuration management. This allows you to define your plugin's configuration in a type-safe manner, with support for hot-reloading and easy access to configuration values.
BepInEx/configs
└── RisingV.Scripting
└── Engines
└── ScriptingEngine.cfg
Documentation
For a deeper dive, API reference, and design docs see https://docs.risingv.dev/scripting.
Contributing
PRs that add new functionality—or improve existing ones—are warmly welcomed. Please open an issue first if you plan a large refactor. See CONTRIBUTING.md for more information.
Community
<p>Join the V Rising Mod Community Discord for modding support, updates, and discussions!</p>
License
GNU GPL-3.0. See LICENSE for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- BepInEx.PluginInfoProps (>= 2.1.0)
- Microsoft.CodeAnalysis.Common (>= 4.14.0)
- Microsoft.CodeAnalysis.CSharp (>= 4.14.0)
- Microsoft.CodeAnalysis.CSharp.Scripting (>= 4.14.0)
- RisingV.Shared (>= 0.1.2)
- System.Collections.Immutable (>= 9.0.0)
- System.Reflection.Metadata (>= 9.0.0)
- VRising.Unhollowed.Client (>= 1.1.9.9219901)
- VRising.VampireCommandFramework (>= 0.10.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.