How do I store an array in a dictionary

0 favourites
  • 5 posts
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • I could do it using a delimiter and tokenat, but has anyone made a plugin to make this more intuitive?

    In JavaScript, I could do something like this: {fruit: ["apple", "orange", "pair"], vegetables: ["carrot", "onion", "potato"]}

    I could also fake it using a 3d array, but it's not as clean and would require a little more code.

    If I wrote my own plugin to solve this problem... Would anyone find it useful

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I might be dumber than I thought, but why would you want to store an array in a dictionary object?

    Isn't there a reason why they are two different kinds of objects, each with their own benefits?

    There is however a csv to array and csv to dictionary plugin, if that's what you are after..

  • I might be dumber than I thought.


  • You might be interested in this plugin :

  • Storing key value pairs in an array (and vice versa) is a pretty standard thing to do in programming. The two offer a lot of power.

    For example, the 3rd x element in an array might hold some parameters, and one of those parameters might be an array itself. This can be achieved with TokenAt, but it's not as intuitive and is a bit of a code smell (In my opinion). I could utilize the z axis but would still end up needing TokenAt to store an array inside an array.

    Having said all that, Construct 2 is a phenomenal tool with an SDK that allows you to do pretty much anything... So I'm not complaining, just looking to see what's out there!

    Thanks Magistross, will check it out!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)