don-tnowe / godot-wyvernbox-inventory

Action RPG-focused inventory system for Godot 3 and 4
MIT License
105 stars 4 forks source link

Crash when Tooltip or Grab Stack aren't present on scene #18

Closed d-3nnis closed 1 year ago

d-3nnis commented 1 year ago

image

image

A very simple example I cooked up to figure out how to use this plugin. The item instantiator is not working at all. The second screenshot shows the running project with nothing generated.

In my other project, I somehow got it to work, but when running it, I get a crash whenever I click on an item: image

don-tnowe commented 1 year ago

You don't seem to have a GrabbedItemStackView, it, as well as a tooltip, are needed to grab items and you can add it from addons/wyvernbox_prefabs. It's not clear, but I'll make it so it doesn't crash and gives a notification when none are on the scene.

Also, the instantiator does work but only populates if the inv is hidden and shown again. I'll fix that too

don-tnowe commented 1 year ago

The crash should now be fixed f3111a73b320923b7cf1fc1738707043b9d0d705, but leaving this open if bugs arise, and as reminder to add the notification.

d-3nnis commented 1 year ago

That was a super quick fix, awesome! However, in my other project, I'm now facing a different error:

E 0:00:01:0706   tooltip.gd:63 @ display_empty(): Node not found: "%Title/.." (relative to "/root/testworld/Human/PlayerUI/InventoryMenu/PlayerInventory/Tooltip").
  <C++ Error>    Method/function failed. Returning: nullptr
  <C++ Source>   scene/main/node.cpp:1620 @ get_node()
  <Stack Trace>  tooltip.gd:63 @ display_empty()
                 tooltip.gd:84 @ display_item()
                 item_stack_view.gd:33 @ _on_mouse_entered()

This is the scene layout: image

I have an inventory view (both equipmentInventory and Inventory), and a GrabbedItemStackView (GrabbedItemStack2), and a tooltip (Tooltip).

Not sure if there's some specific structure that I'm missing.

don-tnowe commented 1 year ago

Yeah, there's a structure - but all the needed nodes are in the prefabs inside addons/wyvernbox_prefabs, just drag them to the scene.

But I'll make that more streamlined too.

don-tnowe commented 1 year ago

I made it so you no longer need the prefabs, just add a node of the class and the prefabs are instantiated instead.

Enjoy!