Skip to main content

Shop

Shop is a virtual location where players can purchase items, upgrades, or in-game currency using either real money or in-game currency. The specific items available for purchase in a shop can vary depending on the game, but often include things like weapons, armor, power-ups, and cosmetic items like clothing or accessories for the player character. The purchased items may then be added to the player's inventory or equipped to the player character for immediate use.

Example Shop image.

Overall, a shop in a game can be an important feature for players who want to acquire new items or improve their in-game experience. It can provide a sense of progression and accomplishment as players work towards obtaining the items they want.

Setup Shop

Blueprint

  • Open Liveops tools and select blueprint data on the sidebar (https://liveops.oneb.tech/blueprints)
  • Locate and select the blueprint named Shop.
  • You can change any value or change this template if you want. please refer to the following instructions

Game scripts

  • Open Liveops tools and select Game Scripts on the sidebar (https://liveops.oneb.tech/gamescripts)
  • Select script name Shop
  • The script provides the following functions:
    • getList: This function retrieves a list of items for the current player.
    • buyItem: this function is used when buying an item. The item will be added to the inventory.

Code client

// Get list
var shops = await OnlineManager.Instance.API.Send<Shop>(new GetBlueprintObjectCommand("Shop"));
// Buy an item
var buyInfo = await OnlineManager.Instance.API.Send<ShopBuyItemOutput>(new CallGameScriptCommand<ShopBuyItemInput>("Shop", "BuyItem", input1));

Example code: shop.cs