Deity Database provides database style persistent storage without the hassles of a true database. Data is stored in the Deity field of the character. The following data types are supported: Integer, Float, Location, Vector, String (40 character length max), LongString (99 character length max) and Memo (string of unlimited string length). The deity entered when the character is first created is not lost, but is stored in the database just as any other string.
By the way, I've done some extensive testing of this. I've been able to store over 70,000 chars in the deity field with out any problems. I suspect the actual limit may be around 2 billion, but that's just an educated guess. I've also been able to store over 1000 different database items. Since the data is cached, read time of the data is as quick as a GetLocal commands. Write access may be a little slower, since it replaces the entire deity string with each write, but modifying the string to save is pretty quick.
I'm really sorry I haven't checked this in a while. Didn't know anyone was even looking at the script. Glad you got it working. If anyone else has an issue, please drop me an email at [email protected]
Posted by Stormbringer ( 24.247.xxx.xxx ) at 2005-05-03 22:07:27
Ok, ok Please don't luagh for too long over this but I found my Error that I made after hours of termoil. News to all who download this pak. THIS SYSTEM WORKS BEAUTIFULY, but when you make your custom placable you must remember to check the "HAS INVETORY" solt on the placeable item you've made in order for it all ta work. *Grubles all this time and it was that simple, Slaps self upside the head* Thanks for the script!
Posted by Stormbringer ( 24.247.xxx.xxx ) at 2005-05-03 18:58:42
Well here we go again to try to get this to work right....*Grumbles* Please H..E..L..P.. = S..O..S = S..O..S = S..O..S..
Posted by Stormbinger ( 24.247.xxx.xxx ) at 2005-05-03 18:56:27
Now then I've read your posts again sir. What are the apporpriate calls? Sorry if I seem Dumbfounded by this, errr....But I kinda am. I've been told to get NWNX insted but this seems to be the better idea here if I could only get it to work....
Posted by Strombringer ( 24.247.xxx.xxx ) at 2005-05-03 18:46:13
I want this darn thing to work. but Alis I've run into set-up problems. My first post here was a flustrated example of what the Heck? and How? This post I'm simply gonna ask this: I've set up a placeable with the proper tag, used the onclient enter and onclient leave scripts that you provided with down load. All I get from it is this = The data base is set up wrong or a call to the JMDB is not present. But, I've checked the scripts and the call to it is made via. the script provided in the download. "JMDBInit(GetEnteringObject());" Why not just post a Starter mod with it all set up properly for us younger scripters to import into our mods or vise versa? Because I don't have a clue as to what to change or add to make this work. With a mod of over 500+ areas I need somthing for player storage. *Ponders the idea of just giving up on this system, but notes all the praise it has gotten from others* Please if someone can post a little more detail as to what and where things go to set this system up, I would appreciate it emensly.
Posted by Stormbringer ( 24.247.xxx.xxx ) at 2005-05-03 18:31:48
Please help me set this thing up........I added the placeable. ect. but it still don't work what the hell? I've read the darn instructions a million times thinking its something simple but I cannot make it work. What the Heck am I doing wrong??? HELP!
I've made a very small test of this system, and can confirm that it works.
Question: (Sorry if this has already been answered.)I have a memory of a topic in the Scripting Forum sometime last spring in which someone stated that the amount of data one could store in the deity string is "practically limitless". Is that the case? Is there a theoretical limit, a practical limit or something like that? Does retrieval-time increase with increased amount of data stored?
I think many builders would like a better description of the functions. A readme with some script-examples (like in the NWN Lexicon) would be helpful.
OK, hopefully this will be the final version. It provides for saving data in OnClientLeave events, and allows for
database of any size. Take a look at the comments.
I�ve updated Deity Database to fix a bug where cached data can get out of sync with persistent data, when attempting to save data in the OnClientLeave event. Since the character is saved to the vault before the OnClientLeave event occurs, calls to SetDeity in the OnClientLeave event do not update the deity (this is a Bioware "feature"). A warning about this problem has also been added to the comments.
I understand what you are saying about local variables on an inventory item. Both techniques have their pros and cons. This is just an option. As noted earlier, data stored in the Deity field will persist across servers and even modules.
Posted by Larnak ( 67.23.xxx.xxx ) at 2005-03-09 16:53:00
>
Local variables work great for storing all types of info, as long as you are using servervault characters. They do not save on local vaulted or exported characters. We use them to save everything from quest and journal status to the number of times a character has died. The best part is no database to compact, purge or maintain.
That would be nice if it were true. Don't know where you got that idea. I had never heard of it, so I wrote a little script to test it, and it doesn't work, not on the PC, not on an inventory item on the PC, and not on an undroppable item in the pc's inventory.
Posted by Chris..S ( 212.159.xxx.xxx ) at 2005-03-08 10:51:00
oops, no name on that last comment of mine. Chris..S (aka Q'el)
Posted by Anonymous ( 212.159.xxx.xxx ) at 2005-03-08 10:49:00
I would think its better to use a non-droppable inventory item and local variables. This system uses an nwn script solution to index the variables. That will without doubt be slower than GetLocalxxx & SetLocalxxx.
Since 1.62 local variables on inventory items are persistent over resets. They will even maintain their state transfering to different servers.
Posted by Chreelister at 2005-03-01 13:16:44 Voted 10.00 on 03/01/05
Posted by Chreelister at 2005-03-01 13:12:00 Voted 10.00 on 03/01/05
I am using this in a PW and so far it works really well, no problems and no lost data. I would recommend everyone to try this out, its much easier to get working than NWNX and that is about the only 2 choices you have in persistent data storage, that is fast and reliable. Also I haven't tested it, but should be persistent over different servers since the data is stored on the character. Maybe Meldrachaun knows more about this.
The amount of characters in the deity field is certainly a powerful resource used in the way you have put together. The 90 character long string limitation described in your documentation is what was refered too.
It turns out my current project will certainly realize much greater potential from your creation. It would be a big boon having memo texts without character limitation or hashed variable names too. Knat's natural database is another terrific alternative having those sort of things. It would be quite a fluid transition being able to serialze one of those cached databases and saved on a PC, then transported to a someone else's PW server where that data is handled. Imagine easy transfer of trade skills.. farm ownerships.. etc..
On init I saw the database gets cached. Being able to seemlessly use some of the SQL language scripts on that PC held database cache would be exceptionally powerful too.
The amount of characters in the deity field is certainly a powerful resource used in the way you have put together. The 90 character long string limitation described in your documentation is what was refered too.
It turns out my current project will certainly realize much greater potential from your creation. It would be a big boon having memo texts without character limitation or hashed variable names too. Knat's natural database is another terrific alternative having those sort of things. It would be quite a fluid transition being able to serialze one of those cached databases and saved on a PC, then transported to a someone else's PW server where that data is handled. Imagine easy transfer of trade skills.. farm ownerships.. etc..
On init I saw the database gets cached. Being able to seemlessly use some of the SQL language scripts on that PC held database cache would be exceptionally powerful too.
Posted by Curious ( 216.166.xxx.xxx ) at 2005-02-16 20:48:00
Novel idea. What happens when a player customizes his pc and types in a deity? (Would that be bad?)
Posted by 9Fires ( 24.71.xxx.xxx ) at 2005-02-16 19:20:00
How does one set this up for use in one's mod? I'm kinda new at DBs and would really like some to shed some light on this li'l situation. Explaination please.
I don't think any kind of string limit is going to be an issue, I've stored over 70000 bytes in the Deity field without any problem. I was also able to store 560 database entries without any problem