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 
 
sqlite 3.3.6 Commands

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
Lady Abagail



Joined: 27 Jul 2006
Posts: 17

PostPosted: Fri Jul 28, 2006 9:20    Post subject: sqlite 3.3.6 Commands Reply with quote

Is the NWNX2 plug-in compatable with sqlite 3.3.6? Im writing a bunch of new content for arranging unique databases for different purposes in-game. As far as I can see NWNX2 only takes the command in string format from the module local variable and runs it through the SQL application. If I put sqlite 3.3.6 into my NWN directory with the two speak to each other? In my nwnx.ini file would i need to change 'source' from 'sqlite' to 'sqlite3'?

Edit:

Is there a command or default for creating a new database? I see that sqlite3 can attach and detach additional databases under various variable names, but, is it possible for me to create a new database file from scratch? nwnx.ini only has one field to specify which database file to operate from.

Thanks for your support! Very Happy
_________________
"Pudding can't fill the emptiness inside me...but it will help!"
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Fri Jul 28, 2006 9:54    Post subject: Reply with quote

SQLite support in the ODBC plugin is based on one of the early releases of version 3 (I think 3.0.something). I currently do not know the exact version from the top of my head and I am not in front of my development computer, so maybe someone else can comment on this.

You do not need to (and may not) change the "source", since it already uses SQLite 3 as database format. External programs like the control program or SQLiteCC (see links section) may open the database simultaneously, but do not expect to see changes to the DB while the server is running. Those would only be visible if the server periodically COMMITs the data or has been shutdown.

You can create new database files by just specifiying a new database name in nwnx.ini. You can not use multiple database files at the same time, though.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Lady Abagail



Joined: 27 Jul 2006
Posts: 17

PostPosted: Fri Jul 28, 2006 10:18    Post subject: Reply with quote

Hmmm...when I was speaking about the 'source' field of nwnx.ini being set to 'sqlite' what I was inquiring was that the version of sqlite I have has the exe file named 'sqlite3'. If I want to use that exe to run my commands, assuming I cant cahnge the 'source' field to represent the file name, should I just change the file name of my exe to sqlite?

Im sorry I cant remember what package I dled that included the exe that I currently have in my c:\neverwinternights\NWN folder.
_________________
"Pudding can't fill the emptiness inside me...but it will help!"
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Acrodania



Joined: 02 Jan 2005
Posts: 208

PostPosted: Fri Jul 28, 2006 15:29    Post subject: Reply with quote

The plugin is based on 3.08

At least that is the version that worked correctly Smile
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sat Jul 29, 2006 10:02    Post subject: Reply with quote

NWNX does not care how the sqlite.exe file is named, since it does not depend on it. You do not need the exe for NWNX at all, in fact.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Acrodania



Joined: 02 Jan 2005
Posts: 208

PostPosted: Sat Jul 29, 2006 17:48    Post subject: Reply with quote

Papillon wrote:
NWNX does not care how the sqlite.exe file is named, since it does not depend on it. You do not need the exe for NWNX at all, in fact.


Nope, but when you make a new database with the utility you either have to use the correct .exe or you have to use another utility that creates it at the correct version.
Back to top
View user's profile Send private message
Lady Abagail



Joined: 27 Jul 2006
Posts: 17

PostPosted: Sat Jul 29, 2006 19:09    Post subject: Reply with quote

Acrodania wrote:
Nope, but when you make a new database with the utility you either have to use the correct .exe or you have to use another utility that creates it at the correct version.


Then I guess I better include the version of SQLite that Im using to Dev my Persistent World System base module...or at least provide documentation on how to make it work. SQLite is only the beginning, once Ive gotten this project running Ill add scripting to make it functional with other databases as well, especially MySQL.
_________________
"Pudding can't fill the emptiness inside me...but it will help!"
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Acrodania



Joined: 02 Jan 2005
Posts: 208

PostPosted: Sat Jul 29, 2006 23:56    Post subject: Reply with quote

PrC is using a later version with their setup, you might consider using that version. Makes compatibility between major systems easier Smile

But good luck in your project! Its good to see people still interested in doing major work on NWN1....

P.S.- I always use MySQL instead of SQLite because I like the remote administration capabilities, but the SQLite 0-install setup has definately increased interest in NWNX....
Back to top
View user's profile Send private message
Lady Abagail



Joined: 27 Jul 2006
Posts: 17

PostPosted: Sun Jul 30, 2006 0:39    Post subject: Reply with quote

Acrodania wrote:
PrC is using a later version with their setup, you might consider using that version. Makes compatibility between major systems easier Smile

But good luck in your project! Its good to see people still interested in doing major work on NWN1....

P.S.- I always use MySQL instead of SQLite because I like the remote administration capabilities, but the SQLite 0-install setup has definately increased interest in NWNX....


Im pretty sure Im using the latest NWNX version, but Ill look into it to make sure. I have the hashset and functions script erfs as well but havent gotten too involved with reverse engineering their functionality. To be honest Im not very well versed in arrays and hashsets, though I sorta got the idea what they are all about from a Perl tutorial I was reading on Wikipedia to get comfortable with Perl syntax to try to write code for LetoScript Unicorn.

As far as NWN1, its more then software, its a work of art. It has limitations, but all in all, the beauty of what Bioware created far far exceeds the integrity of its sponser (namely Atari). The very fact that Bioware is seeing this software through to yet another patch, namely v1.69, completely astounds me in respect to the fact that funding for the project has been withdrawn by Atari. How could I turn my back on it when there is so much dedication to this product?

My Persistent World System is ambitious. Im starting small and working up from there. Soon Id like to get my own forums started so interested parties can check on my progress and offer assistence or advice. In the end I hope to achieve in scripting what CEP has done for custom content, or what CTP plans to do for Tilesets. It wont have everything, thats for sure, but it should have the basics all packaged up in one easy dl for the aspiring World Builder to add to and build on.

Remote Administration is definately going to be a must in the final release of the PWS base module. Just have to have some time to finish the SQLite 0 setup system first and dig into the MySQL stuff later on.
_________________
"Pudding can't fill the emptiness inside me...but it will help!"
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Lady Abagail



Joined: 27 Jul 2006
Posts: 17

PostPosted: Sun Jul 30, 2006 18:06    Post subject: Reply with quote

Hmmm, Ive run into a bug in the table setup for 'pwdata'. I mentioned before that Im reserving the 'pwdata' setup in the main database for other systems that use it, but one of its features is interesting to me, but it doesnt seem to be working.

When the table is created it creates the column last with the following;
Code:

last timestamp NOT NULL default current_timestamp

But the database isnt writing a timestamp into the column it just inserts the string value "current_timestamp". How do I write the table schema to actually perform a timestamped entry by default?
_________________
"Pudding can't fill the emptiness inside me...but it will help!"
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Lady Abagail



Joined: 27 Jul 2006
Posts: 17

PostPosted: Mon Jul 31, 2006 1:51    Post subject: Reply with quote

Lady Abagail wrote:
Hmmm, Ive run into a bug in the table setup for 'pwdata'. I mentioned before that Im reserving the 'pwdata' setup in the main database for other systems that use it, but one of its features is interesting to me, but it doesnt seem to be working.

When the table is created it creates the column last with the following;
Code:

last timestamp NOT NULL default current_timestamp

But the database isnt writing a timestamp into the column it just inserts the string value "current_timestamp". How do I write the table schema to actually perform a timestamped entry by default?


Okay I cant make the changes in the schema, but if you create a null text field and set the variable to default to "datetime('now')" in NWScript it will work Smile
Code:

void SetPersistentString(object oObject, string sVarName, string sValue, int iExpiration =0, string sTable = "pwdata", sLast = "datetime('now')");

_________________
"Pudding can't fill the emptiness inside me...but it will help!"
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules 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