View previous topic :: View next topic |
Author |
Message |
Pyridon
Joined: 07 Oct 2005 Posts: 9
|
Posted: Mon Dec 19, 2005 19:04 Post subject: Proper set/GetPersistentObject documentation ? |
|
|
I am trying to save objects to the database for the first time, and trying to use the Set/GetPersistentObject functions to do that.
The trouble is that there isn't any proper documentation for those functions, or at least I haven't found it. So what I can do is trying to understand the aps_demo container, but of course the function doesn't work the way I need it to work, and there isn't much documentation. Only this:
Code: |
/* Method 1: GetPersistentObject
*
* Use this method for simplicity.
*/
while (bContinue)
{
oCreated = GetPersistentObject(oChest1, "Item_" + IntToString(iItem), oChest2);
if (!GetIsObjectValid(oCreated))
bContinue = FALSE;
else
iItem++;
}
|
Not very informative. The biggest problem is that I cannot understand what the parameters for the GetPersistentObject are. You remember, the example file actually copies the object from another container (Chest1) . So I suppose the first parameter is the container object reference where it's was saved the database, so... oChest2 is the reference of the container where it's loaded to ? Does that work if those two are the same container ? |
|
Back to top |
|
|
celtic3
Joined: 16 Jul 2005 Posts: 19
|
Posted: Sat Feb 18, 2006 6:42 Post subject: reply |
|
|
There is a 4th parameter for what table to use, but it is optional and is set to the default pwobjdata unless you set it. |
|
Back to top |
|
|
xtrick8
Joined: 31 Jul 2006 Posts: 8 Location: Melbourne, Australia
|
Posted: Mon Jul 31, 2006 6:08 Post subject: |
|
|
In your example oChest1 and oChest2 can be the same object. I think it just allows stuff to go back to the original owner of the object or something. But really there is no need that I can see for the second object argument. I hope that helps. I found this script works ok, but I am having corruption issues with some objects upon retrieval back from the database. A heal potion will sometimes become a speed potion when you check back. _________________ - xtrick8 (Lead Writer for Noreshia)
http://www.noreshia.com/ |
|
Back to top |
|
|
|