A kind of Associative Array

New releases and general discussions.

Post » Fri Sep 11, 2009 7:30 pm

I'd love for there to be some sort of plugin that lets you give it variables with names, much like MMF's Associative Array (referencing that damn program again), that you then can save to encrypted external files. Basically just variables for that object that are save-able.

With an Array you can save and all, but everything is reached through the array positions. You'd make some sort of documentation of what goes where, but I think what makes an associative array easier is that you get a variable by its name. With an array you have to reserve spaces in it, and if you want to change maybe the amount of items a list can hold it would be a giant hassle to extend it if the list's values are stored in the middle of the whole thing. I guess multiple save files for one "save slot" helps, BUT STILL!

It's an easy way to handle saving. I don't know if you can replicate that already, maybe with an INI, but are you able to encrypt anything in Construct?

EDIT: I suppose one could make a Sprite and make its variables save to an array, and then you call for an array position's string to compare with the name of the variable of that sprite, somehow. Not sure if that would be slow though? And can an array store both strings and variables?
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Fri Sep 11, 2009 7:56 pm

I think you're looking for the hash table object :mrgreen: . For now you can get some basic encryption with the crc32 plugin.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Fri Sep 11, 2009 8:15 pm

Pffffttt, calling me unattentive, are you?
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Sat Sep 12, 2009 2:38 am

Honestly at first I had no idea what a hash table was until I played around with the plugin randomly one day. Just assumed you didn't know the meaning/usage of hash table at first, like me. :mrgreen:
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Sat Sep 12, 2009 4:20 am

The only difference between hash and assarrays is that you have to unfortunately insert keys before you can fiddle around with the values, and I dont think hash tables are as well protected?
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Sat Sep 12, 2009 10:54 am

I assume you mean you have to create a key before you can set it, whereas AssArray created one if you set a key that didn't exist?
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Sun Sep 13, 2009 1:39 am

[quote="konjak":lhx9bgaq]I assume you mean you have to create a key before you can set it, whereas AssArray created one if you set a key that didn't exist?[/quote:lhx9bgaq]

yeah that's what I meant.
B
134
S
65
G
16
Posts: 1,766
Reputation: 19,190

Post » Wed Sep 16, 2009 11:27 pm

[quote="Davioware":1n6outam]I think you're looking for the hash table object :mrgreen: . For now you can get some basic encryption with the crc32 plugin.[/quote:1n6outam]

How could you use the crc32 plugin for that?
B
5
S
2
G
3
Posts: 234
Reputation: 1,818

Post » Thu Sep 17, 2009 6:47 pm

You could hash the ini file, save a hash, then only load the ini if the hash matches the ini.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 3 guests