Author Topic: Need Two Persistence Functions  (Read 789 times)

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need Two Persistence Functions
« on: August 08, 2012, 11:50:07 pm »


               I've just begun using databases for my module to add some persistence and have run into a stone wall regarding two "required" functions.

I need a function that can store remaining spell uses in the database for each character when they leave the server.
I also need a function that can store remaining feat uses in the database for each character when they leave the server.

I am using the Bioware Database with Knat's NBDE installed.

The feat storing fucntions I tried -  and scrapped - was generating TOO MANY OPERATIONS error. The spell one seemed to work.

I'm sure someone out there has done this, hopefully without NWNX - which I just don't comprehend.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Need Two Persistence Functions
« Reply #1 on: August 09, 2012, 12:16:11 am »


               http://nwvault.ign.c....Detail&id=3835

though, it might cause TMI as well - at least it did in my testing with custom spells, easy to fix if you delay each 200 hundred spell ids by milisecond

could be done same way with feats

anyway - found out that the spell uses issue didnt come from the Restore Spell Uses On Login ini option so I returned to that - this issue seems to be linux only engine related.

The remarks with metamagic still applies.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need Two Persistence Functions
« Reply #2 on: August 09, 2012, 12:30:33 am »


               This is what I'm currently doing. Spells store fine, feats cause TMI - even with delay.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need Two Persistence Functions
« Reply #3 on: August 09, 2012, 02:10:44 am »


               After playing around some with the Restore Spell Uses On Login ini option I decided to omit the procedure completely as its not needed for what I'm trying to achieve. It also appears that this .ini setting restores feat uses on login as well (at least it did for summon familiar)...
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Need Two Persistence Functions
« Reply #4 on: August 09, 2012, 11:37:11 am »


               well feat uses were persistent before 1.69 and this ini option already - I thought you have some other reason to store them
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need Two Persistence Functions
« Reply #5 on: August 09, 2012, 11:46:44 am »


               No, I am a major NOOB when it comes to multi-player - although I'm learning fast. I've always made stuff with SP then just brought my LAN group in to play it - never a need for henchmen doing it that way. Now they want something more akin to a PW.

I've been doing a lot of reading on MP and I'm simply blown away that the Server Settings in nwnplayer.ini don't have more info available. What is out there tends to be repetitious and only offers  minimal information...
               
               

               


                     Modifié par Pstemarie, 09 août 2012 - 10:47 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Need Two Persistence Functions
« Reply #6 on: August 09, 2012, 11:58:11 am »


               okay - still you need to make persistent death and track hitpoints

see this: http://nwvault.ign.c....Detail&id=6161

btw you know that local variables stored to the item persist server reset? Useful for storing PC-only info so you dont have to write everything into database.
               
               

               


                     Modifié par ShaDoOoW, 09 août 2012 - 11:01 .
                     
                  


            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need Two Persistence Functions
« Reply #7 on: August 09, 2012, 12:16:10 pm »


               Got that module, thanks for the link though. Persistant HP is no problem, but I was having great difficulties with items. I know everyone says that local variables stored on them are persistant, yet mine kept being wiped clean - even if the character was exported then reloaded into the module.

When I put in debug strings to list out values on what was being stored all the functions were logging the correct values. However, on reload it was if the variables never existed. ':blink:'
               
               

               


                     Modifié par Pstemarie, 09 août 2012 - 11:17 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Need Two Persistence Functions
« Reply #8 on: August 09, 2012, 12:49:21 pm »


               is this localvault?
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need Two Persistence Functions
« Reply #9 on: August 09, 2012, 12:56:57 pm »


               Server vault. I have been testing only with the standalone server or going through multiplayer.
               
               

               
            

Legacy_eeriegeek

  • Jr. Member
  • **
  • Posts: 75
  • Karma: +0/-0
Need Two Persistence Functions
« Reply #10 on: August 09, 2012, 03:39:13 pm »


               Hey Pstemarie, Storage on an inventory item is normally very reliable with servervault characters, a lot of PW's depend on it, but also make sure you're not using a stackable item for your variable storage. Stackables have known issues with losing information if they get re-stacked. Also, make sure there is only 1 item in the inventory with the tag of your persistent item, otherwise you may find a different one when the inventory is reorganized. The most common way I see this done is with a single Misc Small, non-droppable item, with a a tag & resref of something like "pw_token".
               
               

               


                     Modifié par eeriegeek, 09 août 2012 - 02:49 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Need Two Persistence Functions
« Reply #11 on: August 09, 2012, 05:47:45 pm »


               eeriegeek, the best item to use in that case is the pcskin.

i have noticed that sometimes the variables are not stored. BUT if you export the character there should be no problem. something to do some testing on....
               
               

               


                     Modifié par henesua, 09 août 2012 - 04:51 .
                     
                  


            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Need Two Persistence Functions
« Reply #12 on: August 09, 2012, 05:56:45 pm »


               Yeah, the PC skin is pretty much useless. The functions that check for it appear to be majorly borked, replacing it or unequipping it when they shouldn't. As far as storing variables - totally useless. I tried for four days to build persistence around that item and had to abandon it in favor of a database.
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Need Two Persistence Functions
« Reply #13 on: August 09, 2012, 06:02:50 pm »


               Characters exported by the player from a server vault setting have all the variables stripped from the items.  I guess to save space in the bic file.
 Characters exported and saved by script from within the game keep their variables, as should they when you simply log out, then back in with the same server vault character.  "Export", in that case, is simply "save".
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Need Two Persistence Functions
« Reply #14 on: August 09, 2012, 06:17:26 pm »


               Pstemarie, I've noticed some bugginess but nothing to indicate to me that the PC Skin is useless. Its held up substantially in testing. My incident of error is extremely low. For example, only one PC on my server has had a problem with 1 variable over the course of 12 sessions. I've had about 60 characters (not counting my own test characters) go through arnheim counting the testing phase.

So yes, this is a small sample, but the level of error is very very small, and may be a fault of my own rather than the PC skin.
               
               

               


                     Modifié par henesua, 09 août 2012 - 05:18 .