monorepo for various V Rising mods
- Core: essentially a shared library for mods to use. The existence of things in here must not cause side effects.
No chat commands, no patches altering behavior, etc. - Mods: contains projects for each mod.
- docs: web things for github pages
- templates: templates for
dotnet new
- Setup links to the bepinex libraries and game interops. See the vendor readme for more information.
- Restore with
dotnet restore
There's a powershell script to easily do this.
e.g. ./newmod NameOfMyMod
Preparation (only required once):
- cd to
templates - install the mod template.
dotnet new install VRisingMods.ModTemplate - cd back to the project root when done.
After preparation
- cd to
Mods - use the template. e.g.
dotnet new vrisingmod3 -n NameOfYourMod --description="Description of your mod" --use-vcf - add the mod's project file to the solution. e.g.
dotnet sln add "./Mods/NameOfYourMod/NameOfYourMod.csproj"
dotnet publish
Running dotnet publish can automatically copy built plugins to your local server.
Set the environment variable VRisingServerPath.
example value: E:\Games\SteamLibrary\steamapps\common\VRisingDedicatedServer
When a mod has some extra dependencies to be distributed alongside the usual plugin dll, they can be specified in the .csproj file for that mod.
e.g.
<Target Name="PrepareLibsForDist" AfterTargets="Publish">
<PropertyGroup>
<PublishPath>$(OutputPath)/publish</PublishPath>
<DistAdditionalLibs>$(PublishPath)/LiteDB.dll;</DistAdditionalLibs>
</PropertyGroup>
</Target>
If you want to deploy them to your local game server, you can use dotnet publish "/p:DeployLibsToo=TRUE".
This only really needs to be done after you've added a new dependency, and requires a restart of the server.
Building creates a thunderstore package for each mod at Mods/$(ModName)/dist/thunderstore.$(ModName).$(Version).zip
Additionally, the assemblies from all mods are copied to dist/modpack/ for convenience.