Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Item #148

Open
pavlicekdominik opened this issue Nov 1, 2023 · 0 comments
Open

Drop Item #148

pavlicekdominik opened this issue Nov 1, 2023 · 0 comments
Assignees
Milestone

Comments

@pavlicekdominik
Copy link
Member

Drop Item Feature

1. Item Pickup Blueprint/Class

Attributes:

  • FInventoryItemOptionalData:
    • SpawnClassOnDrop: Represents the 3D model or actor of the item in the game world.

Functionality:

  • VerifyInventoryInterface:

    • Ensure that the SpawnClassOnDrop either directly implements the InventoryInterface or contains a component that implements it.
  • InstantiatePickup:

    • Spawns the SpawnClassOnDrop in the game world.
    • Transfer the relevant item data (including metadata, flags, and quantity) to the spawned actor's InventoryInterface.

2. Drop Item Functionality

Attributes:

  • DropAmount: (for stackable items) Defines how much of the item the player wishes to drop.

Functionality:

  • CanDropItem:

    • Checks if the item has tags like "Drop.Allowed".
    • Optionally, checks if the item is equipped based on Equipment Check settings (more on this later).
  • HandleDropAction:

    • Handles the action of dropping the item.
    • Spawns the SpawnClassOnDrop in the world.
    • If stackable, presents a UI prompt to the player to select the DropAmount.
    • Updates item flags and tags accordingly.
    • Removes or moves the item from the player's inventory based on the scenario.
  • UpdateInventoryUI:

    • Updates the player's inventory UI to reflect the new state after dropping an item.

3. Networking Considerations

  • Ensure the HandleDropAction is replicated to all relevant players.
  • Ensure synchronization between the server and client for accurate and consistent item data, especially in a multiplayer context.

4. Integration with Current System

Functionality:

  • UpdateFlagsAndTags:

    • Before removing the item from the inventory, ensure that the item's flags and tags are updated to reflect its new state.
  • MoveOrRemoveItem:

    • Depending on the context, either MoveItemBetweenInventories or RemoveItemFromInventory should be invoked.

5. Equipment Check

Attributes:

  • DropEquippedItemSetting: This setting lets developers decide how to handle the dropping of equipped items. The options could be:

    • AutoUnequip: The item is automatically unequipped before being dropped.
    • WarnAndConfirm: The system prompts the player with a warning that they're about to drop an equipped item and seeks confirmation.
    • Disallow: The system doesn't allow dropping of equipped items.

Functionality:

  • CheckIfEquipped:

    • Before dropping, the system checks if the item is currently equipped.
  • HandleEquippedItemDrop:

    • Depending on the DropEquippedItemSetting, this function will decide how to handle the item drop action for equipped items.
@pavlicekdominik pavlicekdominik self-assigned this Nov 1, 2023
@pavlicekdominik pavlicekdominik added this to the 1.0.0.X milestone Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant