Author Topic: Persistent Storage - Item Descriptions  (Read 375 times)

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
Persistent Storage - Item Descriptions
« on: March 24, 2015, 01:56:26 am »


               

I use an SQL persistent storage database that stores a creature holding inventory.  When a player opens a storage chest the creature is spawned from the database and the items in the creature's inventory are copied from the creature into the chest.  


 


Similarly, when an item is placed into the chest and the chest is closed, the items in the storage container are copied into the


creature's inventory and then the creature is saved to the database.


 


Everything works perfectly. 


 


Except...Item custom descriptions.


 


At some point (either when the item is copied to the creature for saving, or when the item it copied back from the saved creature into the container) any item's custom description reverts back to the default item description.


 


The items retain all variables, custom names and everything else, it's just the description that gets overwritten.


 


To both 'save' the item into the creature and 'retrieve' the item from the creature to/from the chest, I use the following function:


CopyItem (oItem, oStorage, TRUE);


 


Anyone have any trouble with this or a workaround?  I could probably set a custom description var on the item, but that seems a bit cumbersome for a long description.


 


 



               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Persistent Storage - Item Descriptions
« Reply #1 on: March 24, 2015, 02:07:57 am »


               

Yeah, there's a thread somewhere that discusses that. I found that copy item does not do the custom descriptions. It came up in a different context, tailoring maybe or weapon wear systems.  Ended up making a wrapper to copyitem that does a Get/SetDescription.  



               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Persistent Storage - Item Descriptions
« Reply #2 on: March 24, 2015, 03:51:26 pm »


               

Yeah, we experienced the same problem as well using the Bioware DB. Setting up and then retrieving a custom description variable on the item was the route I ended up taking to resolve/workaround it. It seems to be working fine...or at least I've not had reports of problems with it for a couple years now,