ORK Framework Logo - RPG Editor for Unity
  • ORK 4 BETA
  • Features
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK

ORK 4 Documentation

  • Getting Started
    • Welcome
    • First Steps (Unity)
  • Features
    • The Status System
    • Schematics
    • Schematic Nodes
    • Dialogue Importer
    • Variables
    • Selected Data
  • Components
    • Battle Components
    • Combatant Components
    • Control Components
    • Cursor Prefab Components
    • Game Starters
    • Interactable Components
    • Move AI Components
    • Scene Setup Components
  • Editor
    • The ORK 4 Editor
    • Sections & Sub-Sections
    • Node Editor
    • Schematic Editor
    • Asset Sources
    • Unity Overlay Toolbar
  • Section: System
    • System Settings
    • Languages
    • Organizer Types
    • Game States & Conditions
    • General Condition Templates
    • Object Pools
    • Prefab Savers
    • Scene Connections
  • Section: Controls
    • Game Controls
    • Interaction Settings
    • Player Controls
    • Camera Controls
    • Input Keys
    • Control Maps
    • Camera Positions
    • Battle Camera
  • Section: Gameplay
    • Game Settings
    • Formulas
    • Difficulties
    • Shortcut Slots & Settings
    • Custom Settings & Global Custom Settings
    • Global Machines
    • Machine Templates
  • Section: Status
    • Status Values
    • Status Effects
    • Attack Modifiers
    • Defence Modifiers
    • Abilities & Ability Developments
    • Status Developments
    • Research Trees
    • Damage Types
    • Status Bonuses & Templates
    • Status Condition Templates
  • Section: Inventory
    • Inventory Settings
    • Inventory Containers
    • Currencies
    • Items
    • AI Rulesets
    • Crafting Recipes
    • Equipment Slots & Slot Set Templates
    • Equipment & Available Equipment Templates
    • Shops
    • Loot
  • Section: Combatants
    • Combatants
    • Combatant Groups
    • Class Slots
    • Classes
    • Factions & Faction Benefits
    • Animations
    • Move AIs
    • Formations
    • Action Combos
  • Section: Battles
    • Battle Systems
    • Turn Based Battles
    • Active Time Battles
    • Real Time Battles
    • Phase Battles
    • Battle Spots
    • Battle AIs
    • Battle Actions Settings
    • Special Commands Settings
    • Target Settings
    • Target Selection Templates
    • Battle Range Templates
    • Battle Grid Settings
    • Battle Grid Highlights
    • Battle Grid Cell Types
    • Battle Grid Formations
  • Section: Content
    • Content Types
    • Music
    • Sound Templates
    • Areas
    • Teleports
    • Quests & Quest Tasks
    • Logs & Log Texts
    • Object Contents
  • Section: UI
    • UI Settings
    • UI Layers
    • UI Layouts
    • UI Boxes
    • HUDs
    • Notifications
    • Cursor Settings
  • Section: Menus
    • Start Menu
    • Save Game Settings
    • Option Categories
    • Menu Screens
    • Menu Requirements
    • Battle Menus
    • Loot Dialogues
    • Item Collection
    • Combatant Selections
    • Quantity Selections
    • Shop Layouts
  • Section: Texts
    • Text Settings
    • Formatting Settings
    • Flying Texts
    • Use Cost Display
    • Status Preview Display
    • Bonus Display
    • Status Change Display
    • Console Settings & Console Types
    • Text Codes
  • Sections: Editor
    • Editor Settings
    • Backups
    • Variables
    • Plugins
  • Scripting
    • Access Handler
    • Custom Nodes
    • Custom Save Data
    • Custom Component Save Data

ORK 4 Tutorials

  • ORK 4 Unity Quickstart Tutorials (3D)
    • ORK 4 Unity Quickstart 3D
    • 01 Initial ORK Setup
    • 02 Player Setup
    • 03 Music & Scenes
    • 04 UI System Setup
    • 05 UI Boxes
    • 06 Flying Texts
    • 07 Status Values
    • 08 Status Effects
    • 09 First Abilities
    • 10 Fighter Setup
    • 11 First Enemies & Battle AI
    • 12 Battle System Setup
    • 13 Animating Battle Start and End
    • 14 Random Battles
    • 15 Animating Actions
    • 16 Player Battle HUD
    • 17 Elemental Attacks
    • 18 Animating More Actions
    • 19 Inventory & Loot
    • 20 Equipment
    • 21 Loot, Start Equipment & Viewers
    • 22 Magic Abilities
    • 23 Caster Setup
    • 24 More Enemies
    • 25 Start Menu & Save Games
    • 26 Menu Screens
    • 27 Interactions
    • 28 Item Collectors
    • Quickstart Extended
  • Battle Tutorials
    • Adding Active Time Battles
    • Adding Phase Battles
    • Hit & Miss
    • Critical Hits
    • Cast Time
    • Grid 01: Battle Grid Setup
    • Grid 02: Highlights
    • Grid 03: Cell Types
    • Grid 04: Move Command
    • Grid 05: Scene Grid Setup
    • Grid 06: Battle Ready
    • Grid 07 Use & Affect Ranges
    • Grid 08: Better Camera Control
  • Gameplay Tutorials
    • Multiple Interaction Controllers
    • Player Group Spawn & Follow
    • Spawn Hunting Enemies
    • Gamepad Controls (Unity Input System)
    • Combined Inputs
    • Quests 01: Menu Screen
    • Quests 02: Hunting
    • Quests 03: Collect Potion Materials
    • Quests 04: Collect Equipment Materials
    • Quests 05: Quest Mark HUDs
    • Crafting 01: Menu Screen
    • Crafting 02: Materials & Recipes
    • Crafting 03: Getting Materials
    • Crafting 04: Proficiency & Critical Outcome
    • Shop
    • Inventory Containers
  • Schematics Tutorials
    • UI Animation Schematics
    • Flying Text Animation Schematics
    • HUD Conditional Schematics
  • UI Tutorials
    • Unity UI: Initial Setup
    • Unity UI: Status Value UI Setup
    • Unity UI: Status Effect UI Setup
    • Unity UI: Shortcut UI Setup
    • Unity UI: Dragging Notification
    • Unity UI: Interaction HUD
    • Unity UI: Shortcut HUD
    • Unity UI: Turn Order HUD
    • Unity UI: Cast Time HUD
    • Unity UI: Quest HUD
    • Unity UI: Tooltip HUD
    • Unity UI: Move Range HUD

ORK 4 Extensions

  • Plugins
    • Save Game Compression Plugin
  • Schematic Nodes
    • Footstepper Nodes (Unity)
  • Scripts
    • A* Pathfinding Movement Component (Unity)
    • PolyNav 2D Movement Component (Unity)
    • Cinemachine Camera Control Type (Unity)
    • Rewired Input Key (Unity)
    • Unity Legacy Input Key (Unity)
    • Core GameKit Wrapper (Unity)
    • Pool Boss Wrapper (Unity)
View Categories
  • Guide
  • ORK 4
  • ORK 4 Tutorials
  • Gameplay Tutorials

Crafting 03: Getting Materials

In this tutorial we’ll add materials as enemy loot and set up an NPC that’ll give the player the initial recipes and materials.

This tutorial is part 3 of a mini-series covering crafting. You can find the start of this series here.

We’ll set up:

  • new loot giving materials
  • NPC schematic
  • NPC object

This tutorial is based on the ORK 4 Unity Quickstart 3D tutorials and the previous crafting tutorials, but can be used in any project.

New Loot #

Open the ORK editor and navigate to Inventory > Loot, we’ll add new loot.

Materials #

Add a new loot setup – it’ll randomly drop one of the regular crafting materials:

  • empty bottle (35% chance)
  • strange liquid (45% chance)
  • iron (20% chance)

That’s a total of 100%, so we’ll get one of these items in any case.

  • Name
    Set to: Materials

Click on Add Loot Table.

Loot Settings #

  • Draw Type
    Select: Random
    We’ll get one of the added items randomly.
  • Use Chance Selection
    Enable
    The random selection will be based on the chance values of the individual items.
    Otherwise, it’d randomly select an item and use it’s chance check to see if that item will be dropped (no other is checked).

Click on Add Item.

  • Item
    Select: Empty Bottle
  • Chance
    Select: Value > Value
    Set the value to: 35

Copy the previous item.

  • Item
    Select: Strange Liquid
  • Chance
    Set the value to: 45

Copy the previous item.

  • Item
    Select: Iron
  • Chance
    Set the value to: 20

Slime #

Add a new loot setup, we’ll drop slime at 100% chance.

  • Name
    Set to: Slime

Click on Add Loot Table.

Loot Settings #

Click on Add Item.

  • Item
    Select: Slime

Bone #

Copy the Slime loot, we’ll drop a bone at 100% chance.

  • Name
    Set to: Bone

Loot Table 0 > Loot Settings > Item 0 #

  • Item
    Select: Bone

Venom #

Copy the Bone loot, we’ll drop venom at 100% chance.

  • Name
    Set to: Venom

Loot Table 0 > Loot Settings > Item 0 #

  • Item
    Select: Venom

Adding Loot to Combatants #

Next, we’ll add the loot we set up to the enemies.

Navigate to Combatants > Combatants and select the General Settings – we’ll first add the Materials loot as a default loot for all combatants.

Inventory & Equipment > Loot Settings #

Click on Add Loot.

  • Loot
    Select: Materials

Now we’ll add the specific loot to their combatants.

Wasp #

Select the Wasp combatant.

Inventory & Equipment > Loot Settings #

  • Loot Origin
    Select: Loot

Click on Add Loot.

  • Loot
    Select: Venom

Snake #

Select the Snake combatant.

Inventory & Equipment > Loot Settings #

  • Loot Origin
    Select: Loot

Click on Add Loot.

  • Loot
    Select: Venom

Skeleton #

Select the Skeleton combatant.

Inventory & Equipment > Loot Settings #

Click on Add Loot.

  • Loot
    Select: Bone

Slime #

Select the Slime combatant.

Inventory & Equipment > Loot Settings #

Click on Add Loot.

  • Loot
    Select Slime.

Save Changes #

And that’s it for the loot!

Don’t forget to save your changes by clicking on Save Settings at the bottom of the editor.

NPC Schematic #

Instead of giving the player crafting recipes from the start, we’ll use an NPC to introduce the player to crafting.

We’ll create a schematic with a bit of dialogue and give the player the first crafting recipe (potion) and some materials. We’ll use a global bool variable (CraftingIntroduction) to mark the initial introduction as finished.

Open the schematic editor.

Settings #

  • Block Player Control
    Enable

Speakers #

We’ll add speaker content information for the NPC.

Click on Add Speaker.

  • Object
    Select: Machine Object
  • Custom Object Content
    Enable
    We’ll define the content information in the schematic instead of using an object content set up in the ORK editor.
  • Name
    Set to: Crafting Enthusiast

Check Variables #

Add Node > Value > Variable > Check Variables

We’ll check if the global bool variable CraftingIntroduction is set to true, i.e. the player already spoke to the NPC and received a recipe and materials.

Click on Add Variable.

  • Variable Key
    Set the value to: CraftingIntroduction
  • Variable Origin
    Select: Global
  • Is Valid
    Enable
  • Variable Type
    Select: Bool

Show Dialogue #

Add Node > UI > Dialogue > Show Dialogue

In case the player already spoke to the NPC, we’ll just show a message.

This node is connected to the Success slot of the Check Variables node.

  • Dialogue Type
    Select: Message
  • UI Box
    Select: Dialogue
  • Use Speaker
    Enable
  • Show Name
    Enable
  • Text (Message Content)
    Set to: Crafting is fantastic, isn’t it?

Show Dialogue #

Add Node > UI > Dialogue > Show Dialogue

If this is the first time speaking to the NPC, we’ll show a different dialogue.

Copy the previous Show Dialogue node, this time it’s connected to the Failed slot of the Check Variables node.

  • Text (Message Content)
    Set to: Have you ever created something with your own hands?
    It’s a wonderful feeling, why don’t you give it a try?
    <#>Here, take this recipe and these materials.
    Don’t worry, it’s completely free!

Notice the use of the text code <#>? This moves the text after it to the next page of the dialogue.

If you have longer messages, you don’t need to use multiple Show Dialogue nodes to split it up, you can use the <#> text code instead.

Add Recipe #

Add Node > Inventory > Crafting > Add Recipe

We’ll add the potion recipe.

  • Object (Combatant)
    Select: Player
  • Crafting Recipe
    Select: Potion Recipe

Add Needed Ingredients #

Add Node > Inventory > Crafting > Add Recipe

We’ll add the ingredients needed for the potion recipe.

  • Object (Combatant)
    Select: Player
  • Crafting Recipe
    Select: Potion Recipe

You can also use an Add To Inventory node instead, but you’ll have to manually define the items.

Show Dialogue #

Add Node > UI > Dialogue > Show Dialogue

Copy one of the Show Dialogue nodes again and connect it to the Next slot of the Add Needed Ingredients node.

  • Text (Message Content)
    Set to: To craft something, open your menu and select <i>Crafting</i>.

Change Variables #

Add Node > Value > Variable > Change Variables

And finally, we’ll set the variable we checked at the start.

Click on Add Variable.

  • Variable Key
    Set to: CraftingIntroduction
  • Variable Origin
    Select: Global
  • Variable Type
    Select: Bool
  • Bool Value
    Enable

And that’s it for the schematic – click on Save Schematic and save it as CraftingNPC.

Adding the NPC #

Let’s add an NPC to the World scene. You can find the NPC prefabs at Assets/Tutorial Assets/Prefabs/NPCs/ – I’m using the Worker_Female prefab.

I’m placing my NPC at wood workshop – the building with the logs and saw next to it.

Machine (Schematic) #

Add a Machine (Schematic) component to the NPC’s object using the component menu.

Start Settings #

Click on Interact, this will add the Interact start type.

If you want, you can also add mouse interaction, click on Add Start Type.

  • Start Type
    Select: Interaction > Mouse Up As Button

In case you’ve followed the interaction HUD tutorial, you can also set the organizer type to use the correct HUD.

  • Organizer Type
    Select: Talk Interaction

Expand the Object Turn Settings, we’ll let the player and NPC face each other.

  • Turn Starting Object
    Enable
  • Turn Component Object
    Enable

Asset Settings #

  • Schematic Asset
    Select: CraftingNPC

And that’s it – save the scene.

Testing #

Hit play, run to the crafting NPC and interact with it.

We get our first recipe and materials.

And we can finally craft something, but we only have enough materials for one potion.

To get more materials, we’ll need to fight some monsters and hope they drop what we need.

You can also add a shop to the game to sell materials and crafting recipes to the player.

The other crafting recipes will be available to the player through other tutorials in the future, i.e. a quest from the crafting NPC to get the equipment recipes. If you can’t wait for this (or don’t want to set it up), you can just add the rest of the recipes in the schematic we’ve set up in this tutorial.

The next part of the crafting mini-series will add crafting proficiency and critical outcomes.

Table of Contents
  • New Loot
    • Materials
      • Loot Settings
    • Slime
      • Loot Settings
    • Bone
      • Loot Table 0 > Loot Settings > Item 0
    • Venom
      • Loot Table 0 > Loot Settings > Item 0
  • Adding Loot to Combatants
    • Inventory & Equipment > Loot Settings
    • Wasp
      • Inventory & Equipment > Loot Settings
    • Snake
      • Inventory & Equipment > Loot Settings
    • Skeleton
      • Inventory & Equipment > Loot Settings
    • Slime
      • Inventory & Equipment > Loot Settings
  • Save Changes
  • NPC Schematic
    • Settings
      • Speakers
    • Check Variables
    • Show Dialogue
    • Show Dialogue
    • Add Recipe
    • Add Needed Ingredients
    • Show Dialogue
    • Change Variables
  • Adding the NPC
    • Machine (Schematic)
      • Start Settings
      • Asset Settings
  • Testing
Sitemap
  • ORK 4 BETA
  • Features
  • Showcase
  • Guide
    • Documentation
    • Tutorials
    • API
  • ORK 2 Hub
    • Tutorials
    • Plugins
    • API
  • Support
  • Forum
  • Get ORK
  • Contact
  • Blog
  • Makinom
  • gamingislove.com
Categories
  • News (73)
  • ORK 2 (137)
    • Tutorial (137)
      • Game tutorial (50)
      • Gameplay (32)
      • How-to (55)
  • Release (156)
Search

© 2015 Gaming is Love e.U.

Disclosure: This site may contain affiliate links, which means I may receive a commission if you click a link and purchase something that I have recommended. While clicking these links won’t cost you any money, they will help me fund my development projects while recommending great assets!