I am trying to get a dynamic number of arrays made, and then put them all in one array (or dictionary). If the dynamic size is 9, I would like to create nine arrays, each with a set number of variables.

I'm not using this code (it isn't "gdscript"), but as an example:

for count in 9:
	var Array+str(count)[variable, another_variable, something_else, etc]
	All_Arrays.append(Array + str(count))

how do I get the Array+str(count) part?

All_Arrays[Array0[0] == new_value
All_Arrays[Array7[2] == next_value

Why can't you use All_arrays[0][0]? It will be tipically jagged array. Filling will look like:

for count in range(9):
	All_Arrays.append([variable, another_variable, something_else, etc])

I'm afraid that what you need is impossible, and for the most part it is not necessary.

Or you can use Dictionary, stroring string name of array ("Array0") and its value. For example:

var All_Arrays = {}
for count in range(9):
	var array = "Array"+str(count)
	All_Arrays[array] = [variable, another_variable, something_else, etc]

And then get the values using All_Arrays["Array0"]

What I'm trying to do is have an amount of info about an area stored in an array, but the areas are created dynamically as the player travels.

Im trying to get my code to create a shopping store. Then I would want to put Name, Money, a boolean for discount, etc., in an array.

If the player comes back, the info is still there, but as the player continues traveling, if another store spawns, it would also need that info stored. I'm not sure what I need if not nested arrays. Other ideas on how to do this that would be easier would be appreciated.

Being able to search through all of them with a "for" loop would also be very useful.

@TTaykAH said: Or you can use Dictionary, stroring string name of array ("Array0") and its value. For example:

var All_Arrays = {}
for count in range(9):
	var array = "Array"+str(count)
	All_Arrays[array] = [variable, another_variable, something_else, etc]

And then get the values using All_Arrays["Array0"]

This works. Thank you.

a year later