How do I do a multidimensional array?

0 favourites
  • 3 posts
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • I am coming from GMS2 so I might be been dense when it comes to arrays. but in GMS2 I would do a 2d array like

    array = [ [this is the first element of the first row, second, third],

    [new row, so on, so forth,]

    ]

    How would I recreate this in Construct 3?

    I have looked at some tutorials but they don't make sense to me.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Multidimensional, and Constructs array don't work like that. You can make multiple Array objects to make additional stacks/rows along the x axis. You can even make multiple instances and use the instancing expressions to make things closer to what you are wanting.

    Or you can use the Json object and just create arrays on the fly.

    Its use is a little complicated compared to the regular array, but again arrays on the fly.

  • You can use the Array Editor - in Files folder create a new file with "array" type, and you will be able to create a 2D or even 3D array as a table, very similar to Excel.

    Then you will need to load this file into an Array object:

    + System: On start of layout
    -> AJAX: Request ArrayFile.json (tag "arr")
    -> System: Wait for previous actions to complete
    -> Array: Load from JSON string AJAX.LastData
    
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)