Overview
The Generic Inventory System (GIS) provides a complete currency and shop system, laying the foundation for building an in-game economy.
Currency System
Currency System Component
To enable in-game units to hold currency, add the GIS_CurrencySystemComponent component and set the default currency it holds.
Currency Definition
Create a new currency type by creating a GIS_CurrencyDefinition data asset.
Note
Currency Exchange feature will available in subsequent version of GIS.
Adding Currency to Items
To enable items to be bought or sold in shops, add the "Shoppable Settings" fragment to the item definition, specifying the currency required for purchase and the currency gained from selling.
Currency System API
These APIs allow you to add, remove, update, or query currency through the currency system. You can access all currency system APIs via GIS|CurrencySystem.
Loading Blueprint
Initializing BlueprintUE renderer...
Currency UI
GIS provides a reusable WB_GIS_CurrencyContainer widget that can:
- Monitor currency changes for a specified currency on any Actor and display its amount.
- Support vertical or horizontal display.
- Show current value, current/maximum value, or static display (e.g., for crafting item costs).
This widget can be used in any widget requiring currency information display.
Shop System
GIS offers a multiplayer-compatible interactive shop system, allowing multiple players to buy and sell with vendors simultaneously.
Shop System Component
To create a tradable NPC in-game, you need:
- GIS_InventorySystemComponent: Stores all items available for sale in the shop.
- GIS_CurrencySystemComponent: Holds the shop’s currency for transaction settlements.
- GIS_ShopSystemComponent: Handles the shop’s buy/sell logic.
The buyer (typically the player) requires:
- GIS_InventorySystemComponent: To receive purchased items or deduct sold items.
- GIS_CurrencySystemComponent: To pay for purchases or receive sale proceeds.
The shop system component handle logic with minimal setup. Check the BP_GIS_Vendor in the companion project for a complete setup example.
Shop API
Access all shop APIs via GIS|ShopSystem.
Loading Blueprint
Initializing BlueprintUE renderer...
Typically, you only need to call these APIs in interaction logic related to "trading." See GA_GIS_Interaction_Vendorfor more details.
Price Modifer Mechanism
Each ShopSystem can specify a price modifier, adjusting the overall price for buying or selling items. This enables:
- Different prices for item types in different regions, supporting a "merchant trading" mechanic.
- Price variations based on the player’s rapport with a vendor.
For dynamic price modifier , simply implement the relevant function.
Shop Menu
The buy and sell menus are variants of WB_GIS_InventoryMenu, with distinct display and logic in the "vendor" context.
GIS also provides WB_GIS_ShopMenu, which functions as a modal ui, allowing secondary confirmation for purchased/sold items and displaying the currency to be gained or paid.
Trade validation and failures
The project interaction flow should validate the player, vendor, distance, inventory ownership, and price on the server. Use CanBuyerBuyItem / CanSellerSellItem to check conditions and BuyItem / SellItem to execute. Check return values and inventory and currency results; a condition check does not replace authorization at commit. Test insufficient currency, full inventory, simultaneous shoppers, and commit failure. Example Widgets and vendor Blueprints are companion project content, not plugin Content.