logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
SetPersistentObject
Goto page 1, 2  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
b1o



Joined: 03 Apr 2007
Posts: 16

PostPosted: Sat Apr 14, 2007 19:43    Post subject: SetPersistentObject Reply with quote

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;")Wink

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
View user's profile Send private message
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Sat Apr 14, 2007 23:18    Post subject: Reply with quote

If in nwnx4, it is not yet supported.
_________________
Khalidine, a NWN2 persistent world

Looking for volunteers.
Back to top
View user's profile Send private message
b1o



Joined: 03 Apr 2007
Posts: 16

PostPosted: Sat Apr 14, 2007 23:18    Post subject: Reply with quote

Thanks. yes it is for nwn2(nwnx4)
Back to top
View user's profile Send private message
MetaPhaze



Joined: 03 Jun 2007
Posts: 30
Location: USA

PostPosted: Sun Jun 03, 2007 22:17    Post subject: question Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Sun Jun 03, 2007 23:54    Post subject: Reply with quote

It's in the demo module.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
TiQ79



Joined: 29 Jul 2007
Posts: 7
Location: Zurich, Switzerland

PostPosted: Sun Jul 29, 2007 22:55    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Mon Jul 30, 2007 5:09    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website Yahoo Messenger
TiQ79



Joined: 29 Jul 2007
Posts: 7
Location: Zurich, Switzerland

PostPosted: Mon Jul 30, 2007 10:35    Post subject: Reply with quote

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 Razz
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
TiQ79



Joined: 29 Jul 2007
Posts: 7
Location: Zurich, Switzerland

PostPosted: Tue Jul 31, 2007 10:38    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Zunath



Joined: 06 Jul 2006
Posts: 183

PostPosted: Wed Aug 01, 2007 2:34    Post subject: Reply with quote

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
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Wed Aug 01, 2007 21:57    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Wed Aug 01, 2007 21:58    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
TiQ79



Joined: 29 Jul 2007
Posts: 7
Location: Zurich, Switzerland

PostPosted: Thu Aug 02, 2007 15:56    Post subject: Reply with quote

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 Razz
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 Sad
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Fri Aug 03, 2007 12:06    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website MSN Messenger
Cyric



Joined: 22 May 2005
Posts: 4
Location: Rome, Italy

PostPosted: Fri Oct 12, 2007 20:34    Post subject: Reply with quote

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 Wink of course.
_________________
Reami Perduti - Server Italiano PW
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules All times are GMT + 2 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group