Getting export variables of a packed scene inside of an export variable

That made no sense lol but I’ll explain.

I have a chest with a export variable that is an array of packed scenes. In there I can pass in things to be instantiated for when the chest is opened.
I want the chests to be randomized so I have a “feature spawner” that passes in a packed scene and will add it as a sibling then queue_free() itself.
It has an export variable to take a thing to spawn and I want to also be able to edit the stuff inside of the chest.
I’ll show pictures to better explain.



Move those chest configuration properties to the feature spawner or make the chest a resource that contains those properties and the reference to the chest packed scene.

You could also make a custom packed scene class that inherits PackedScene and add those properties there.

Since the feature spawning is going to be used for more than just chests that’s not an easy option but elaborate on what you mean about resources

class_name ChestPackedScene extends PackedScene
@export var configuration_parameter_1 := 1
@export var configuration_parameter_2 := 2
#etc

I’m look more into this when I get the chance, thx!

Hm that may require custom saving…

Resource approach:

class_name Chest extends Resource
@export var scene: PackedScene
@export var configuration_parameter_1 := 1
@export var configuration_parameter_2 := 2
#etc