This guide provides an overview of the changes introduced in GLoot version 3.0, and will hopefully enable a smooth transition from version 2.x.
Protosets have undergone significant changes in version 3.0. The essential updates include:
The ItemProtoset
resource type has been removed and protosets are now represented as builtin JSON resources.
The general JSON structure of a protoset has also been changed (details can be found in the Creating Item Prototypes
section of the README.md
file).
The protoset editor has been removed. Editing raw JSON files is now the only supported method for creating and managing protosets.
The width
and height
properties (integers) have been replaced with the size
property, represented as a Vector2i.
Inventory management has been unified and simplified. Instead of using multiple specialized inventory classes, version 3.0 introduces a single Inventory class which is customizable with constraints:
InventoryStacked
: UseInventory
with aWeightConstraint
.InventoryGrid
: UseInventory
with aGridConstraint
.InventoryGridStacked
: UseInventory
with bothGridConstraint
andWeightConstraint
.
Key updates to inventory item handling:
- Inventory items no longer extend the
Node
class and cannot be created as nodes from the editor. - Items now extend the
RefCounted
class. - Items must be created via the inventory editor in the inspector or programmatically.
The ItemRefSlot
class has been removed. Its functionality can be replicated by:
- Implementing
_can_drop_data
and_drop_data
methods for anyControl
node. - Storing a reference to the dropped item as needed.
Some UI Control classes have also been unified and simplified:
CtrlInventoryStacked
can be represented as aCtrlInventory
andCtrlInventoryCapacity
CtrlInventoryGrid
andCtrlInventoryGridEx
have been consolidated intoCtrlInventoryGrid
CtrlItemSlot
andCtrlItemSlotEx
have been consolidated intoCtrlItemSlot
For additional information:
- Refer to the
README.md
file for more comprehensive documentation. - Explore the provided examples to better understand the new features and workflows in GLoot v3.0.