'2d array' from JS to GD structure...

Somewhat related to Erdo’s question in this forum…

I have a (fake) 2d array in JS. It works just fine. I can also use single variables between JS and GD just fine and send a single element of the ‘2d array’ into a GD variable. Now I want to transfer the entire 2d array into a GD structure. I haven’t managed to make this work though (guess I’m doing the syntax wrong). How do you do this? :confused:

Actually, the answer from Victor is functional.

You can use double square brackets to “declare” a fake 2D array during runtime:

Do = Variable(myVar) To Variable myStruct[VariableString(counter1)][VariableString(counter2)].childVar

And access to its value with the same syntax:

Do = Variable(myStruct[VariableString(counter1)][VariableString(counter2)].childVar) To Variable myVar

Problem is, in some cases and for some reasons, syntax can become unpractical huge.

SPAM: I made a “tutorial” about structurenotation in GD, applied to single and 2D arrays declaration, in the same old thread of my original question: http://www.forum.compilgames.net/viewtopic.php?f=19&t=6230

I managed to get it working :slight_smile:
I don’t know Javascript, but the syntax is so easy (just a bit different from Python), check the example here :smiley: :
ArrayToStructure.gdg (6.45 KB)

Thanks guys! I made this commented working code example which hopefully can explain how to do this.
arrays.gdg (14.7 KB)

cant we have an array object as a feature? :unamused:
To load and save string/values to the array table object (memory) , also load and save from array files on the hard drive - to that table.

This is no longer visual programming. You are literally writing java script with the event system.
Why dont you write an addon that makes use of the event system while at it :smiley:

There are already structure variables so we don’t need any array object. BY the way, it’s a non-sense as the array object would be an invisible object which is not the way the objects are used in GDevelop (not like Construct that loves invisible objects for everything).

so is also the case with multimedia fusion. :unamused:
The reason for that is the properties that it stores- array size for example.