Baltor Get started

Gallery / Godot components

Slot inventory with stacks and a weight limit

In your harnessGodot componentMIT

Store items in a fixed number of slots with per-item stack limits and an optional total weight limit. Add returns what did not fit; remove, move, merge, swap, split and save to JSON-friendly data with validation.

Files, names only

  • ATTRIBUTION.md
  • LICENSE
  • README.md
  • baltor_test.gd
  • component.json
  • inspect_gdscript.py
  • run_tests.gd
  • slot_inventory.gd
  • test_package.py
  • tests/test_slot_inventory.gd
  • verification/native.json

Full files in your harness.

What it takes and gives

Class
BaltorSlotInventory, extends RefCounted
Methods
get_slot_count() -> int; resize(new_count: int) -> bool; max_stack_of(item_id: StringName) -> int; weight_of(item_id: StringName) -> float; total_weight() -> float; get_slot(index: int) -> Dictionary; is_slot_empty(index: int) -> bool; first_empty_slot() -> int; and 10 more
Signals
slot_changed, item_added, item_removed
Placement
res://baltor/godot_components/slot_inventory/

Limits. Item definitions are plain dictionaries keyed by id, with a stack limit and unit weight only; no item instances with unique data (durability, enchantments). Slots are a flat list without shapes (see a grid inventory for that). Weight comparisons use a 1e-6 tolerance. Verified with Godot 4.7.2 headless; written against the Godot 4.3 API.

Details

Kind
Godot component
Engine
Godot 4.3 or later
Files
11 files, 88.8 KB
Licence
MIT
Declared effects
reads files, runs commands
Checked with
Godot 4.7.2, headless
Checks
godot parse check only, godot gdscript tests, godot tests reject gutted component, godot editor import, godot contract reflection, godot readme usage compiles
Techniques
first-fit stacking, weight capacity check, validated deserialization
Tags
inventory, items, stacks, weight, rpg, save data, gameplay
Identity
library.supply.creative_originals.ea3f7c0a66a764e29f28188f.b785a7fe2b3b3995
Version
b785a7fe2b3b3995d2839d0130d51401fa92fc673de6b1ca3a82d80a6126e4aa

The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.

Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.