Because Avariel, as 'easy' as you imply it to be, it really isn't. I spent 3 days recoding a script I used to report potion types I could make to use mushclient variables to store some of the information and make it complient with my muds "don't just hand out information players should learn on their own" policies. I then recoded it again, then again, and again, etc. Till I am now at version 3.1 and I think it is finally stable. However, there are a few things that my hard coded custom version does that the plugin still can't and the reason is because the code needed to handle a mix of mushclient variables and complex interrelations is too much of a major in the backside to code.
In the case of the original poster to this thread, the problem was less complex, but required maintaining a list of multiple paths, not just one at a time. I dealt with the same problem by once again hard coding the paths into my script in a case statement, but doing so is inflexible and added a very large chunk up code that does nothing more than what a database would have done far more efficiently. Mushclient variable are very useful for simple things, but when you are trying to handle large numbers of individual paths or complex connection, the fact that you have to convert them every time into an array, then back, make sure each variable has the same number of records (or just the right number), etc., rapidly becomes confusing and overly complicated.
Your method works, but is far harder to maintain, get working right and most importantly modify if your decide to make heavy modifications to the it for some reason. My own plugin checks a variable that stores a version number for the current plugin when it installs and if it doesn't match the current plugin, deletes all of the variables and recreates a few of them and leaving the user data empty. It does this because the structure of the strings used to track the data has changed about 5 times since I started designing the plugin. This is not a reasonable way to do things, but transfering the old data into new variables would have required maybe fifty lines of code 'for each previous version'. By comparison, with a database you just move the stuff you want to keep to new tables, or if some information is redundant or unneeded, just treat those fields as empty.
Put simply for simple things mushclient variables are useful, but when you have to start designing a database in scripting using those variables, you may as well avoid the aggrivation and use a real one. ;) lol |