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 
 
Persistent Objects

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
Sherincall



Joined: 14 Mar 2009
Posts: 7
Location: Santa Clara, CA

PostPosted: Thu Apr 09, 2009 8:41    Post subject: Persistent Objects Reply with quote

I couldn't find any info that's not older than 3-4 years on this, so here's my question:

Has there been any progress in the support for SPO/GPO on linux?
_________________
Shadows and Silver
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Thu Apr 09, 2009 9:34    Post subject: Reply with quote

I believe it's worked perfectly for 3-4 years. Wink

(Probably longer, actually; download it and try it out.)
_________________
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
Sherincall



Joined: 14 Mar 2009
Posts: 7
Location: Santa Clara, CA

PostPosted: Thu Apr 09, 2009 9:55    Post subject: Reply with quote

That's the problem, I couldn't check, windows user myself.

I do however have nss files from fireboar's nwnx-easy in my override when scripting for a linux server, and no such function is present there..
_________________
Shadows and Silver
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Fireboar



Joined: 17 Feb 2008
Posts: 323

PostPosted: Thu Apr 09, 2009 15:48    Post subject: Reply with quote

You have to use nwnx_odbc2 (which is in nwnx_easy and compiled by default). Here are the functions I use (add them to your odbc include file):

Code:
void SQLWriteSCO(object oObject, string sQuery)
{
  SetLocalString(GetModule(), "NWNX!ODBC!SETSCORCOSQL", sQuery);
  StoreCampaignObject("NWNX", "-", oObject);
}

object SQLWriteRCO(object oOwner, string sQuery)
{
  SetLocalString(GetModule(), "NWNX!ODBC!SETSCORCOSQL", sQuery);
  return RetrieveCampaignObject("NWNX", "-", GetLocation(oOwner), oOwner);
}

object SQLWriteRCOLoc(location lLoc, string sQuery)
{
  SetLocalString(GetModule(), "NWNX!ODBC!SETSCORCOSQL", sQuery);
  return RetrieveCampaignObject("NWNX", "-", lLoc);
}


Usage:

Code:
// Queries the database for a stored item and gives it to oPC, returning the item
object oObject = SQLWriteRCO(oPC, "SELECT object FROM table WHERE condition='" + sVariable + "'");

// Stores oObject on the database with ID 4
SQLWriteSCO(oObject, "INSERT INTO table(id, object) VALUES ('4', %s)");
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development 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