View previous topic :: View next topic |
Author |
Message |
Sherincall
Joined: 14 Mar 2009 Posts: 7 Location: Santa Clara, CA
|
Posted: Thu Apr 09, 2009 8:41 Post subject: Persistent Objects |
|
|
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 |
|
|
Zebranky
Joined: 04 Jun 2006 Posts: 415
|
Posted: Thu Apr 09, 2009 9:34 Post subject: |
|
|
I believe it's worked perfectly for 3-4 years.
(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 |
|
|
Sherincall
Joined: 14 Mar 2009 Posts: 7 Location: Santa Clara, CA
|
Posted: Thu Apr 09, 2009 9:55 Post subject: |
|
|
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 |
|
|
Fireboar
Joined: 17 Feb 2008 Posts: 323
|
Posted: Thu Apr 09, 2009 15:48 Post subject: |
|
|
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 |
|
|
|
|
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
|