View previous topic :: View next topic |
Author |
Message |
b1o
Joined: 03 Apr 2007 Posts: 16
|
Posted: Sat Apr 14, 2007 19:43 Post subject: SetPersistentObject |
|
|
Why doesn't the SetPersistentObject work?
i have this script and nothing is added to the database.(pwobjectdata is created with: SQLExecDirect("CREATE TABLE IF NOT EXISTS pwobjdata (player varchar(255) NOT NULL default ' ',tag varchar(255) NOT NULL default ' ',name varchar(255) NOT NULL default ' ',val varchar(255),expire smallint(255) unsigned default NULL,last timestamp(255) NOT NULL,PRIMARY KEY (player,tag,name)) TYPE=MyISAM;")
the script goes like this:
Code: |
object oDC2 = CopyObject(oPC, dLoc, OBJECT_INVALID, "Corpse_Of" + GetFirstName(oPC));;
SetLootable(oDeadPlayer, TRUE);
ChangeToStandardFaction(oDeadPlayer, STANDARD_FACTION_COMMONER);
AssignCommand(oDeadPlayer, SetIsDestroyable(FALSE, FALSE, TRUE));
SetPersistentObject(oDC2, "Owner_of", oPC);
SetPersistentObject(oPC, "Corpse_of", oDC2);
|
no changes are made to the Database |
|
Back to top |
|
|
Grinning Fool
Joined: 12 Feb 2005 Posts: 264
|
Posted: Sat Apr 14, 2007 23:18 Post subject: |
|
|
If in nwnx4, it is not yet supported. _________________ Khalidine, a NWN2 persistent world
Looking for volunteers. |
|
Back to top |
|
|
b1o
Joined: 03 Apr 2007 Posts: 16
|
Posted: Sat Apr 14, 2007 23:18 Post subject: |
|
|
Thanks. yes it is for nwn2(nwnx4) |
|
Back to top |
|
|
MetaPhaze
Joined: 03 Jun 2007 Posts: 30 Location: USA
|
Posted: Sun Jun 03, 2007 22:17 Post subject: question |
|
|
is there a SetPersistentObject() function for nwnx2?
i seem to be missing it...
anyone have the function that would care to paste it? |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Sun Jun 03, 2007 23:54 Post subject: |
|
|
It's in the demo module. |
|
Back to top |
|
|
TiQ79
Joined: 29 Jul 2007 Posts: 7 Location: Zurich, Switzerland
|
Posted: Sun Jul 29, 2007 22:55 Post subject: |
|
|
Grinning Fool wrote: | If in nwnx4, it is not yet supported. |
I'd like to know if this will be implemented soon. Is a release planed yet?
Or is there a serious problem with the saving of objects to mysql? |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Mon Jul 30, 2007 5:09 Post subject: |
|
|
TiQ79 wrote: | I'd like to know if this will be implemented soon. Is a release planed yet?
Or is there a serious problem with the saving of objects to mysql? | No, there is a problem with free time. |
|
Back to top |
|
|
TiQ79
Joined: 29 Jul 2007 Posts: 7 Location: Zurich, Switzerland
|
Posted: Mon Jul 30, 2007 10:35 Post subject: |
|
|
virusman wrote: | No, there is a problem with free time. |
Good to know.
Then I will probably install an SVN client and code it if I get free time before you |
|
Back to top |
|
|
TiQ79
Joined: 29 Jul 2007 Posts: 7 Location: Zurich, Switzerland
|
Posted: Tue Jul 31, 2007 10:38 Post subject: |
|
|
Maybe I won't need to make changes on sql plugins if that works.
I had a very short look at the script part, and what happens if i just get the string from my object?
StringToObject()/ObjectToString() and save them in a text field on sql. The function creates a hash of my objects and so they are reproduceable.
But ... is the NWNX4 ready to store long strings or is there a restriction? |
|
Back to top |
|
|
Zunath
Joined: 06 Jul 2006 Posts: 183
|
Posted: Wed Aug 01, 2007 2:34 Post subject: |
|
|
This is a little off topic, but does SetPersistentObject (for NWNX2) store the contents of the inventory of the object as well? |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Wed Aug 01, 2007 21:57 Post subject: |
|
|
TiQ79 wrote: | StringToObject()/ObjectToString() and save them in a text field on sql. The function creates a hash of my objects and so they are reproduceable. |
Those just return a unique identifier, not the actual representation of the object with all properties. Unfortunately, it's not that easy... and yes, it's a problem of spare time, as virusman pointed out. _________________ Papillon |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Wed Aug 01, 2007 21:58 Post subject: |
|
|
Zunath wrote: | This is a little off topic, but does SetPersistentObject (for NWNX2) store the contents of the inventory of the object as well? |
It does the same as StoreCampaignObject, so I'd say: yes. _________________ Papillon |
|
Back to top |
|
|
TiQ79
Joined: 29 Jul 2007 Posts: 7 Location: Zurich, Switzerland
|
Posted: Thu Aug 02, 2007 15:56 Post subject: |
|
|
Papillon wrote: | Those just return a unique identifier, not the actual representation of the object with all properties. Unfortunately, it's not that easy... and yes, it's a problem of spare time, as virusman pointed out. |
Yes, this is not the right way. The StringToObject function does not give a hash, but for some items it does give a reproduceable string so I could get 7 of 10 items back.
Then the amount of arrows does not match. Saved 99, got 20 back
But since it is only possible to pass a char* to the nwnx functions how can I ever be able to have the object passed as it is?
This is hardcore stuff, not even able to build a new plugin if it works like that.
How you been able to do that function in NWNX2? I really need a proper solution for saving objects, saving them to bioware database is not secure. Once per week a player looses all his stuff in there |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Fri Aug 03, 2007 12:06 Post subject: |
|
|
You would have to take a completely different route. New functions need to be hooked, and the interface needs to be changed to accomodate the new functions. It is not an incredibly huge, but certainly not a small undertaking.
I have requested two new NWNX functions for doing exactly this, but have not heard back from OE yet. I guess somebody will have to sit down for a couple of days and implement it without their help, if they will not give us those functions... _________________ Papillon |
|
Back to top |
|
|
Cyric
Joined: 22 May 2005 Posts: 4 Location: Rome, Italy
|
Posted: Fri Oct 12, 2007 20:34 Post subject: |
|
|
No news on this subject ?
ther's a way we can use to save a binary copy of an object ? in a BLOB field ?
and getting it back of course. _________________ Reami Perduti - Server Italiano PW |
|
Back to top |
|
|
|