View Single Post
  #14  
Old 06-08-2008, 04:02 AM
zokemon zokemon is offline
That one guy...
zokemon's Avatar
Join Date: Mar 2001
Location: Sonoma County, California
Posts: 2,925
zokemon is a jewel in the roughzokemon is a jewel in the rough
Send a message via ICQ to zokemon Send a message via AIM to zokemon Send a message via MSN to zokemon Send a message via Yahoo to zokemon
For the amount of MUD data that Zodiac has, I suggest just keeping all the data in the text files and just load from each file when necessary. You could also put into your getData function (or whatever it is) to load the text file into a database npc when it has never been loaded before (![filename].loaded) and when it has been loaded just read the information for the npc. This then requires 1 extra comparison but reduced harddrive usages by a bit (database npcs still have harddrive usage but I think it is more optimized?).

As for sending the data to the player:
For all variables starting with "itemdata." for a given item "n":
PHP Code:
temp.itemdata.(@ n).savevarstoarray(true);
triggerclient("gui"name"specialness"na); 
And clientside:

PHP Code:
this.itemdata.(@ params[1]).loadvarsfromarray(params[2]); 
Where params[1] is "n" and params[2] is "a".

One last thing:
Don't store any mud data in client. or clientr. vars as they would then have to be loaded one login and would stress the server quite a bit. Instead, I often create a "mud" object on login like so:
(Weapon Main)
PHP Code:
function onCreated() {
  
player.mud = new TStaticVar();
  
player.mud.join(playermudclass);

Then you can just player.mud.loadvarsfromarray(a);

I simply join the class for utility functions.

This make it really easy for having multiple character systems and such as you can just player.mud.destroy() and re instantiate it.
__________________
Do it with a DON!
Reply With Quote