Skip to content

'Class inventory hides a native class' #186

Description

@EDKGames1

Hi,
I'm essentially a Godot newbie who is trying to use this plugin in a game I am attempting to make. (The game is 3d first person if this helps anything) I attempted to reverse engineer the example given in this plugin to evaluate how to implement it and essentially copied and pasted a block of code into my game from it to use it, and it keeps throwing the error listed in the main title and in the screenshot. I don't know how to move forward, some advice would be much appreciated, and if I'm not doing this right, some instruction on how to would be very much appreciated.
Thanks.

Image

Activity

  1. scriptsengineer commented on Mar 23, 2025

    @scriptsengineer
    Member

    This is because my plugin already has a class called Inventory, you must have a specific name different from this in your project, godot intends to work with namespaces in the future, but it is not yet possible to have two classes with the same name in the project.

  2. EDKGames1 commented on Mar 23, 2025

    @EDKGames1
    Author
  3. scriptsengineer commented on Mar 23, 2025

    @scriptsengineer
    Member

    In the addon there is a folder called demo, check the script called character-inventory-system it has everything you need to integrate the inventory system into your project, including the connection with UI, which I realized is your need as I saw above.

  4. EDKGames1 commented on Mar 23, 2025

    @EDKGames1
    Author
  5. EDKGames1 commented on Mar 24, 2025

    @EDKGames1
    Author
  6. scriptsengineer commented on Mar 25, 2025

    @scriptsengineer
    Member

    This is because you need to connect the two in the example it is done in FPSDemo.gd (The root node of the entire example) demonstrating that this must be done in a node that configures and connects the two without affecting your UI and your character for example.

    class_name FPSDemo
    extends Node
    
    @export var database : InventoryDatabase
    
    var main_inventory : Inventory
    
    func _ready():
    	$"UI/Inventory System UI".setup($"Player/CharacterInventorySystem")
  7. scriptsengineer commented on Mar 25, 2025

    @scriptsengineer
    Member

    I moved this topic to discussion because it is not an issue.

  8. locked and limited conversation to collaborators on Mar 25, 2025
  9. converted this issue into a discussion #188 on Mar 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions