LogoLogo
API Status
  • 👋Welcome
  • 🌐What is Morpheus Platform?
    • Interoperability
  • ℹ️Help
    • 📗Glossary
    • 🆘Support
    • Firewall problems
    • EULA
  • 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
      • 📚Features & Guides
        • 📒Example Plugin
          • Nameplates
          • In-game roles
        • 🏊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
        • 💠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
          • 🖥️Version History
        • ⚙️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
      • 📚Useful Reading
        • ⭐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 Reqs
      • 🎥Broadcast
        • 📹OBS Integration
      • Failover
      • 🏁Capacity And Queue Management
  • ADMINS
    • 👪Access Control
      • Adding metaverse contributors
      • Creating a new project
    • 💲Pricing
      • Development Support
      • Included Usage & Overages
      • Cloud Streaming
      • Access Modes
      • War Room Support
      • Platform SLA
    • ⚙️Settings
      • 🗃️Projects
  • APIs and Tooling
    • 👩‍💻Introduction
    • 🖥️API Reference
      • Accounts
      • Datasources
      • Events
      • Key/Value Store
      • Organizations
      • Realtime
      • Sessions
      • User Profile
      • World Builder
      • Worlds
    • 📦Frontend SDKs
      • 📄Version History
      • Pixel Streaming
    • 🚀Launcher
  • Integrations
    • 📊Analytics
      • Sending events from web
      • 🎮Sending Events from Unreal
    • 💬Chat
      • 🎮Integrating Pubnub with your Unreal Project
      • Adding Moderation to Chat
Powered by GitBook
On this page

Was this helpful?

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

Public Purchasable Guide

The page outlines a detailed guide on setting up your own purchasable items.

Last updated 12 months ago

Was this helpful?

Purchasable items can be added by creating and configuring M2_PurchaseablePrimaryAssets. The main purpose of this asset type is to encapsulate: what the purchasable does when purchased and data regarding how the purchasable should be represented/displayed. You can configure what the purchasable item does at different steps of the transaction the purchase executors. These are UObjects with overridable events that allow you to specify custom logic.

Purchasable data asset properties:

  • Display Name - The name of your purchasable. By default, this is the name that will appear in places such as the vending machine.

  • Purchase Requested Executor - This is fired when a player attempts to purchase this item.

  • Purchase Predicted Success Executor - This executor is fired when we believe a transaction will go through successfully.

  • Purchase Confirmed Executor - The transaction has been approved and actioned by M2 Connect.

  • Purchase Rejected Executor - The transaction has been rejected and ignored by M2 Connect.

  • Can Purchase Executor - Configurable logic allowing you to encapsulate when the purchasable item is allowed to be purchased. Note: this is not used in Origin internal. It is mostly meant to be used in UI to hide or show purchasable items when appropriate.

  • Custom Details - Allows you to add any additional data you might need for your purchasable items through custom instanced UObjects. This could be used to associate an icon with your purchasable items for us in UI.

Purchase Executors

We need to create executors for our purchasables so that they do something meaningful when purchased. Each purchase executor has it’s own specific asset type associated with it (“Purchase Confirmed Executor” - M2_PurchaseConfirmedExecutor etc). We will take a look at the example BP_PurchaseConfirmedExecutor_AddInventoryItem blueprint to see how executors are constructed.

It is important to consider that executors can be called on client and/or server.

Each executor has an Execute function. This is where we will add our custom logic. This function has the following arguments:

  • PurchaseId - This will most likely not be useful to you.

  • Purchaser - the morpheus actor associated with the purchase.

  • Purchasable - A UObject the contains all data about what is being purchased.

  • Callback - A callback to be executed that informs Origin if the executor succeeded, failed or was unhandled. This should be called once in every code path. If the exector logic is not meant to be processed at all i.e. we should not process the logic because we are on client, we should use unhandled. An example of this is shown below.

In the example purchasable primary data asset, you can see that this purchasable item is configured to use the BP_PurchaseConfirmedExecutor_AddInventoryItem. This setup will trigger an object to be added to a players inventory when the purchasable item is purchased. The item added is configurable. Executors should be made configurable through properties whenever possible to improve their re-usability.

🎮
📚
🎒
Example purchasable primary data asset
BP_PurchaseConfirmedExecutor_AddInventoryItem executor