-
Notifications
You must be signed in to change notification settings - Fork 36
Adding crafting recipes for other mods items
If you haven't looked at Using items from other mods yet, you probably should do that first since it explains how this is all possible in the first place. Remember, as a courtesy, check with the mod's author and make sure they're cool with you incorporating part of their work into your mod.
Any crafting node needs a TechType to identify what it's going to craft. In the case of a cross-mod TechType being added to your crafting tree, you only need the internal name it was registered with. There's a couple of ways you can get this:
- Ask the mod's author
- Check the mod's source code and look at what they used in the TechTypeHandler.AddTechType call.
- Open the TechTypeCache.txt file and look for it. Obviously you'll need to have this mod installed yourself.
Once you have the cross-mod TechType's internal name, you can use it to add that item to a crafting tree your mod is handling.
Normally, you wouldn't be adding another mod's item to one of the standard crafting trees, so we'll skip that for now and go straight to the more typical example.
If you are creating a fully custom crafting tree, likely you are adding this to a new custom fabricator, then you will have access to a method to add items from other mods.
Root nodes and Tab nodes for a ModCraftTree both inherit from the ModCraftTreeLinkingNode
class.
As such, they both offer this method:
public void AddModdedCraftingNode([string] moddedTechTypeName)
Consider this method somewhat of a "TryAdd" method.
If the cross-mod TechType associated to that internal name exists, it will be adding to the crafting tree.
If it doesn't exist, meaning the player does not have the other mod installed, then this method will quietly do nothing and the craft node won't be added to the craft tree.
You would use it somewhat like this.
// node could be either the root node or any tab node in your craft tree.
node.AddModdedCraftingNode("WarpCannon");
This is a great way to add extra functionality across mods, making for a more unified experience.
If there is something missing or ambiguous, please create an issue or contact us on the Subnautica Modding Discord using our tags:
- PrimeSonic:
@PrimeSonic#0667
- Metious:
@Metious#3682
Please note that some pages are under construction and the links to them will be enabled as they are completed
[Adding]
- Items/GameObjects using Asset Classes
- Asynchronous loading for ModPrefab
- [Custom Scanner Unlocks]
- Items/GameObjects to the Spawning System
- [Recipes to uncraftable items]
- [Custom Mouse Click Actions]
[Editing]
- Background Type
- Crafting Time
- Equipment Type
- Quick Slot Type
- Size in Inventory
- [Recipes for craftable items]
- Harvest Settings
- BioReactor Fuel Values
- [Scanning Count/Time]
- [Spawning (Where/How often/How many)]
[General Utilities]
- In-Game Options Menu
- Adding crafting recipes for other mods items
- Using items from other mods
- Texture/Sprite Utilities
- [Adding/Playing Audio]
- Config Files using Abstract Json Config class
- Custom Console Commands
- [Registering OnSave/OnQuit Actions]
[Language]