Jump to content

Recommended Posts

Posted

A library for creating custom, temporary buffs.

I've created a ModDB entry for this library at: https://mods.vintagestory.at/show/mod/633 However, there are no files to download there, because this library is meant to be included in the source code of your own mods.

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 OnStart, OnExpire, OnStack, 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.

  • Like 2
  • Mind=blown 2
  • 1 month later...
Posted

Really awesome status effect system, although I have ran into a bug with applying it to entities. It seems that if you apply an effect to an entity, reload, the effect is not  there anymore, it does not seem to get saved with the entity.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.