Persistent Inventories?

Scripted ALFA systems & related tech discussions (ACR)

Moderators: ALFA Administrators, Staff - Technical

Locked
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Persistent Inventories?

Post by AcadiusLost »

In the _playerOnDeath() function, the following line appears:

Code: Select all

860     // set the database name on the corpse object (creates a persistent inventory)
  861     ACR_SetDatabaseName(oCorpse, sDatabaseName);
However, when I restart the server, the corpse placeable comes up empty. Is setting a database name actually sufficient to create persistent item storage, or is there more that is missing from this? If so, how are changes to that inventory handled- through the acr_placeable_i called from functions in the acf_plc_* scripts? For that matter, is the code finished for persistent inventories? As I understand, they are still handled by NWN2's native database and stored in the Database folder, albeit perhaps with a NWNx4/ACR wrapper. I didn't get a chance to check if anything is being written there so far, if so, it's certainly not linking back up after a restart.
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

The corpse in effect is a movable persistent container. The persistent storage system uses that "database name" variable on the persistent container (which in this case is the corpse) to determine where to store the data.

One thing I noticed is that a WRITE seems to work - at least a file appears in the database folder with the appropriate database name - but the read doesn't, even with the NWNx4 hooks (for as much as I was willing to fiddle with it). That code functioned under NWN1, so I've somewhat written it off as a continued problem with the NWN2 campaign database functions. A simple test case might be worthwhile (store, restart, retrieve) to determine the state of those functions w/o all the other moving parts.

p.s. I tested and revised Ronan's persistent storage code under NWN1, so I know that it was working prior to NWN2. I think Ronan built in a lot of complexity perhaps to minimize potential read/write errors, but I think it unnecessarily convoluted the code. We might want to trim it down considerably for the sake of efficiency and maintainability.
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

Sounds like another thing to add to the testing/debugging plate. I recall some early reports of problems with NWN2's campaign DB functions, but haven't seen them addressed lately in reports of current issues.
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

Since I was having trouble with the persistent storage associated with corpses, I tried to set up a "normal" pchest in my test module.

Items left in the chest over a module reset did not persist. Also, using the "loot all" option gave a server message declaring a persistent storage error, stating that the contents would not be saved. (but removing all the items individually, then closing the container window did not give this error.
Locked