When will Godot deliver support for the export of structures?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By makkoar

I have a question. When will Godot deliver support for the export of structures?! The absence of this functionality greatly reduces the engine’s ability.

Export to what exactly?

SteveSmith | 2022-12-19 19:31

Export variables to the editor so that you can edit them conveniently.

makkoar | 2022-12-19 19:36

Thanks, I see what you mean.

SteveSmith | 2022-12-19 19:38

@makkoar, Try to always provide minimal reproducible code rather than posting a screenshot of it. Only provide screenshots or images only when required like the expected output.

Junaid | 2022-12-20 15:40

:bust_in_silhouette: Reply From: Ninfur

The ability to export custom resources got added in Godot 4.0-beta2.

See the release post and PR for additional information:

In GDScript you would do something like:

@export var some_res: MyCustomRes

I’m not sure about C#, but there seems to be some mentioning of it in the PR.

Firstly, it’s a pain in the ass to create a separate resource for the field, secondly, I need to be able to create an array from this structure/class/resource.

Let’s say I want to make an array of pairs of type (string, bool) so that you can quickly add these pairs through the editor.

click +1 array element and immediately fill in the TYPED fields.

makkoar | 2022-12-20 13:20

Maybe you can try this workaround?
Add first-class custom resource support · Issue #18 · godotengine/godot-proposals · GitHub

Make a tool-script and add a setter function to the exported variable that sets the inital value.

Ninfur | 2022-12-20 13:54

Thanks, I’ll try.

makkoar | 2022-12-20 16:59