(mochi) Crafting Package

Stadia/EGS Name: mochi
Contributors: n/a
Package Name: `(mochi) Crafting Package
Package Description: Package used to set up craftable recipes
Share link: https://launch.crayta.com/play/dvw7asdg

Installation instructions
Initial Set up

  1. This package uses the (mochi) Pseudo world prompts package for displaying prompts for better performance instead of using normal world prompt widgets. Drag the Crafting World Prompt Scripts template on to the user entity if you are not already using pseudo world prompts. If you are already using pseudo world prompts, add the craftingWidget into the existing pseudo world prompts folder on the user entity and add a craftingWidget element into the Widgets property of PseudoWorldPromptScript
  2. Drag the CraftingOrchestrator template if there is not already an entity used for global scripts. If there is already an entity used for global scripts, drag the CraftingOrchestratorScripts template on to the global scripts entity.

note: if using the wood furniture starter kit (mochi) Wood Furniture Crafting Package, drag the WoodFurnitureRecipes script folder template into the Recipes folder of the CraftingOrchestratorScripts folder

  1. Drag the CrafterScripts script folder template on to the player entity

In order to create recipe, we must first have crafting materials.
Crafting Material Instructions:

  1. Select the CraftingMaterial template from the world dropdown.
  2. Create a new template from the current CraftingMaterial template.
  3. Navigate to the newly created template.
  4. Select CraftingMaterialScripts
  5. Set a user friendly name for your material in the Material Name field
  6. Create a unique id for this material in the Material Id field - this is used to identify the material in a recipe
  7. Replace woodPiece1 with the desired entity for the material and drag the root of that entity to the Root Material field

note: Make sure all parts of the entity are under a single entity that can be set in the Root Material field

note: Fields under the visual grouping are used to modify the positioning and rotation of the entity when held

note: Relative Drop Location is used to determine how far forward the material should be in relation to the player when the material is dropped

note: Supply Pile field will be discussed further down

Now that we have some crafting materials, we can create our first recipe
Recipe Creation Instructions:

  1. Navigate to the CraftingOrchestratorScripts folder that we had set up in step 2 of the initial set up instructions and open up the Recipe folder - this will be blank unless you already installed the WoodFurnitureRecipes from the (mochi) Wood Furniture Crafting Package.
  2. I highly recommend creating a folder with a descriptive name for the type of recipes you will be adding in there for easier management.
  3. Once we have the new recipe folder (or directly into the existing one if a sub-folder is not desired), right-click on the folder and add in a CraftingRecipeScript.
  4. The script will have 3 blank fields to be filled in: Material Id 1, Material Id 2, and Craftable Template

note: Each recipe uses exactly two materials and spawn one new Crafting Material entity.

  1. Fill in Material Id 1 and Material Id 2 with the Ids you set in step 6 of the crafting material instructions.
  2. Select a template that the two materials should make.

note: This template should also be a crafting material in order for certain prompts and actions to work automatically.

note: Each unique combination of two material ids will only ever produce one template at the moment, taking the first template passed in even if two scripts using the same two material ids have different Craftable Templates set. Crafting template selection is a potential addition in the future depending on demand.

You have now successfully set up a crafting recipe using the materials you created! You may drop the required materials into the world and select them to test to make sure your recipe is working as intended.

You can also create supply piles of materials as mentioned in the fourth note in step 7 of the crafting material instructions. When selecting Supply Pile field in the CraftingMaterialScript new fields will appear.
Infinite Supply - whether the supply is an infinite supply of the crafting material it provides
Supply Amount - if not an infinite supply, how many materials does this supply pile provide (entity will destroy itself when depleted)
Supplied Material - template of the crafting material that this supply pile supplies
note: Material Name should match the material name of the crafting material that the supply will provide.
note: the fields Material Id, Root Material Entity, and everything under the visual grouping can be ignored for a supply pile

Pulling from supply pile

Crafting directly from a supply pile

Crafting from another material on the ground

Crafted Table


Recipes from the (mochi) Wood Furniture Crafting Package:
small wood piece + small wood piece = small bundle of wood
small wood piece + small bundle of wood = medium bundle of wood
small wood piece + medium bundle of wood = large bundle of wood
medium bundle of wood + medium bundle of wood = large bundle of wood
small wood plank - square + small wood plank - square = medium wood plank - square
large bundle of wood + medium wood plank - square = wood table -square
large bundle of wood + small wood plank - square = wood stool - square
small wood plank + wood stool - square = wood chair - square