As expected, I need some more help.
I have a separate table set up for item storage, called "storage". It has 2 columns: UID(a unique player-specific ID) and Items.
UID is varchar
Items is blob
I added the SQLStoreCampaignObject, and SQLRetrieveCampaignObject functions mentioned above to my aps_include file.
I'm using a chest placeable with OnDisturbed and OnUsed scripts. The OnDisturbed script counts the number of items that have been added or removed from the placeable. The OnUsed script creates a invisible creature and copies items from the chest to the creature for storage.
At this point, I don't know if I'm writing correctly to the db as I test it to hold 8-10 items. I can see that I'm writing something to the db, at least, but when I look at it, the "Items" column appears as a binary/image type (is this what a blob is?) with a size of 6k. Is this right? 8-10 items is 6k? Surely something is wrong here. The default nwnx only reserves 1k per row and although I've increased my size beyond that, it's not reserving 6+k. I'm imagining a hundred+ items, if not more, to be saved.
When I reopen the chest, I'm not retrieving any of my stored Items, but that may be because the row is higher than I've reserved, so I wanted to ask about that first. What size for your persistent items are you seeing in the db?
My store call:
string sSQL = "UPDATE "+DBNAME+" SET Items =%s WHERE UID = "+sID;
SQLStoreCampaignObject(sSQL, oCreature);
My retrieve call:
string sSQL = "SELECT Items FROM "+DBNAME+" WHERE UID = "+ GetTag(oStorage);
object oCreature = SQLRetrieveCampaignObject(sSQL, lLoc);
So it writes to the db, but when i reopen the chest, there are no items (my counter says I have 8-10 items, but they don't appear). Is this the row size affecting it or perhaps something else?
I thought I'd start with the basics about the column size and the blob type first as a place to qualify/disqualify as an area of concern.
Any thoughts about how to further troubleshooting this?
Thanks!