Hi, first post here and I would be very grateful for any help.
I'm making a newspaper puzzle-esque puzzle game, and have chosen to store puzzle solutions as arrays, e.g.:
[
[0,0,0,0,2,0],
[3,1,2,4,3,0],
[0,4,3,1,2,3],
[0,3,4,2,1,0],
[0,2,1,3,4,0],
[0,3,2,2,0,0]
]
I am trying to create a level select screen where the user can load different puzzles by clicking on different buttons, which store the puzzle solution as an array export variable.
When the export var type is set to an array, however, Godot asks for each item of the array separately in the export var menu for the scene. This method of inputting the puzzle solution is pretty slow, as my solution arrays contain multiple arrays inside them that must be input one index at a time.
I would much rather be able to copy and paste the solution into the export var field as a string in the form shown above, but I can't find any method of converting a string containing an array into the array contained within.
While googling I found one potential solution using JSON, e.g.:
var json_string = to_json(my_array)
var new_array = parse_json(json_string)
However, it seems that this still returns a string, rather than an array?
I am pretty new to Godot, so I might be making some kind of silly misunderstanding, but I hope somebody can help!