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 
 
Does "SetPersistentObject" really stores objects i

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Technical support
View previous topic :: View next topic  
Author Message
QuintellaRosa



Joined: 07 Jun 2009
Posts: 4

PostPosted: Sat Jun 27, 2009 22:00    Post subject: Does "SetPersistentObject" really stores objects i Reply with quote

Looking into nwnx_sql I've found:

Code:
sSQL = "UPDATE " + sTable + " SET val=%s,expire=" + IntToString(iExpiration) + " WHERE player='" + sPlayer + "' AND tag='" + sTag + "' AND name='" + sVarName + "'";

SetLocalString(GetModule(), "NWNX!SQL!SETSCORCOSQL", sSQL);

StoreCampaignObject ("NWNX", "-", oObject);


So: will it really store the object or SetCampaignObject will store the object?

Additionally: I'm really a newbee on PWs, so I don't know: what are common uses for storing an object?
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Sun Jun 28, 2009 9:27    Post subject: Reply with quote

NWNX hooks StoreCampaignObject() to store objects, but the other pieces of code in SetPersistentObject() are necessary to tell it where to store the object data. Basically, you should use SetPersistentObject() in almost all cases.

The most common uses for storing objects are persistent chests, merchants, and corpses. If you only store by resref, modifications made to the item in-game (variables; changes to name, appearance, etc.) will be lost. Storing the entire object avoids this problem.

(Disclaimer: this is based on my knowledge of NWN1, it might be different for NWN2.)
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
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 -> Technical support All times are GMT + 2 Hours
Page 1 of 1

 
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