Skip to content

Mod Creation_Assets_Void Items

.score edited this page Feb 4, 2025 · 2 revisions

Void Items

First things first, this wiki is expecting you to already know how to make your own custom items in the game. If you do not, go check out the other tutorials on the wiki as well as KomradeSpectre's video tutorial.

This wiki will cover initializing the transformations for the void item you have created. This process remains the same whether you are managing your project from visual studio or creating items in thunderkit.

Manual Initialization

Setting the Item Tier

The first thing you want to do is make sure your ItemDef tier is set to one of the void tiers. You can technically have void transformations on non-void tiered items, but I don't see the point in doing that.

In thunderkit:

image

or In Project:

image

Setting the ExpansionDef

All void items should have their expansion def set to SurvivorsOfTheVoid. This solution needs to be done in code, and this line of code needs to be run after the ExpansionCatalog has been initialized, otherwise you will get a null reference exception. I just do this later when I hook onto the event to initialize the void transformations, however you can hook onto the initialization of ExpansionCatalog if you want to for this step.

To set the expansion def, you can do this:

YourItemDef.requiredExpansion = ExpansionCatalog.expansionDefs.FirstorDefault(def => def.nameToken == "DLC1_NAME")

Creating the transformation(s)

ItemRelationshipProvider

This is the scriptable object that will get added to your ContentPack. Simply create a new ItemRelationshipProvider and set the relationship type to the DLC1 contagious item type.

yourProvider.relationshipType = Addressables.LoadAssetAsync<ItemRelationshipType>("RoR2/DLC1/Common/ContagiousItem.asset").WaitForCompletion();

You then want to populate the ItemRelationshipProvider.relationships array with the transformation pairs that you want to add. These ItemDef.Pair structs can contain custom or vanilla items, but neither of the items can be null! Keep in mind that using vanilla items requires you to load the addressable ItemDef object. Using RoR2.RoR2Content.Items or any similar static field WILL NOT WORK!!

The addressables can be found here https://xiaoxiao921.github.io/GithubActionCacheTest/assetPathsDump.html

{D967968C-E50C-42AF-98FA-2A554585E290}

You can either manage your own ContentPack and add it to the ContentPack.itemRelationshipProviders array or use R2API.ContentAddition.AddItemRelationshipProvider.

Clone this wiki locally