Godot Version
4.2.1 Stable
Question
I have a custom resource called “BuildingData” that defines a list of export variables to hold information about a building that the player can construct (name, description, etc.).
I have another custom resource called “ItemData” that contains similar information about various items.
In my BuildingData resource, I want to add an array of (ItemData, int) to show how many of each item it takes to build that building. For example: “Wood”, 20 or “Stone”, 15, etc.
Is there a way to put an export variable in the BuildingData script to define this array?
I tried this:
@export var constructionArray: Array(ItemData, int)
What’s the syntax for declaring this? Or is there a different/better way to do what I’m attempting?