• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Discussion Lua tables to replace arrays?

S

Shadowblitz16

Guest
I was wondering if at some point yoyo games would think about replacing arrays entirely with lua tables?

they would basically be the same thing but would also be able to hold key pair values.
so it would look something like this..
Code:
var table1 = { "hi", 0 } //list or array
var table2 = {} //map
      table2.string = table1[0]

show_debug,message(table2.string)
now I know this would only be doable if it was equal or faster then the speed of an array or if types were ever added.
but if luajit uses tables and is fast then i don't see why this couldn't be done
 

FrostyCat

Redemption Seeker
That's what a map is for.

Promoting data structures to true data types is on the Roadmap, but don't hold your breath for it.
 

Mert

Member
That's what a map is for.

Promoting data structures to true data types is on the Roadmap, but don't hold your breath for it.
Hi. I've been seeing this for a while. Does this mean that instead of accessing a map via a variable, we access it directly?
 

FrostyCat

Redemption Seeker
Hi. I've been seeing this for a while. Does this mean that instead of accessing a map via a variable, we access it directly?
Think of the Roadmap's goal on that item as how arrays now work post-GMS-1.3. You're still dealing with a reference, just with access to the garbage collector and more built-in type safety.
 
Top