Skip to content

Drawer Fixes, Interactable Creation and Proper Enum Flags

Compare
Choose a tag to compare
@Nebby1999 Nebby1999 released this 26 Nov 19:09

0.2.0

Drawer Fixes

I've written a few new additions to the SerializableSystemType drawer, considering the immense utility this type has, the main fix consist on situations where more than 1 field of this type was present on an inspected object, it would always select the first instance of the type instead of another field.

The fix makes it so it works constantly regardless of the amount of serializable types.

It also includes a new fallback system for finding the value set in the RequiredBaseType attribute that the SerializableSystemType uses.

Interactable Creation

I've been trying to figure out a good system for creating boilerplate prefabs for certain aspects of Risk of Rain 2, the first 2 tries where with projectiles and characterbodies, both of which are currently disabled and commented out. the attempts ive made where difficult but i decided to try again with interactables.

RoR2EditorKit now comes with an asset creation option for creating an Interactable in the form of a boilerplate. The base interactable contains the most common and what seems to be the necesary settings for creating an Interactable object in Risk of Rain 2, the default components that are added to the prefab are:

  • Main Game Object:
    • Entity State Machine
    • Network Identity
    • Network Transform
    • Network State Machine
    • Model Locator
    • Highlight
    • Generic Display Name Provider
    • SFX Locator
  • Mdl Game Object:
    • Entity Locator
    • Child Locator

The window also comes with the ability to add extra components and modify the prefab itself, these include:

  • Name for the interactable, will be used for the prefab's name, and the language tokens.
  • Has Cost: Wether or not the interactable costs something to use, setting this to true enables the following settings:
    • Cost Type: What type of cost the interactable uses
    • Cost: How much the interactable Costs
    • Is Shrine: Wether or not the interactable counts as a shrine
  • Is Chest: Wether or not to add a Chest Behavior to this Interactable
  • Summons something on interaction: Wether or not this interactable summons something on interaction, used for example, on broken drones/turrets
  • Is Portal: Wether or not the interactable is a portal
  • Create Matching ISC: Creates an Interactable Spawn Card for the prefab.

Proper Enum Flags

RoR2 currently contains a total of 8 enums that have the Flags Attribute applied to, however, none of these enum work as flag enums by default in the editor, this makes using these enum difficult at best and borderline impossible to use at worst.

RoR2EditorKit now comes with a PropertyDrawer for EnumMasks. which allows proper flag usage inside the editor.

image