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
  • ORK 4 Unity Quickstart Tutorials (3D)

19 Inventory & Loot

In this tutorial we’ll add items and a currency to the game.

Items can do the same things abilites can, but are (usually) consumables that are removed from the inventory upon use. You can also create non-consumable and even non-useable items, e.g. for quests or crafting recipes.

Currency can be used to purchase things in shops, to pay for status upgrades (e.g. via research trees) and more.

We’ll set up multiple inventory-related things:

  • content types
  • inventory settings
  • currency
  • 5 items (potions)
  • loot
  • start inventory

Let’s get to it!

Content Types #

We’ll start with adding new content types.

Open the ORK editor and navigate to Content > Content Types. We need a content type for potions, equipment and valueables – the default setup already contains Equipment, so we need to add 2 more content types.

8: Potions #

Content Information #

  • Name
    Set to: Potions

Base Settings #

  • Damage Type
    Select: Default
    The damage type manages which animations will be used on targets to animate damage, evade, etc.

The Target Selection Settings define which targets are available to abilities and items of this type. Potions should target a single ally

  • Target Selection Type
    Select: Default Ally > Ally Single

9: Valueables #

Copy the Potions content type and change the following settings.

Content Information #

  • Name
    Set to: Valueables

Inventory Settings #

Navigate to Inventory > Inventory Settings, we’ll check how the inventory system is set up. You can learn more about the inventory settings in this documentation.

We’ll use the group inventory (i.e. all combatants in a group share the inventory), auto stack items and equipment and not use any kind of quantity or stack size limit – so, we’ll stick with the default setup of a new project.

  • Inventory Type
    Select: Group
  • Item Stack Type
    Select: Auto Stack
    Items will automatically stack when added to the inventory.
  • Equipment Stack Type
    Select: Auto Stack
  • Limit Quantity
    Disable
  • Limit Stack
    Disable

Default Item Prefab #

We’ll set up the default item prefab that’ll be used by all items, equipment, etc. – individual items/equipment/etc. can optionally override that to use a different prefab.

  • Item Prefab
    Select: Item

This prefab is a simple object with a Box Collider (for being able to interact with it) and a particle effect to make it noticable.

If you use a different prefab, check where the object’s root position is, i.e. local X=0, Y=0, Z=0. The Item prefab used here is set up to have that position at the bottom of the collider. If the prefab’s root position would be somewhere else, e.g. in the center of a collider, you can use the Spawn Offset to adjust for that position, otherwise items could spawn in the ground.

Currencies #

Next, we’ll set up the currency for our game. You can add multiple currencies, but we’ll just use one.

Navigate to Inventory > Currencies and select the Default currency.

Content Information #

  • Name
    Set to: Gold
  • Sprite (Icon)
    Select: icons_116

Click on the Find TMP Tag button to get the icon’s tag for displaying it in texts (via text codes). This uses TextMesh Pro’s sprite asset setup.

Base Settings #

  • Content Type
    Select: Valueables

Potion #

Our first item will be a potion to restore some HP.

Navigate to Inventory > Items, we’ll change the Default item.

Content Information #

  • Name
    Set to: Potion
  • Description
    Set to: Restores 100 HP
  • Sprite (Icon)
    Select: icons_164

Click on the Find TMP Tag button to get the icon’s tag for displaying it in texts (via text codes). This uses TextMesh Pro’s sprite asset setup.

Base Settings #

  • Content Type
    Select: Potions

Price Settings #

You can set a price to purchase the potion in shops here. We don’t add a shop in this tutorial series, but we’ll still set up a price.

  • Sellable
    Enable
  • Buy Price
    Select: Value > Value
    Set the value to: 5

The default sell price is set to 50% of the buy price, we’ll stick with that.

Use Settings #

  • Useable In
    Select: Both

Animation Settings #

We’ll use the Use schematic and replace the prefab and audio asset.

Click on Add Battle Animation.

  • Schematic Asset
    Select: Use

Resource Overrides #

Click on Add Prefab Override.

  • Auto Destroy After Time
    Enable
  • Time
    Set to: 3
  • Prefab
    Select: HealEffect

Click on Add Audio Clip Override.

  • Audio Asset
    Select: bottle

Use Costs #

  • Consume
    Enable
  • Auto Consume
    Select: On Selection
    This’ll automatically remove the item from the user’s inventory when selecting a target (i.e. when the action was registered with the system)
    You can also use other options, e.g. consuming it when the outcome is calculated (select No for that).

Target Settings #

Target Selection Settings #

We’ll use the potion content type’s setup.

  • Use Content Type
    Enable

Target Changes #

Click on Add Target Change.

Click on Add Status Change.

  • Change Type
    Select: Status Value
  • Status Value
    Select: HP
  • Operator
    Select: Add
  • Change Value
    Select: Value > Value
    Select: 100

High Potion #

The high potion does the same as the potion – it just heals more HP.

Copy the Potion item and change the following settings.

Content Information #

  • Name
    Set to: High Potion
  • Description
    Set to: Restores 500 HP
  • Sprite (Icon)
    Select: icons_167

Click on the Find TMP Tag button to get the icon’s tag for displaying it in texts (via text codes). This uses TextMesh Pro’s sprite asset setup.

Base Settings > Price Settings #

  • Buy Price
    Select: Value > Value
    Set the value to: 20

Target Settings > Target Changes > Target Change 0 > Status Change 0 #

  • Change Value
    Select Value > Value.
    Set the value to 500.

Magic Potion #

The magic potion restores MP instead of healing HP.

Copy the High Potion item and change the following settings.

Content Information #

  • Name
    Set to: Magic Potion
  • Description
    Set to: Restores 50 MP
  • Sprite (Icon)
    Select: icons_155

Click on the Find TMP Tag button to get the icon’s tag for displaying it in texts (via text codes). This uses TextMesh Pro’s sprite asset setup.

Base Settings > Price Settings #

  • Buy Price
    Select: Value > Value
    Set the value to: 15

Animation Settings > Battle Animation 0 > Resource Overrides #

We’ll change the prefab.

  • Prefab
    Select: StarEffect

Target Settings > Target Changes > Target Change 0 > Status Change 0 #

  • Status Value
    Select: MP
  • Change Value
    Select: Value > Value
    Set the value to: 50

Revive Potion #

The revive potion revives the target and restores a 50 HP.

Copy the Potion item and change the following settings.

Content Information #

  • Name
    Set to: Revive Potion
  • Description
    Set to: Revives the target with 50 HP
  • Sprite (Icon)
    Select: icons_173

Click on the Find TMP Tag button to get the icon’s tag for displaying it in texts (via text codes). This uses TextMesh Pro’s sprite asset setup.

Base Settings > Price Settings #

  • Buy Price
    Select: Value > Value
    Set the value to: 25

Animation Settings > Battle Animation 0 > Resource Overrides #

We’ll change the prefab and audio clip.

  • Prefab
    Select: ReviveEffect
  • Audio Asset
    Select: blessing2

Target Settings #

Target Selection Settings #

We need to be able to target dead combatants – let’s limit the use on dead combatants.

We’ll set up a Custom target selection, but you can also set up a new target selection template (or later create a template out of the custom setup).

  • Target Selection Type
    Select: Custom
  • Target Type
    Select: Ally
  • Target Range
    Select: Single
  • Is Dead
    Select: Yes
    If you select Ignore you can also target alive combatants.

Target Changes > Target Change 0 > Status Change 0 #

Copy status change 0 before changing it.

  • Change Type
    Select: Revive
    This will remove the death state from the target – but it doesn’t change it’s HP.
    Make sure to always change a combatant’s health after reviving, or it’ll immediately die again.

Target Changes > Target Change 0 > Status Change 1 #

  • Change Value
    Select: Value > Value
    Set the value to: 50

Cure Potion #

The cure potion will remove all negative status effects.

Copy the Potion item and change the following settings.

Content Information #

  • Name
    Set to: Cure Potion
  • Description
    Set to: Removes all negative effects
  • Sprite (Icon)
    Select: icons_185

Click on the Find TMP Tag button to get the icon’s tag for displaying it in texts (via text codes). This uses TextMesh Pro’s sprite asset setup.

Base Settings > Price Settings #

  • Buy Price
    Select: Value > Value
    Set the value to: 3

Animation Settings > Battle Animation 0 > Resource Overrides #

We’ll change the prefab and audio clip.

  • Prefab
    Select: CureEffect.
  • Audio Clip
    Select: bubble2

Target Settings > Target Changes > Target Change 0 > Status Change 0 #

Instead of changing a status value, we’ll change status effects.

  • Change Type
    Select: Status Effect
  • Change
    Select: Remove
  • Use Content Type
    Enable
    We’ll remove based on the status effect’s content type.
  • Content Type
    Select: Negative
  • Remove Type
    Select: All

Loot #

Loot allows setting up different loot tables, optionally based on level checks or other conditions, e.g. an enemy can drop a regular Potion for level 1 to 25 and a High Potion for level 26 to 50.

We’ll set up 2 loot tables for our enemies to give gold and potions as battle spoils, without any level checks or other conditions.

Navigate to Inventory > Loot, we’ll change the Default loot and add another new loot.

Gold #

We’ll give a random amount of gold between 1 and 20.

  • Name
    Set to: Gold

Loot Table 0 #

Click on Add Loot Table.

Click on Add Item in the Loot Settings.

  • Type
    Select: Currency
  • Currency
    Select: Gold
  • Quantity
    Select: Value > Random
    Set the 1st value to: 1
    Set the 2nd value to: 20

Potion #

Add a new Loot setup.

  • Name
    Set to: Random Potion

Loot Table 0 #

Click on Add Loot Table.

We’ll add multiple potions and randomly get one in the Loot Settings.

  • Draw Type
    Select: Random
    We’ll get one of the defined items randomly – the individual item’s chance check is still used.

Click on Add Item.

  • Type
    Select: Item
  • Item
    Select: Potion
  • Quantity
    Select: Value > Value
    Set the value to: 1
  • Chance
    Select: Value > Value
    Set the value to: 75

Copy the Potion item.

  • Item
    Select: Magic Potion
  • Chance
    Set the value to: 40

Copy the Magic Potion item.

  • Item
    Select: Cure Potion
  • Chance
    Set the value to: 30

Copy the Cure Potion item.

  • Item
    Select: High Potion
  • Chance
    Set the value to: 20

Copy the High Potion item.

  • Item
    Select: Revive Potion
  • Chance
    Set the value to: 10

Combatants General Settings #

We’ll add the loot as default loot for all combatants.

Navigate to Combatants > Combatants and select the General Settings.

Inventory & Equipment > Loot Settings #

We’ll use both Gold and Random Potion as loot.

  • Loot Origin
    Select: Loot

Click on Add Loot.

  • Loot
    Select: Gold

Click on Add Loot again.

  • Loot
    Select: Random Potion

Player Start Inventory #

We’ll add some items to the start inventory of our player combatant.

Select the Fighter combatant.

Inventory & Equipment > Start Inventory #

Click on Add Item.

  • Type
    Select: Currency
  • Currency
    Select: Gold
  • Quantity
    Select: Value > Value
    Set the value to: 50

Click on Add Item.

  • Type
    Select: Item
  • Item
    Select: Potion
  • Quantity
    Select: Value > Value
    Set the value to: 5

Copy the Potion item.

  • Item
    Select: Magic Potion
  • Quantity
    Set the value to: 3

Copy the Magic Potion item.

  • Item
    Select: Cure Potion

Copy the Cure Potion item.

  • Item
    Select: High Potion
  • Quantity
    Set the value to: 1

Copy the High Potion item.

  • Item
    Select: Revive Potion

Save Changes #

And that’s it for now!

Save the changes using the Save Settings button at the bottom of the editor.

Testing #

Hit play and start a battle.

You now have items available and can use them in battle.

And we get loot from killed enemies.

 

Next, we’ll add equipment.

Table of Contents
  • Content Types
    • 8: Potions
      • Content Information
      • Base Settings
    • 9: Valueables
      • Content Information
  • Inventory Settings
    • Default Item Prefab
  • Currencies
    • Content Information
    • Base Settings
  • Potion
    • Content Information
    • Base Settings
      • Price Settings
    • Use Settings
    • Animation Settings
      • Resource Overrides
    • Use Costs
    • Target Settings
      • Target Selection Settings
      • Target Changes
  • High Potion
    • Content Information
    • Base Settings > Price Settings
    • Target Settings > Target Changes > Target Change 0 > Status Change 0
  • Magic Potion
    • Content Information
    • Base Settings > Price Settings
    • Animation Settings > Battle Animation 0 > Resource Overrides
    • Target Settings > Target Changes > Target Change 0 > Status Change 0
  • Revive Potion
    • Content Information
    • Base Settings > Price Settings
    • Animation Settings > Battle Animation 0 > Resource Overrides
    • Target Settings
      • Target Selection Settings
      • Target Changes > Target Change 0 > Status Change 0
      • Target Changes > Target Change 0 > Status Change 1
  • Cure Potion
    • Content Information
    • Base Settings > Price Settings
    • Animation Settings > Battle Animation 0 > Resource Overrides
    • Target Settings > Target Changes > Target Change 0 > Status Change 0
  • Loot
    • Gold
      • Loot Table 0
    • Potion
      • Loot Table 0
  • Combatants General Settings
    • Inventory & Equipment > Loot Settings
  • Player Start Inventory
    • Inventory & Equipment > Start Inventory
  • Save Changes
  • 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!