adainrivers-GT_VRising_GameData icon

GT VRising GameData

Game data framework and general utilities for V Rising mods.

Last updated 2 years ago
Total downloads 255
Total rating 0 
Categories Client Server Mods
Dependency string adainrivers-GT_VRising_GameData-0.2.4
Dependants 2 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack_V_Rising-1.0.0 icon
BepInEx-BepInExPack_V_Rising

BepInEx pack for V Rising. Preconfigured and includes Unity Base DLLs.

Preferred version: 1.0.0

README

Still WIP, use it at your own risk.

VRising Game Data Library

See V Rising Database for detailed information about V Rising items, NPCs and more.

Installation

Install the NuGet package GT.VRising.GameData

Usage

  • Add BepInDependency to your plugin:
    [BepInDependency("GT.VRising.GameData")]
    public class Plugin : BasePlugin
  • Optionally, add the following to your Plugin's Load() method. You shouldn't access any of the GameData properties before initialization is done.:
public override void Load()
{
    // ... other code
    GameData.OnInitialize += GameDataOnInitialize;
    // ... other code
}
  • Sample initialization method:
private static void GameDataOnInitialize(World world)
{
    // Here you can start using the methods like these:
    Logger.LogWarning("All Users:");
    foreach (var userModel in GameData.Users.All)
    {
        Logger.LogMessage($"{userModel.CharacterName} Connected: {userModel.IsConnected}");
    }

    var weapons = GameData.Items.Weapons.Take(10);
    Logger.LogWarning("Some Weapons:");
    foreach (var itemModel in weapons)
    {
        Logger.LogMessage($"{itemModel.Name}");
    }
}
  • Remove the event hook in your plugin's Unload() method:
public override bool Unload()
{
    // ... other code
    GameData.OnInitialize -= GameData_OnInitialize;
    // ... other code
    return true;
}

See the sample project here:

https://github.com/adainrivers/VRising.GameData/tree/main/src/VRising.GameData.SamplePlugin