Crafting
The crafting component crafts item recipes over time. The crafting component is also an inventory; it automatically adds or remove slots to match its current recipe's ingredients and products.
Properties
- Each item occupies a single slot
- Slots can have item requirements
- Slots have gameplay tags
- Slots have configurable capacities
- Some slots are tagged for use by the crafter, meaning you can't modify them.
- Automatically creates slots from its current recipe.
Usage
BLCraftingComponent
s craft a single recipe at a time. When you set the current recipe, the crafter automatically creates slots for each ingredient and product. Once sufficient ingredients have been deposited, you may start the craft. The crafter will continue until it finishes, unless you pause or cancel the craft. When it finishes, the crafter will try to deposit the products into their slots; if the slots are full, it will wait until all product slots have space.
The crafting component is a state machine, meaning it has a set of possible states and only one state can be active at a time. You can check what it's currently doing by getting its state:
Gameplay Tags
Behavioral
Add these tags to the crafting component to change how it works:
Bolt.Crafting.AutoStartCrafts
: The crafter will automatically try to start crafting when ingredients are deposited.Bolt.Crafting.AutoContinueCrafts
: The crafter will automatically continue crafting after completing a craft.Bolt.Crafting.CancelCraftsDisabled
: Cannot cancel crafts.Bolt.Crafting.PauseCraftsDisabled
: Cannot pause crafts.
Description
Bolt.Crafting.IngredientSlot
: Reserved for depositing recipe ingredients. Players may deposit items if they match the ingredient's requirements.Bolt.Crafting.IngredientStagingSlot
: Reserved for storing ingredient items; cannot be modified.Bolt.Crafting.ProductStagingSlot
: Reserved for storing product items; cannot be modified.Bolt.Crafting.ProductSlot
: Reserved for recipe products. Players may withdraw items but not deposit.Bolt.Crafting.PoolSlot
: Reserved for the slot 'pool', or slots that remain between recipe changes.
Saving and Loading
Crafters may be saved at any time. They will resume where they left off when loaded.