View previous topic :: View next topic |
Author |
Message |
Bodatoda
Joined: 23 Sep 2006 Posts: 4
|
Posted: Sat Sep 23, 2006 4:39 Post subject: Question about NWNX! strings |
|
|
I have been using NWNX with my PW for some time now and I've decided that I need certain variables to be persistent through server reboots, module revisions, etc. Is that what adding NWNX! to my variable names is supposed to do?
For instance, if I make a localvar for completing a quest NWNX!quest_done instead of just quest_done, should this variable stick with the character through reboots, etc?
Will this work if all I have installed is the main NWNX executable? Do I need the ODBC plugin?
I actually did install the ODBC plugin and added NWNX! to some of my variables names to test and they don't stick through a reboot of the server.
Thanks for any help. |
|
Back to top |
|
|
xaltos
Joined: 03 Jun 2006 Posts: 31 Location: Germany
|
Posted: Sat Sep 23, 2006 7:56 Post subject: |
|
|
You are on the wrong track.
NWNX is not working like this.
You can store with the ODBC plugin some data into a SQL Database.
But you need to setup a script that reads or writes the Data with SQL Commandos to the DB.
Here is a small example how this could look like.
Code: |
...
SQLExecDirect("SELECT area FROM areas;");
iResult = SQLFetch();
while (iResult == SQL_SUCCESS)
{
sArea = SQLGetData(1);
.... more code ....
iResult = SQLFetch();
}
...
|
Look into the aps_demo.mod for a full working example.
If you don't know SQL the syntax, can you use tools like "MySQL Query Browser". You can create full SQL commandos with this tools just with clicking. |
|
Back to top |
|
|
FunkySwerve
Joined: 02 Jun 2005 Posts: 377
|
Posted: Sun Sep 24, 2006 5:03 Post subject: |
|
|
NWNX! strings are simply locals that different nwnx plugins look for and interact with. You need to try out the aps_demo mod, it demonstrates use of persistency functions, and has a full library of them, including get/setpersistentstring/int/float etc.
Funky |
|
Back to top |
|
|
|