You are viewing a potentially older version of this package. View all versions.
Lunoid-REPO_Alchemy-1.1.0 icon

REPO Alchemy

Adds a polished crafting system to REPO! REQUIRES OTHER MODS TO ADD RECIPES

By Lunoid
Date uploaded 2 weeks ago
Version 1.1.0
Download link Lunoid-REPO_Alchemy-1.1.0.zip
Downloads 339231
Dependency string Lunoid-REPO_Alchemy-1.1.0

This mod requires the following mods to function

Zehs-REPOLib-2.0.1 icon
Zehs-REPOLib

Library for adding content to R.E.P.O.

Preferred version: 2.0.1
Kistras-CustomDiscoverStateLib-1.0.0 icon
Kistras-CustomDiscoverStateLib

Library for your mod that allows for custom-colored discoveries (similar to the thing you see when a valuable is encountered for the first time)

Preferred version: 1.0.0

README

This mod adds a crafting system to REPO! Add some ingredients to the pot, shake it up, and create some thing new and useful!

!!REQUIRES OTHER MODS TO ADD RECIPES AND INGREDIENTS!! (check out Unique Potions)

Easy for other modders to add new content too! (instructions below)

The P.O.T.

This handy device, the Portable Oscillation Transmutator, can take something... and turn it into something else! You can even put it in your pocket!

To use it simply throw in the ingredients you find in the level, look for the shake indicator on the display to make sure the recipe is valid, grab the handle, and shake the P.O.T. until your product is ready. Make sure it's cooked thoroughly.

You can store ingredients inside the P.O.T. by depositing them into the funnel on the left side. The ingredients are accessable on the right. Be careful when you leave though, as you can only bring 2 of each ingredient (configurable) to the next level.

If you have more than 4 different types of ingredients in the P.O.T. at one time, press your use key while holding it to cycle through them.

The indicator lights behind the ingredients show you:

  • Orange: multiple of this ingredient are stored
  • Red: too many of this ingredient are stored (they will be lost next level)
  • Magenta: this ingredient is unlimited

The Ingredients

By default, this mod does not add any ingredients or recipes. I recommend getting my other mod, Unique Potions, for various craftable potions! A configurable amount of ingredients can be found in each level (default 1-4). These ingredients do not spawn like other valuables, so they don't reduce your total haul in any way.

How to add your own content

This mod adds content similar to how REPO Lib allows you to add content. There are two methods to adding content: through scripting or through the unity editor. To set up your unity project, follow this guide, then drag REPOAlchemy.dll (found in the mod folder) into your unity project.

Ingredients

Custom Ingredients

To add a new ingredient, create a prefab like you would for a valuable or item, and add an Ingredient component. Set up the parameters to your liking.

  • ingredientID (IMPORTANT) used to differentiate between the ingredients
  • canStore whether or not the ingredient can be stored and transferred between levels in the P.O.T.
  • storeOnExtract whether or not the ingredient should be stored and transferred to the next level when the object is extracted (reqires canStore to be enabled).
  • storedScale determines how large the ingredient will be when stored on the P.O.T.
  • potScale determines the scale the ingredient should be changed to when placed inside the pot (useful if your ingredient is large).

Other parameters will be explained in the recipes section. Most of them are unimportant if you do not intend for the ingredient to be craftable.

Once you've set up your ingredient, you can register it into the game by creating a new Ingredient asset in your unity project and dragging in your prefab. the useIngredientSpawning parameter determines whether or not it will spawn like other ingredients (recommended to turn this off if you want this ingredient to be crafted from other ingredients).

Make sure each asset has a unique name.

Existing Objects as Ingredients

If you would like to use an existing valuable or shop item (modded or vanilla) as an ingredient (e.g. a diamond or grenade), then simply add a Valuable Ingredient or Item Ingredient into your project. Set the name of the item/valuable you want to turn into an ingredient (make sure NOT to include "Valuable " or "Item " in the front). Simply set the parameters like explained before, and it's all set.

Make sure each asset has a unique name.

Recipes

Custom Products

To add a recipe for a new object, create a prefab like before, and add an AlchemyItem component (Ingredient components count as AlchemyItem components). Set up the parameters.

  • color determines the color of the particle effects when crafting this recipe.
  • icon determines the icon that shows up on the P.O.T's display when the the recipe can be crafted (recommended 256 x 256 px).
  • potScale determines the scale the product should be changed to when crafted or placed inside the pot (useful if your product is large).
  • itemPersistent (only applies to shop items) determines whether the item should transfer between levels.

To register the recipe, add a new Recipe asset to your unity project. Drag in the product's prefab, and set the ingredients. This uses the ingredientIDs of the ingredients set up beforehand. You can use your own or other people's ingredients as long as you have the ingredientID.

Make sure each asset has a unique name.

Existing objects as Products

To use add a recipe for an existing valuable or shop item, add a Valuable Recipe or Item Recipe similar to how you would set up existing objects as ingredients.

Registering Using Scripts

Registering through a script is similar to in unity. I have provided tools for registering valuables and recipes in my Tools class. to register a

  • Ingredient: use Tools.RegisterIngredient.
  • Existing valuable as ingredient: use Tools.RegisterIngredientByValuableName.
  • Existing item as ingredient: use Tools.RegisterIngredientByItemName.
  • Recipe: use Tools.RegisterRecipe.
  • Recipe for existing valuable: use Tools.RegisterRecipeByValuableName.
  • Recipe for existing item: use Tools.RegisterRecipeByItemName.

I'm currently a busy college student, so development may be slow. Bare with me! If you have any questions or comments, ping me in my forum on the modding discord.


Credit

  • Beaniebe: Testing REPOLib SDK additions

CHANGELOG

1.1.0

  • added REPOLib SDK stuff to use in the Unity Engine. adding content for this mod should be much easier (Thanks, Beanie!)
  • added the ability to change the scale of objects within the pot
  • added the ability to add existing objects as ingredients or products
  • renamed "P.O.T." to "Alchemy P.O.T." so people know what mod its from

1.0.5

  • fixed ingredients not transferring between levels

1.0.4

  • fixed duplication/deletion glitches when storing an ingredient then immediately equipping the pot (hopefully)
  • added a config to disable the pot in the shop
  • the first three spawned ingredients now uses grab bag randomization (the first three spawned ingredients are be guaranteed to be varied. this will make getting duplicate ingredients rarer.)

1.0.3

  • fixed everything breaking when the prefabID and ingredientID aren't identical (damn void juice)

1.0.2

  • scanned ingredients now highlight purple to differentiate from regular valuables
  • ingredients no longer show up on the map until scanned
  • fixed map markers appearing near the truck when the pot is equipped with ingredients stored

1.0.1

  • improved performance

1.0.0

  • released!
  • add crafting
  • crafting
  • yippy