TeamMoonstorm-MoonstormSharedUtils icon

MoonstormSharedUtils

An API focused with the intention of working in an editor enviroment using ThunderKit, MSU is a modular API system designed for ease of use and simplicity.

Last updated 4 months ago
Total downloads 1273480
Total rating 21 
Categories Mods Tools Libraries
Dependency string TeamMoonstorm-MoonstormSharedUtils-1.6.3
Dependants 495 other packages depend on this package

This mod requires the following mods to function

RiskofThunder-R2API_Core-5.0.10 icon
RiskofThunder-R2API_Core

Core R2API module

Preferred version: 5.0.10
RiskofThunder-R2API_ContentManagement-1.0.2 icon
RiskofThunder-R2API_ContentManagement

API for adding content to the game

Preferred version: 1.0.2
RiskofThunder-R2API_ArtifactCode-1.0.1 icon
RiskofThunder-R2API_ArtifactCode

API for making Artifact Codes

Preferred version: 1.0.1
RiskofThunder-R2API_Colors-1.0.1 icon
RiskofThunder-R2API_Colors

API for registering Colors to the game

Preferred version: 1.0.1
RiskofThunder-R2API_DamageType-1.0.4 icon
RiskofThunder-R2API_DamageType

API for registering damage types

Preferred version: 1.0.4
RiskofThunder-R2API_Director-2.1.0 icon
RiskofThunder-R2API_Director

API for easily modifiying the Director (RoR2 monster / interactable spawner) behaviour

Preferred version: 2.1.0
RiskofThunder-R2API_Elites-1.0.3 icon
RiskofThunder-R2API_Elites

API for adding custom elite types

Preferred version: 1.0.3
RiskofThunder-R2API_RecalculateStats-1.2.0 icon
RiskofThunder-R2API_RecalculateStats

API for manipulating Character Stats

Preferred version: 1.2.0
RiskofThunder-R2API_CommandHelper-1.0.1 icon
RiskofThunder-R2API_CommandHelper

API for registering console commands

Preferred version: 1.0.1
RiskofThunder-R2API_Addressables-1.0.2 icon
RiskofThunder-R2API_Addressables

R2API Submodule for implementing Addressables functionality

Preferred version: 1.0.2
Rune580-Risk_Of_Options-2.6.1 icon
Rune580-Risk_Of_Options

A convenient API for adding BepInEx ConfigEntry's to a option menu

Preferred version: 2.6.1

README

Moonstorm Shared Utils

MoonstormSharedUtils, otherwise known as MSU, is a "Content Loading" and "General Utility" API designed to work around the ThunderKit system for creating Content Mods.

Originally part of the API and framework built for updating Starstorm2 to Thunderkit, it was eventually split into it's own separate library so anyone with the desire to create mods with thunderkit can use it.

Goals:

  • MSU Strifes for the following goals:
    • Simple systems for Managing and Loading content for the game.
    • Modularity on its systems to allow high flexibilty.
    • Simplification of Thunderkit workflow.
    • High enphasis on using RoR2 systems over hooks if possible
    • Enphasis on Editor work over Code work for development.

Key Features:

Content Bases and Modules:

To aid in the loading and management of content pieces for the game, MSU comes bundled with what are called Content and Module classes.

A very detailed explanation of these can be found here, but in a nutshell:

  • ContentBase:

    • Represents an abstracted Content piece of the game (IE: Buff, Artifact, Item, etc)
    • Contains methods and systems for implementing the behaviour of a content piece
    • Allows for high customization via inheritance.
    • Allows for automatic behaviour usage, creation and interaction with base game systems via ModuleBases.
  • ModuleBase:

    • Represents a class that manages a type of content base.
    • A ModuleBase implements all the hard work of making a Content from the managed content base appear in game properly, so it lets you create more content instead of implementing systems.
    • Allows for high customization via inheritance.
    • A module base will always have a ContentBase to manage, unless stated otherwise.
    • A ModuleBase creates all instances of it's ContentBase, allowing modularity via Config options.

RoR2 Friendly Systems:

MSU's goals belive that by working with ROR2's systems instead of forcing them to work with ours means that a code for a mod will become more robust overtime, as such, MSU provides multitude of systems apppart from the Content and Module bases for implementing the behaviour of your mod's features.

  • BaseBuffBodyBehaviour:
    • A custom written behaviour system that works like the base game's BaseItemBodyBehaviour.
    • Works with BuffDefs instead of ItemDefs, perfect for implementing complex behaviours with buffs.
  • The following are Interfaces that are meant to be used inside BodyBehaviours.
    • IBodyStatItemBehaviour: an interface that wraps around R2API's RecalculateStatsAPI's systems. Allows for complex modifications of stats via RecalculateStatsAPI's systems.
    • IOnIncomingDamageOtherServerReciever: Works as a hook on TakeDamage, this interface allows you to modify the incoming DamageInfo of a Victim.
    • IStatItemBehavior: An interface that allows you to run code before and after RecalculateStats.

We also have a guide explaining the base game's interfaces that can replace a lot of hook usage here (Note, guide may be out of date.)

Improved Thunderkit Workflow:

As MSU's goals revolve around working in the editor, this means that the more time a developer spends in the editor implementing content the better, as such, MSU comes bundled with ScriptableObjects, and a custom Editor package that works off the systems implemented in ThunderKit and RoR2EditorKit.

  • On the Runtime aspect, we have ScriptableObjects:

    • VanillaSkinDefinition: An extended version of a SkinDef, It Allows you to create a Skin for a vanilla body. Akin to RoR2SkinBuilder.
    • MSUnlockableDef: An extended version of an UnlockableDef, It allows you to create a fully working AchievementDef tied to an UnlockableDef.
    • MaterialCopier: Allows you to copy the properties and shaders of an AddressableMaterial into your project at runtime.
    • NamedIDRS: A complete self contained IDRS system, the NamedIDRS can be used to create the ItemDisplayRuleSet of a Survivor or Monster. Completely serialized in the editor via Direct References or Addressables, alongside tools for using the ItemDisplayPlacementHelper.
    • ItemDisplayDictionary: Inspired by R2API.ItemAPI's ItemDisplayDictionary, it allows you to append new ItemDisplayRules to multiple IDRS. Completely serialized in the editor via Direct References or Addressables, alongside tools for using the ItemDisplayPlacementHelper.
    • SerializableEliteTierDef: a serializable version of an EliteTierDef, easily create new elite tiers with this and the bundled in EliteTierDefModule and Content bases.
    • MSEliteDef: An extended version of a regular EliteDef, an MSEliteDef alongside the Elite systems in MSU will take care of adding the elite to vanilla tiers, alongside implementing the Ramp, Overlay and Visual Effects.
    • MSInteractableDirectorCard: An extended version of an InteractableSpawnCard, it allows you to easily create a card that can be used immediatly in the game via MSU's interactions with R2API.DirectorAPI.
    • MSMonsterDirectorCard: An extended version of a CharacterSpawnCard, it allows you to easily create a card that can be used immediatly in the game via MSU's interactions with R2API.DirectorAPI.
  • On the Editor aspect, we have MoonstormSharedEditorUtils, a complete overview of the package can be found here.

Documentation & Sourcecode:

  • The Documentation and Sourcecode can be found in MoonstormSharedUtil's Github Repository, which can be found here

Donations:

MSU is a passion project from one of TeamMoonstorm's members, Nebby. as such, he works in his free time on this to allow the rest of the community to create amazing and awe-inspiring content.

MSU will forever be free to use and never gated behind paywalls, however, donations are incredibly appreciated.

ko-fi

Thanks and Credits:

  • General Help and Advice: Twiner, IDeathHD, Harb.
  • Programmers: Nebby, KevinFromHPCustomerService.
  • KingEnderBrine and RuneFox237 for the RoR2SkinBuilder, which was used as a base for the VanillaSkinDefinition
  • Anreol for providing more Stubbed Shaders.
  • Swuff, TheTimeSweeper, Dotflare, HeyImNoop, JaceDaDorito, Enigma, Vale-X, 2Cute2Game, Riskka, Bruh, UnkownGlaze, Neik, Jame, MysticSword, PlasmaCore and many other developers for beliving in my work and goal of MSU
  • Everyone from the Risk of Rain 2 community for appreciating my work.