LogoLogo
What's new?StatusMSquared
  • Morpheus Platform Documentation
  • What is Morpheus Platform?
    • Glossary
    • Interoperability
    • Support
    • EULA
  • Firewall Problems
  • CREATION
    • Unreal Development
      • Get Started
        • Download the Editor
        • Upload Content
        • Creating your Own Map
        • Morpheus Base Project
        • Differences from Unreal
          • Character Configuration
        • Morpheus Networking
          • Introduction to Morpheus Networking
          • Network Levels
          • Replicated Properties
          • RPCs
          • Morpheus Render Targets
          • Morpheus Array
          • Networking FAQ
          • Replicating Sublevels
      • Editor Versions
      • Performance Guarantees
      • Features & Guides
        • Example Plugin
          • Nameplates
          • In-Game Roles
          • Resizing
        • Actor Pooling
        • Audio
        • Avatars
          • Creating an Avatar
          • Attachments
            • MML Attachments
          • Custom Animation Variables
          • Importing an NFT Collection
          • Capsules and Mesh Transforms
        • Bots
        • Chat
          • Unreal Text Chat
        • Control Panels
          • Control Panel Configuration
          • DJ Booth Mission Control
          • Observer Controls
        • Crowd Audio
        • Crowd Rendering
          • Legacy Animated Crowd
            • Animated Crowd Console Commands
            • Attaching static meshes to crowd members
          • Crowd Materials
          • Performance Parameters
          • Live Config Settings
          • Crowd Animation
            • Crowd Anim Blueprint
              • User Guide - Crowd Anim Blueprint
              • Reference Guide - ABP Nodes
                • Animation Playback
                • States and State Machines
                • Variables
                • Transitions
                • Special
                • Blends
                • Additional Notes
        • Helpers & Extras
          • "Instanced Objects" in Blueprints
          • Objects with "world context"
          • Making DataAsset classes
          • Duplicate Objects
          • The Bootflow Subsystem
          • The "Wait For Condition" System
          • Advanced Graphics Settings
          • Listening to Inputs on UObjects
          • Morpheus UserID
          • World Services
          • M2Extras: Skins System
        • Loading Screen
        • Live Config
          • Editing for a World
          • Editing Locally
          • Default Settings
          • Accessing via Blueprint
          • Adding New Settings
          • Overriding Defaults
          • Using Arrays
        • MML
        • Motion Capture
        • Networking
        • Notifications
        • Raycastable Crowd
        • Singletons
        • Streaming & Multiplatform
          • GFN on Mobile
        • UI
          • "UI Mode"
        • User Collections
          • Creating a New Object Definition
          • Accessing from Unreal
            • Creating Objects Definitions
            • Transfer Objects
            • User Collection Views
            • Receiving Updates
        • Video Players
          • Embedded Video Player
          • Millicast video streaming
            • How to Setup an In-Game Video Stream
            • Picture-in-Picture mode
          • Streaming Video Player
            • How to Setup a URL Video Player
            • Picture-in-Picture mode
        • Visual Debugging
          • Inspector
        • Web UI
        • Online Services
          • KV Store Service
        • Web Requests
          • Http Requests
            • Legacy HTTP Nodes
          • JSON Handling
          • WebSockets
          • Identity Validation
          • Allowed External URLs
          • Walkthrough Example
            • Example Counter Service
        • World Travel
          • World Travel in the Editor
        • Avatar Physics Assets
        • Action Gameplay Helper Components
      • Workflows
        • Upgrade the Editor
        • Editing Project Settings
        • Profiling
        • Marketplace Importing
        • Extra Workflows
          • Setup Play-in-Editor
          • Setup Local Asset Validation
          • Adding Gameplay Tags
          • Validating Game Assets
          • Custom Connection Modes
          • Connect Editor to a World
          • Common Issues
      • Best Practices
    • Worlds
      • Invite Players
        • Setting Role Groups
      • Persistent Worlds
      • Always on Worlds
    • Running Events
      • Large Scale Events - Checklist
      • Anti-Cheat (EAC)
      • Player Entry
        • React Native
        • Steam
        • Hardware Requirements
      • Broadcast
        • OBS Integration
      • Failover
      • Capacity and Queue Management
  • ADMINS
    • Access Control
      • Add Metaverse Contributors
      • Create a New Project
    • Pricing
      • Development Support
      • Included Usage & Overages
      • Cloud Streaming
      • Access Modes
      • War Room Support
      • Platform SLA
    • Settings
      • Projects
  • APIs and Tooling
    • API Reference
      • Accounts
      • Events
      • Key/Value Store
      • Organizations
      • Realtime
      • User Profile
      • World Builder
      • Worlds
    • Template Web App
      • Moderation
    • Pixel Streaming
    • Launcher
  • Integrations
    • Analytics
      • Send Events from Web
      • Send Events from Unreal
    • Chat
      • Integrate Pubnub with your Unreal Project
      • Add Moderation to Chat
Powered by GitBook
On this page
  • Overview of the Inventory System
  • How to make a Quickbar Item
  • Make the item
  • Add the item to the Quickbar
  • Give the item an ability
  • Setting the UI for the item
  • Quickbar Examples
  • The Pointer
  • Quickbar Item Demo Video

Was this helpful?

  1. CREATION
  2. Unreal Development
  3. Features & Guides
  4. Gameplay Content
  5. Morpheus Ability System

Inventory and Quickbar

Last updated 8 months ago

Was this helpful?

NOTE: This page has been deprecated, in favour of

Overview of the Inventory System

  • Item: See How to Make an Quickbar Item for details on how these are represented.

    • Of these, some are considered “Use Items” - these are items that can be equipped/added to your Quickbar, and have actions that can be performed when selected.

  • Inventory: This is a list of all the Items you own (use items and other types).

    • Later down the line, we will want ways of viewing this, but for now it’s hidden away.

  • Equipment: This is a list of Use Items (Items with Use Item Details) from your inventory.

    • These “equipped” use items are what are then displayed in your Quickbar

    • Of these equipped items, one can be “selected” - this marks it as the active item, to then perform functionality on e.g. mouse click.

  • Quickbar: This is a visualization of your currently equipped items.

NOTE: Currently the icons in the quickbar are wrong (due to us not having the correct icons yet. The controls are:

  • Q - unequip

  • 1 - equip slot 1

  • 2 - equip slot 2

  • 3 - equip slot 3 (if we increase Inventory.MaxEquipmentSlots to 2)

How to make a Quickbar Item

Make the item

  • An item is defined using a J_ItemPrimaryAsset.

  • If you want to make a new item, use Right Click -> Miscellaneous -> Data Asset.

  • The main fields to consider are the Display Name, the Icon, and the Custom Item Details (see Custom Item Details)

  • In the Custom Item Details list, add a J Use Item Details entry. This is used to provide the details required by use items. If no J Use Item Details object is provided, the item will not be treated as a “Use Item”, so will not be allowed on your quickbar.

  • Once the Use Item Details has been provided, you can provide use item specific details, such as the abilities and UI associated with the item (see Give the item an ability)

Custom Item Details

If you want your item to be interpreted as a specific “item type”, or have additional details that aren’t present in a base item, you can create a new item detail type, and add it to this list.

  • When you make the item detail type, make it inherit from J_ItemDetailsBase

  • When you do this, your new detail type can be added to the list, and any variables in this type can be configured from the J_ItemPrimaryAsset

  • You can then access the detail from a given item asset, using the GetCustomItemDetails function. This will return null if the item asset does not contain those details (so this can also be used to check whether the item is of the specified type - e.g. you can check for the presence of J_UseItemDetails to know whether the item is a use item.

Add the item to the Quickbar

Having items in your “starting inventory”

This is the currently desired use case - when you switch to a particular role, your Quickbar is automatically set up, with a defined list of items

  • In the appropriate roles data table, add the item assets you want to the Starting Inventory Assets list.

    • For now, we’re only wanting non-participants to have Quickbar items, so the place to add this is the non-participant roles (e.g. Presenter), in the DT_Parkland_Roles table.

    • The entries in the list are the “Item Assets” made in the previous section

  • Once these have been updated, you can switch to the role (e.g. using /role presenter correctflipcarrot in the text chat) and your Quickbar should be automatically set up.

  • NOTE: The Inventory.Enabled live config flag must be set to true for your Quickbar to be displayed

  • NOTE: The number of slots in your Quickbar/equipment is controlled by live config (Inventory.MaxEquipmentSlots). For now we're wanting the slots to match the number of items (so we don’t have any empty slots), but this may change later.

  • NOTE: By default, if you don’t have any items equipped, your Quickbar is hidden. If you don’t want this behavior, you can turn off the Inventory.Quickbar.HideIfEmpty feature flag.

What’s going on under the hood

When you switch to a role with a starting inventory, a few things happen:

  • The items are added to your Inventory

  • The items are Equipped (added to your quickbar from your inventory)

  • (Also, if switching from a role which had a starting inventory, those items are removed first)

Using the console (for testing purposes only)

We also have some console commands for testing out the inventory system, for e.g. granting and equipping different items:

  • Juno.Inventory.AddItems [ItemName list, separated by spaces - will add the item(s) to your inventory. e.g. Juno.Inventory.AddItems PDA_Item_Pointer PDA_Item_Coin

    NOTE: Adding an item to your inventory will not automatically add it to your quickbar, since it doesn’t default to being “equipped”.

  • Juno.Inventory.RemoveItem [ItemName] - will remove the item from your inventory

  • Juno.Inventory.EquipItem [ItemName] - provided the item is in your inventory, equip it (which will add it to your quickbar)

  • Juno.Inventory.SelectItem [ItemName] - selects the item, provided it is equipped (functionally the same as pressing e.g. 1, 2, 3 to select the appropriate item)

Doing it manually

This is possible, but not currently a desired use case. I’ll expand on this section later as other approaches for adding items/equipment become necessary

Give the item an ability

There are 2 ways to link an item to some functionality:

Simple items

For items that don’t have custom behavior, and just need to have e.g. “do ability X on mouse click”, this will work:

  • In the Item primary asset, in the Use Item Details, set the Item Executor Class to J_ItemExecutorBase

    • This gives it the basic functionality of “Left click → Execute Ability 1”, “Right click → Execute Ability 2” (if the abilities are provided)

    • See The ItemExecutor

  • In the Ability Assets list, add the ability assets you want to use. The asset at index 0 will be executed on Left Click, and the asset at index 1 will be executed on Right Click (if it exists)

  • Set the Quickbar Widget Class to display the appropriate UI for your item.

    • (If you’re experimenting with a feature, and don’t want to deal with UI yet, WBP_QuickbarWidget_Base should work fine as a placeholder)

Bespoke items (using a custom ItemExecutor)

For items that want to do something more complicated than just executing an ability (e.g. if you want to modify a parameter on the ability on Right Click), you’ll want to use this.

  • In the Item Asset,

    • Leave the Ability Assets and Quickbar Widget Class fields blank.

    • Make a new Item Executor (A new blueprint that extends J_ItemExecutorBase, and set the Item Executor Class to that.

  • You can then control the behavior of the equipped item through the new Item Executor. See the section below for details on how this is done:

The ItemExecutor

The ItemExecutor is the class that handles what functionality is done when a given item is selected. It has the following details that can be overridden in blueprints, to make your item do specific functionality:

  • Class Defaults → Specify Abilities:

    • If this is true, we will control the abilities used by the item here, in the Ability Assets field. (It will ignore any abilities defined in the Item Asset)

    • This is useful if the Item Executor expects/depends on a particular ability for the given item.

  • Class Defaults → Override Widget Class:

    • Same as above, if this is set, it will ignore the widget used in the Item Asset, and use this one here.

  • Event Initialize Executor:

    • This is an overridable event called after the item in your Quickbar has been selected, once the executor has been set up, and has loaded all the abilities.

    • You can use GetAbilitiesList after this point to get the loaded abilities defined from the Ability Assets list.

  • Event Primary Input:

    • This is an overridable event called when the primary input (currently Left Mouse Click) is modified - Pressed = true when it is pressed, Pressed = false when the button is released.

    • By default, this event will execute the first ability in the abilities list (if one exists). If you want this behavior (e.g. you have an ability, and want left click to perform the ability), you don’t need to implement the event.

    • If you want other behavior on left click pressed/released (e.g. clicking modifies an ability, that right click then performs), you can override the event.

  • Event Secondary Input:

    • Same as Event Primary Input, but on the secondary input (currently Right Mouse Click). By default, it’ll attempt to execute the second ability in the abilities list, if there is one.

Setting the UI for the item

When a Quickbar item is selected, it’ll attempt to create a J_QuickbarExecutorWidget for that item, defined either in the Quickbar Widget Class on the Item Asset, or the Override Widget Class in the Item Executor. If you want to provide specific UI for your use item, create a widget extending J_QuickbarExecutorWidget. This can be used to display controls for using the item, or adding extra details about the item, e.g. displaying the color of the ability, controlled in the ItemExecutor.

The Widget blueprint has the following details that can be overridden:

  • Event Notify Item Executor Ready - this is called when the item executor (and its abilities) has been set up. Initialization logic for the widget should be done here, if it depends on the existence of the item executor. (e.g. listening to updates on the status of the ability)

Quickbar Examples

The Pointer

  • The item asset: PDA_Item_Pointer

    • It leaves the Quickbar Widget Class and Ability Assets fields blank, since these will be provided in the bespoke BP_ItemExecutor_Pointer (see Bespoke items (using a custom ItemExecutor))

  • The Item Executor: BP_ItemExecutor_Pointer

    • It has overrides for the ability assets and quickbar widget, since the pointer expects a particular ability (PDA_Ability_Ping) and associated UI (WBP_QuickbarWidget_Pointer)

  • It doesn’t override Event Primary Input, since it uses the base behavior of activating the first ability in the list (PDA_Ability_Ping)

  • It does override the Event Secondary Input, to update the color that the ability uses. (See BP_PingAbility to see how the ability itself works)

  • It has a On Ping Color Updated event that it broadcasts when the color changes, so that the UI knows to change the “current color”

  • We update Event Initialize Executor to handle setup - casting the primary ability to the BP_PingAbility, and informing the UI of the color

The Quickbar Widget: WBP_QuickbarWidget_Pointer

  • (NOTE: This example widget was taken before a proper art pass, so the actual visuals & setup will likely have changed)

  • Has simple input prompts on the bottom left

In Event Notify Executor Ready, it listens to the OnColorUpdated event from the item executor, to update the “current color” shown in the prompt.

Quickbar Item Demo Video

The following is the recording of a meeting where we went through the following steps, to make an item with a basic ability:

NOTE: This demo video was made 09/06/2022, so some of the steps have since changed. These are as follows:

  • The UseItemDetails is now no longer present on the J_ItemPrimaryAsset by default. Instead, it is a “custom item detail” extending from UJ_ItemDetailsBase, and is added to the CustomItemDetails list. See Make the item for the updated steps on how to set this up.

NOTE: This flow assumes the abilities themselves have already been created. For guidance on how to make abilities, see the following documentation:

The default behavior for this event is to “” all the abilities (e.g. to turn on targeting or the like). If you don’t want this behavior, don’t call Parent: Initialize Executor - you can instead manually call Handle Activate when you want.

Morpheus Abilities
activate
The Inventory System
The UI here is all placeholder, but this is a visualisation of your Quickbar - you have the “Pointer” and “Impulse Glove” items, but currently neither is “selected”
In the designer view, set up any widgets you want
When no item is selected, the UI is not shown
When the item is selected, the specific widget for that item is displayed