How to Add a Vendor NPC

This guide explains how to create a vendor NPC using the BP_RPG_AI_NPC_Shop base class. By the end, you will have a shopkeeper in the level with a configured inventory and price coefficients for buying and selling.

Prerequisites

  • RPG Engine v6 project with trading and inventory systems enabled.
  • Existing BP_ItemData assets for all items you want the NPC to sell.
  • GameplayTags configured for item types (for example: ItemType.Weapon, ItemType.Ammo, etc.).

Step 1 – Create a Vendor NPC Blueprint

  1. In the Content Browser, navigate to the folder where you keep AI/NPC blueprints.
  2. Right-click BP_RPG_AI_NPC_Shop and choose Create Child Blueprint Class.
  3. Name the new blueprint something like BP_NPC_Shop_Trader01.
  4. Open the new child blueprint.

Step 2 – Configure the NPC Character Skin

  1. In the Components panel, select BP_CharacterSkinComponent on your vendor blueprint.
  2. In the Details panel, find the Start Character Skin parameter.
  3. Assign the desired player character skin asset so the NPC uses that appearance in the world.
  4. Compile and save the blueprint.

Step 3 – Place the Vendor NPC in the Level

  1. Drag your BP_NPC_Shop_Trader01 blueprint from the Content Browser into the level.
  2. Position and rotate the NPC where you want the shop to be located.
  3. With the placed actor selected, open the Details panel to configure shop settings.

Step 4 – Configure Items for Sale

  1. In the Details panel of the placed NPC actor, find the ItemsForSale property.
  2. Add elements to the ItemsForSale array (type: S_ItemForSale).
  3. For each element:
    • Set Item to the BP_ItemData asset of the item this NPC sells.
    • Set Quantity to the number of units this NPC offers (integer).
  4. Repeat for all items that should be available from this vendor.

Step 5 – Set Sell Coefficients (Player Sells to NPC)

  1. In the Details panel, locate Sell Coefficients (type: TMap<GameplayTag, float>).
  2. Add entries for each item type tag you want to control, for example ItemType.Weapon, ItemType.Ammo, etc.
  3. For each entry:
    • Key: the item type GameplayTag.
    • Value: a float multiplier applied when the player sells items of this type to this NPC.
  4. Use higher values for item types where this NPC pays more (better prices for the player) and lower values where the NPC is stingy.

Step 6 – Set Buy Coefficients (Player Buys from NPC)

  1. In the Details panel, locate Buy Coefficients (type: TMap<GameplayTag, float>).
  2. Add entries for the same or additional item type tags, as needed.
  3. For each entry:
    • Key: the item type GameplayTag.
    • Value: a float multiplier applied when the player buys items of this type from this NPC.
  4. Use lower values for item types that should be cheaper for the player and higher values for more expensive categories.

Step 7 – Test the Vendor in Game

  1. Play in editor (PIE) and approach the vendor NPC.
  2. Use the interaction key to open the shop UI.
  3. Verify that:
    • All configured ItemsForSale appear with correct quantities.
    • Buying prices respond to Buy Coefficients per item type.
    • Selling prices respond to Sell Coefficients per item type.

If everything works as expected, your vendor NPC is ready and can be duplicated or further customized (appearance, dialog, location) as needed.