Exporting an Array of Multiline Strings
Asked Answered
P

8

0

In Godot 3.x, it was possible to export an array of multiline strings with export(Array, String, MULTILINE) var <variable>. This would result in a series of multiline fields you could easily expand and fill in in the inspector - ideal for entering lines into a simple dialogue system, which is exactly what I was using it for.

With its new @export_<type> annotations, Godot 4.0 Beta 1 doesn't appear to support this. Is there any way of achieving the same result in 4.x?

Pillage answered 20/9, 2022 at 14:17 Comment(0)
P
0

@export_multiline for arrays has been fixed in rc1.

Pinzler answered 23/2, 2023 at 16:59 Comment(0)
B
0

You can see how the new syntax works here:

https://docs.godotengine.org/en/latest/tutorials/scripting/gdscript/gdscript_exports.html

Bismarck answered 20/9, 2022 at 15:43 Comment(0)
P
0

this is a known issue.

Pinzler answered 20/9, 2022 at 16:9 Comment(0)
P
0

Thanks for the responses, guys. Hopefully this will be a thing we can do again soon. In the meantime, I've just exported several multiline strings as a quick and dirty workaround.

Pillage answered 20/9, 2022 at 20:35 Comment(0)
B
0

You can use a CSV file are a database and read in string data from an Excel spreadsheet. That is one other way.

Bismarck answered 21/9, 2022 at 2:35 Comment(0)
F
0

Bismarck the example given in the docs for exporting a list of strings produces error:

@export_enum annotation requires a variable of type "int" but type "String" was given instead.

Franko answered 12/11, 2022 at 19:21 Comment(0)
P
0

Franko Where is this method in the docs? Can you give a link to it?

Pillage answered 13/11, 2022 at 11:15 Comment(0)
P
0

@export_multiline for arrays has been fixed in rc1.

Pinzler answered 23/2, 2023 at 16:59 Comment(0)
S
0

Pinzler
I found this :
@export_multiline var pnj_dialogues : PackedStringArray

Don't test it yet but it show what i want in the inspector.

Scopoline answered 8/3, 2023 at 22:26 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.