-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Welcome to the Flasks Wiki. This is a public resource containing usage documentation for Flasks.
If you're looking for the MarrowSDK wiki, you can find it here.
- Unity Version
2021.3.5f1 - Only SLZ-URP compatible shaders will render properly
- Basic Unity Knowledge
- Basic C# Knowledge
Watch a step-by-step Flasks Basics Guide on YouTube or follow the written guide below.
- Set up the MarrowSDK in Unity as explained in the original MarrowSDK wiki.
- Import the required Package using the Package Manager.
i. Window → Package Manager. In the upper-left corner, Select
+→Add package from git URL...the following link:
https://github.com/maranarasauce/MarrowSDK.git
Please note this will replace the currently installed version of the MarrowSDK, meaning other versions of the SDK such as the Extended SDK will not be compatible with Flasks.
A Flask has a Flask Label, which defines what Elixirs are held within it. To create an Elixir, you first need to create a script. Once you have created the script, add the Elixir attribute above the class definition of the script.
For example:
[Elixir]
public class Example : MonoBehaviour
{ ... }An Elixir can have public fields that are transferred into the game, but keep in mind that there are some fields that won’t transfer properly, such as local references to other Elixirs that may be injected before your Elixir is injected. The following types are known to work as fields:
- Bools
- Ints
- Floats
- Vectors
- Enums
- Strings
- Transforms
- GameObjets
- Unity Components
- Array/List versions of all of the above
A quirk of field injection is that the [SerializeField] attribute does not work. In order for a field to be exposed and transferred into the game, you must use the public modifier.
To understand what a Flask Label is, use the other Crates that the Marrow SDK has as a point of comparison. A Level Crate references a Scene asset, a Spawnable Crate references a Prefab asset, and the Flask references its Flask Label. The Flask Label describes the Elixirs inside of the Flask, and the Ingredients needed to make them work.
To create a Flask Label, Stress Level Zero → Alchemy → Create Flask Label Based on Open Scenes. This will grab any Elixirs from the currently opened scene and put them onto your Flask Label. The Flask Label is exported into the Assets folder, but moving the label into another folder will not break it.
The Flask Label has two important elements: Elixirs and Ingredients.
Elixirs are the code loaded into the game during runtime, and Ingredients are what the Elixirs referenced when being stirred.
If you would like to add any more Elixirs, you can drag the script from the Project window into the Add an Elixir field in the Flask Label inspector or press Add All from Current Scene to add any Elixirs from the scene that hasn't been included in the Flask Label.
Once you’ve created the Flask Label, it can be added as a Flask by going to a Pallet, clicking Add Crate, selecting the FLASK crate type, and dragging a Flask Label into the Asset Reference field. Once the Create button is clicked, the Flask will be added to the Crate.
To test the Flask’s stability before packing it into a pallet, click Stir Flask. It will compile all Elixirs from the Flask Label, and open the compiled compiled directory once completed.
If no errors are found, the Flask can be safely packed into a pallet and dragged into the Mods folder like any other pallet mod.