Skip to content

Open Shop

Open Shop

Opens a shop user interface, allowing the player to buy and sell items.

Properties

System

Name Explanation Type
Local When enabled, the shop's unique ID is stored in a local variable. When disabled, it is stored in a global variable. Toggle
Shop The shop configuration, including categories, items, and pricing modifiers. Shop
Shop Template The user interface to use as the shop template. User Interface
Store ID When enabled, the shop's unique ID is stored in a variable for later reference. Toggle
Variable Index The variable index to store the shop's unique ID in. Number

Examples

Open a Shop with a User Interface Template

This opens a shop using the specified user interface template GUID. The shop block configures buy and sell modifiers, permissions, and item categories.

access_shop("00000000-0000-0000-0000-000000000001") {
    buy_modifier: 100
    sell_modifier: 50
    is_buy_allowed: true
    is_sell_allowed: true
};
{"Data":{"Index":0,"IsLocal":false,"ShopID":"00000000-0000-0000-0000-000000000001","Shop":{"Name":"","BuyModifier":100,"SellModifier":50,"IsBuyAllowed":true,"IsSellAllowed":true,"UseVariable":false,"IsLocal":false,"VariableIndex":0,"Categories":[],"Metadata":null},"StoreID":false,"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Shop.AccessShopCommand"}

Open a Shop and Store Its Unique Identifier

This opens a shop and stores its unique ID in Global Variable 0 for later reference by other shop commands.

$gv[0] = access_shop("00000000-0000-0000-0000-000000000001") {
    buy_modifier: 100
    sell_modifier: 50
    is_buy_allowed: true
    is_sell_allowed: false
};
{"Data":{"Index":0,"IsLocal":false,"ShopID":"00000000-0000-0000-0000-000000000001","Shop":{"Name":"","BuyModifier":100,"SellModifier":50,"IsBuyAllowed":true,"IsSellAllowed":false,"UseVariable":false,"IsLocal":false,"VariableIndex":0,"Categories":[],"Metadata":null},"StoreID":true,"Metadata":null},"TypeName":"MAR.Game.RPGCore.Models.Scripts.Commands.Shop.AccessShopCommand"}