Mods / BuffStuff — A library for custom, temporary buffs

Draft
Set to published to be listed. A draft mod is still visible to everyone via direct link
Category: #Magic #Other #Utility
Author: goxmeor
Side: Both
Created: May 4th 2021 at 6:18 AM
Last modified: May 4th 2021 at 6:18 AM
Downloads: 0
Follow Unfollow 4

A library for creating custom, temporary buffs.

Overview

This source code library can be included in your mod's source code to support your own buffs.

Buffs can specify their own expiry time, either in game time or real time.

Buff expiry is automatically "paused" for players who leave the server, and also when the server is shutdown.

Buffs get an OnTick method call every 250 ms while active, and there are several other event-based methods which get called, such as OnStartOnExpireOnStack, and more.

Installing

cd src git submodule add https://github.com/chriswa/vsmodlib-BuffStuff.git

Or just download it as a zip and unzip it into your src/ directory.

If you need to create buffs in multiple mods, simply include a copy of the library in each mod. (It's very small!)

However, note that you will not be able to access buffs from other mods: each mod has its own BuffManager.

Usage

Code blocks don't render well here, so please view the remainder of the README on GitHub.

Version For Game version Downloads Release date Changelog Download 1-click mod install*
No releases found

2 Comments (oldest first | newest first)

💬 Capsup, May 9th 2021 at 9:22 PM

@Maldaris
The reason Gox (and me) use submodules is because NuGet is not really a viable solution at the moment. The VS ModLoader will barf whenever it tries to load the same assembly but with different versions. That means if you have two different mods, whom both use the same NuGet package, everything will break as soon as one mod updates to a newer release, but the other one doesn't. 
Submodules avoid this problem by explicitly baking the (possibly) diverging codebase directly into the mod assembly, so there can be no version mismatch, but still allows simple sharing between multiple codebases.

Ideas as to how we can avoid this problem are very welcome though. Hit me up on Discord at Capsup#8250.

💬 Maldaris, May 6th 2021 at 2:59 PM

Love this, but any time I see submodules recommended a part of me dies. Having worked with it in a professional context, it's a recipe for headaches.

A worthy effort would be to add nuget package definitions for this library, which Github has very good integrations for. See this docs article for details: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry

Otherwise I will totally end up using this in my projects. +1

(edit comment delete)