https://www.youtube.com/watch?v=V79YabQZC1s
extends PanelContainer
const SLOT = preload("res://Inventory/slot.tscn")
@onready var item_grid = $MarginContainer/ItemGrid
func _ready() -> void:
var inv_data = preload("res://test_inv.tres")
populate_item_grid(inv_data.slot_datas)
func populate_item_grid(inventory_data: InventoryData) -> void:
for child in item_grid.get_children():
child.queue_free()
for slot_data in inventory_data.slot_datas:
var slot = SLOT.instantiate()
item_grid.add_child(slot)
slot.slot_clicked.connect(inventory_data.on_slot_clicked)
if slot_data:
slot.set_slot_data(slot_data)
Invalid type in function ' populate_item_grid' in base 'PanelContainer (inventory.gd)'. Cannot convert argument 1 from Array to Object.
Basic FPS Controller Code: https://pastebin.com/yJwwpkCu
Shikashi's Fantasy icons Pack: https://cheekyinkling.itch.io/shikashis-fantasy-icons-pack
Follow along as I code the structure of an RPG type inventory system in Godot 4.
=== Intro / Setup ===
0:00 Intro
0:45 Project Setup
=== Resource Data Structure ===
2:50 Item Data Resource
4:27 Slo...