Quote:
Originally Posted by ApothiX
Why are you guys all using dynamic-named variables as opposed to a 3-Dimensional array?
this.apartments[this.apartments.size()].add({owner, locked, other crap, ...});
is how I would do it, then you access it like: this.apartments[apartmentid][0]; to get the owner.
|
Quote:
Originally Posted by napo_p2p
I tend to stay away from 3D arrays because they tend to get really long, and updating them via RC can cut them off.
At least for now, anyways.
|
Problems with 3-dimensional arrays:
1. the standard object functions don't update the string value outputs for mult-dimensional arrays (unless Stefan's fixed that since February).
2. what nappy said.
I mean, because of #1, I used 2 pairs of parallel arrays for my rank system on Classic. However, with 3000+ accounts a month entering the server, it lags the hell out of me when I open the script's flags. I get around this by simply downloading the text file from the NPC folder.
The thing that you have to be careful the most about when you use dynamic variable names is that they don't have spaces in them. You could probably get around this (for programming ease of use) by replacing the spaces with underscores or simply trimming the strings that make up the dynamic variable.