Pickup && Dropper System

Overview
The Generic Inventory System (GIS) offers a highly flexible pickup and drop system for items. This document provides a detailed explanation of their usage and how to extend their functionality.
Pickup System
GIS provides three default pickup systems: Item Pickup, Inventory Pickup (Loot), and Currency Pickup. All of these inherit from GIS_PickupComponent
, each with their own configurations and logic. The pickup logic can be executed by calling the Pickup
function.
1. Item Pickup
- Purpose: Used for picking up a single item at a time, such as weapons or armor dropped on the ground.
- Implementation:
- Add
GIS_WorldItemComponent
andGIS_ItemPickupComponent
to anyActor
to create anItemPickupActor
. - Component Details:
WorldItemComponent
: Creates and holds an item instance in the world.ItemPickupComponent
: Adds the referenced item fromWorldItem
to the interactor's inventory.
- Add
2. Inventory Pickup (Loot)
- Purpose: Used for picking up multiple items at once, such as treasure chests or enemy drops after death in the game.
- Implementation:
- Add
GIS_InventoryPickupComponent
to anyActor
with anInventorySystem
component to create anInventoryPickupActor
. - Component Details:
InventorySystemComponent
: Configures all items that can be picked up.ItemPickupComponent
: Transfers items from the specified collection to the interactor's inventory.
- Add
3. Currency Pickup
- Implementation:
- Add
GIS_CurrencySystemComponent
andGIS_CurrencyPickupComponent
to anyActor
to create aCurrencyPickupActor
. - Logic Details:
- Upon pickup, all currency from the picked-up object's
CurrencySystem
component is removed and added to the picker’sCurrencySystem
component.
- Upon pickup, all currency from the picked-up object's
- Add
Case Study: BP_GIS_ItemPickup Blueprint
Simply using pickup components is not sufficient for a complete game experience. In practical applications, the pickup system needs to integrate with interaction, UI, and item visual effects to provide full functionality. The GIS companion project comes pre-configured with these features, ready to use out of the box.
Using the blueprint BP_GIS_ItemPickup
provided in the companion project as an example:
- Place this blueprint in your level and configure it as needed.
- The blueprint includes the following components:
StaticMesh
Component: Controls the visual appearance of the pickup.Pickup
Component: Specifies which inventory collection the item will be picked up into and manages success/failure audio feedback.SmartObject
Component: Defines the interaction entry point for thePickupActor
. Actors with interaction system components (e.g., players or AI) can search and interact with it to trigger pickup.WorldItem
Component: Configures an item definition and its quantity, creating and holding the item instance at runtime. Upon successful pickup, the item instance is added to the player's specified inventory collection.
- This blueprint is reusable, and you can also refer to it to create your own version, such as using particle effects instead of
StaticMesh
for visual representation.
Drop System
GIS provides two drop systems, each generating different types of PickupActor
based on configuration.
- All drop systems inherit from
GIS_DropperComponent
and can specify the generatedPickupActorClass
for drops. - Any
Actor
intended to be a pickup must implement theGIS_PickupActorInterface
to be selectable in theDropperComponent
.
1. Item Drop
- Implementation:
- Add
GIS_ItemDropperComponent
to enemies, NPCs, or scene objects (e.g., jars) that already have an inventory component. - Call the
Drop
function on theDropperComponent
when the enemy/NPC dies or the jar breaks to generate pickups based on configured rules.
- Add
- Configuration Options:
- Which inventory collection to drop items from.
- Drop type:
InventoryPickup
(singleActor
, pick up all at once) orItemPickup
(multipleActors
, requiring individual pickups). - Random radius variation during drop and drop origin (can be the dropper's position or another
Actor
's position).
2. Currency Drop
- Implementation:
- Add
GIS_CurrencyDropperComponent
to anActor
. - Call the
Drop
function at the appropriate time to generate the corresponding currency pickupActor
.
- Add
Custom Extensions
- The core functionalities and API interfaces of both pickup and drop systems are encapsulated in component form.
- Developers can inherit from
GIS_DropperComponent
andGIS_PickupComponent
via Blueprint or C++ and explore inheritable options to implement custom drop or pickup types.