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
  • Integration
  • Creating a currency
  • Online Mode
  • Offline Mode
  • How to enable

Was this helpful?

  1. CREATION
  2. Unreal Development
  3. Features & Guides
  4. Accounts

Account Balances

Last updated 10 months ago

Was this helpful?

Experimental - Customers are encouraged to test and use this feature in their experiences, but it may still require some additional support

Overview

The inventory system supports items being assigned a quantity. By reading and writing the quantity number you can implement various in-game balances and currencies, and things like:

  • Metagame numbers such as XP, Ranks, High Scores

  • Consumables, such as potions

  • Achievement progress amounts

Integration

The currency system currently supports two types of currencies, online and offline. Online currencies persist in a player's Collection, and in turn persist across deployments and events. Offline currencies doesn't interact with the user's collection and so don't persist, but can be used for transient currencies or point systems.

Creating a currency

To create a currency, create a new Data Asset of type J_CurrencyTypePrimaryAsset. Once that has been created, open it up and fill in the details. If you want this to be an "online" currency then tick the IsCollectionCurrency check box. You will also need to fill in DataSourceId and ObjectId - refer to the Online Mode section to see where to get those details. If you are making an offline currency then leave these two blank, and IsCollectionCurrency unselected.

Online Mode

Online currencies require an object definition to be created in the back end. If your project supports it, you may be able to create a user collection object yourself using the web UI - simply add a new object into a non-public collection with some kind of asset (usually a thumbnail image), and ensure it has a currency property by entering { "currency" : "" } in the Properties section.

The DataSourceId and ObjectId for your object can be seen in the Datasource view as shown:

Alternatively, contact a member of the platform team and a Support Engineer can create the object for you. Once they have created the object definition, they will be able to inform you of the DataSourceId and ObjectId to use.

Using an online currency also requires that user collections are enabled on the server. Ensure that the following game live config value is enabled: UserCollection.EnabledOnServers

Offline Mode

For an offline currency this isn't required - simply fill in the standard details in the data asset and you can start using it.

How to enable

Your player Morpheus blueprint should already inherit from BPM_M2_BasePlayerCharacter. In this case it will already have a wallet component attached.

To interact with the players wallet you use the J_CurrencySubsystem. This has functions to get, give and take currency from the player's wallet. Examples of each of those can be seen below. Getting a currency can be done on a client, but giving or taking must be done from the server.

Note: Currently due to limitation of the collection system, getting a currency can only be done on the client if it is an online currency. You may receive a message saying "User collection service is invalid" when you run the editor in offline mode.

To make sure the balance is updated, you will need to turn on User Collection Polling using the setting UserCollection.Polling.ClientEnabled - see how to overrride this.

Live Config
here
Adding a new Currency object
Datasource and Object IDs
Example of getting a currency
Example of giving currency
Example of taking currency