Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
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
  #2  
Old 06-08-2008, 05:54 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by zokemon View Post
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.
I've done PMUD.playeraccount.vars. Loads it up there on login. In essence, there is no real attachment between player and the pmud . As for the cache, I had one going on my server pretty well so I'll just use that

I didn't consider the dbnpc option...I actually thought it would be much more inefficient.... I shall try it and see how it goes. Zodiac does currently have alot of MUD data but I think removing all the files which have then "of arcanaia" or "flaming" would bring down it's size by like 90%.

Last edited by Tolnaftate2004; 06-08-2008 at 07:21 AM.. Reason: % sign
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 03:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.