Author Topic: Help with NWNx + SQLite  (Read 447 times)

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Help with NWNx + SQLite
« on: June 20, 2011, 03:13:24 am »


               First of all I'd like to aplogize if it is inapropriate for me to post this here. I could take it over to the NWNx forums but I know there are more people in these forums and I usually get a much speedier response.
And since NWNx has much to do with scripting and NWN I figured what the heck. But anyway, back on to my problem.

I've decided to give the whole NWNx/Database thing a shot. So far It's not going well. This is what I have done so far:

~downloaded NWNX Core
~downloaded NWNX ODBC
~This: "Installing NWNX2 is super easy. Download the file and unzip it. Take the
files "NWNX2.exe", "NWNX.INI", "nwnx-module.dll", and "madCHook.dll" and place
them in the directory where your NWN installation resides (usually
C:\\Neverwinternights\\NWN). Done!"
~my nwnx.ini is using these lines:
[ODBC2]
  source = sqlite
  file = sqlite.db
by default.
~This: "Copy the file nwnx_odbc.dll to you NWN folder, and aps_demo.mod
to your NWN module folder".
~This: "Place the file "aps2.erf" into the C:\\Neverwinternights\\NWN\\erf directory".
~I imported the "aps2.erf" into my module.
~I altered "x3_mod_def_load" in my test module:

#include "aps_include"
void main()
{
    // Init placeholders for ODBC gateway
    SQLInit();

~I downloaded and installed "sqlitecc".
~Then before I tried to use any of the nwnx database functions I fired up the "aps_demo" to create the database tables.

So this is where I am now stuck. When I go into the demo module and click the first 3 signs which are supposed to: 1-Set up the table, 2- test store a string, and 3- retrieve the string, the string that is returned is nothing but a bunch of periods, "........................................................................".
I then try to do the same thing with the objects. When it attempts to retreive the objects makes the server freeze up for a sec and then spits out a TMI error.

I've spent about 3 hours double checking things and cant figure this out.
Did i skip some major steps? Is some of the info I read to install outdated? Is there something else that is obvious and I'm just super nooby?

Any help very much appreciated. And again if it is bad form for me to ask this here I will take it over to the NWNX fourms. Thank you.
               
               

               


                     Modifié par GhostOfGod, 20 juin 2011 - 02:17 .
                     
                  


            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Help with NWNx + SQLite
« Reply #1 on: June 20, 2011, 04:34:56 am »


               You need to launch the module from NWNX, not the normal way, for plugins to register and function properly. That's a very common first mistake - did you do that, or just use the regular old nwserver?

Funky
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Help with NWNx + SQLite
« Reply #2 on: June 20, 2011, 04:45:21 am »


               Hmm. Well I have NWNX running and it says "aps_demo". How exactly do I launch a game from NWNX?
I just double clicked NWNX.exe. Then I tried to load up the game the standard way and from the toolset.

EDIT: Figured it out. Need to join online via multiplayer.
               
               

               


                     Modifié par GhostOfGod, 20 juin 2011 - 03:55 .
                     
                  


            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Help with NWNx + SQLite
« Reply #3 on: June 20, 2011, 04:53:48 am »


               OOoh. So I have to join the game online. Thanks Funky. Just got it working ok. Not very convenient for testing but now I can delve into it and try out these functions. Also just out of curiosity is there any particular reason why the SetPersistent functions don't show up in the list of functions on the side but the others like GetPersistent do?
               
               

               


                     Modifié par GhostOfGod, 20 juin 2011 - 04:00 .
                     
                  


            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Help with NWNx + SQLite
« Reply #4 on: June 20, 2011, 05:07:01 am »


               

GhostOfGod wrote...
again if it is bad form for me to ask this here I will take it over to the NWNX fourms. Thank you.


Bah..., this site is currently the bigest resource for info related to nwn, especially with the legacy site down. Honestly they should have a whole seprate forum for server hosting IMO... the nwnx forums are a good resource too, but this one has far more frequent users at this point, so why not utilize them?
               
               

               
            

Legacy_virusman

  • Sr. Member
  • ****
  • Posts: 448
  • Karma: +0/-0
Help with NWNx + SQLite
« Reply #5 on: June 20, 2011, 06:29:15 am »


               You can use NWNCX to launch NWNX with the client (i.e. when you press F9 in the toolset).
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Help with NWNx + SQLite
« Reply #6 on: June 20, 2011, 07:11:09 am »


               Hey there virusman. So I downloaded NWNCX. I copied the .dlls over and ran the patch. Now when I test the module from the toolset I am in fact a DM so I know this is working somewhat. But now when I check my bank balance (based on cd key) it isn't showing the correct amount. It's showing -2147483647 again like it did before I figured out how to get it to work the other way. haha. It's most likely just me missing something again.

So what am I doing wrong now? Is the database table different for server/client? Do I need to create a new database table for testing from the toolset?

Thanks for posting this by the way. If I can get it to work it seems like it would be extremely helpful.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Help with NWNx + SQLite
« Reply #7 on: June 20, 2011, 07:22:48 am »


               You may be happier using NWNCX, though I can't offer any help there, other than to confirm that that error happens when NWNX isn't operating properly. I'll be happy to help you set up some systems using it when you do get it going, though.

Funky