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 
 
Demo module
Goto page Previous  1, 2, 3, 4, 5  Next
 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sat Nov 18, 2006 2:01    Post subject: Reply with quote

Grinning Fool wrote:
What about 'category' instead? "DATABASE", "OTHER", "SPEECH", etc?

As far as the specific database types, I don't see it as a problem. However, I'll only be able to test the creation for mysql, sqlite, and postgres. The others I'll set up 'by the book', but will need help in testing.


Well, the new term "function class", that I introduced in NWNX4, describes what I think you mean here. The database plugins provide functions of the class "SQL", while e.g. a timer plugin provides the "TIMER" class.

I was thinking, one could have a function class of "SQL" and a subclass of "MYSQL" or "SQLITE". The function for querying the subclass would be a new feature for the plugins to provide.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sat Nov 18, 2006 2:03    Post subject: Reply with quote

Grinning Fool wrote:
...

Am I missing something, or did the keys to get that info change?

EDIT: Okay, I'm an idiot. I just read your preceding post, where you mentioned that the version, description, etc functions are still needed. so... guess that's my first request, to provide a means to get that info.


I'll finish these functions on the weekend, together with the Timer plugin, so you have a little more to test with.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Sat Nov 18, 2006 5:23    Post subject: Reply with quote

Sweet; I'm on vacation all next week, so I should be able to make some solid progress (both on the demo mod and on my own PW...)

I may be on the wrong track here -- can't be sure 'til I see the source. But will the category/subcategory be something that the plugins are required to implement? As in... an abstract method in the base plugin class? Or will it be optional?
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sat Nov 18, 2006 11:28    Post subject: Reply with quote

Neither, really. They are no virtual functions, so you can compile a plugin without them, but on the other hand: A NWNX compatible plugin must support and answer to these queries by convention.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sun Nov 19, 2006 0:15    Post subject: Reply with quote

For the sake of completeness, here is the other half of the query functions.

nwnx_include.erf (starting with prototype 4) contains everything in one convenient script.

Here's how to use the new query plugin functions (cross post from the news thread):

Code:
void queryStatus()
{
   if (NWNXInstalled())
      WriteTimestampedLogEntry("NWNX is installed.");
   else
      WriteTimestampedLogEntry("NWNX is NOT installed.");

   int iPluginCount = NWNXGetPluginCount();
   if (iPluginCount > 0)
   {
      WriteTimestampedLogEntry("Number of plugins installed: " + IntToString(iPluginCount));
      WriteTimestampedLogEntry("Enumerating installed plugins:");
      
      int i;
      string sClass, sSubClass, sVersion, sDesc;

      for (i=1; i<=iPluginCount; i++)
      {   
         sClass = NWNXGetPluginClass(i);
         sSubClass = NWNXGetPluginSubClass(sClass);
         sVersion = NWNXGetPluginVersion(sClass);
         sDesc = NWNXGetPluginDescription(sClass);
         
         WriteTimestampedLogEntry("Plugin " + IntToString(i) + " provides function class " +
            sClass + " (subclass " + sSubClass + "). Version: " + sVersion);
            
         WriteTimestampedLogEntry("Description: " + sDesc);
      }
   }      
   else         
      WriteTimestampedLogEntry("There are no plugins installed.");

   
}


Output:

Code:
[Sat Nov 18 12:27:55] NWNX is installed.
[Sat Nov 18 12:27:55] Number of plugins installed: 1
[Sat Nov 18 12:27:55] Enumerating installed plugins:
[Sat Nov 18 12:27:55] Plugin 1 provides function class SQL (subclass SQLite). Version: 0.0.1
[Sat Nov 18 12:27:55] Description: This plugin provides database storage. It uses SQLite 3.3.8 as databaserver server and therefore is very ease to configure and maintain.

_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Sun Nov 19, 2006 8:52    Post subject: Reply with quote

Would it be possible to also require a name be provided? I'm basically setting this up to create a portal for each plugin found, and it would be good if I had a 'clean' name to use for the portals.

Edit: Also will need this to provide a 'standard' for plugin demo module name format.
Back to top
View user's profile Send private message
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Sun Nov 19, 2006 9:43    Post subject: Reply with quote

Couple of screenshots of the demo so far. The way this works is that portals will be activated radiating outward from the player, as plugins are found. This has a limit of 36 plugins...

Each portal will take the player to the plugin's demo module


The portal room:



SQLite portal (examined):



Timer portal (examined):

'
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sun Nov 19, 2006 11:46    Post subject: Reply with quote

Hey, nice ! This already looks very good. 36 plugins should be enough Smile

Could there be some kind of NPC that immediately talks to the player (without a conversation) and tells him to talk to him for more information ? He could then describe in a few words what those portals mean and how they do work.

The modules for the various database plugins should be responsible for setting up the pwdata table with the right SQL syntax, and of course show some examples what can be done and how that is done with nwscript.

About the name function: We currently have SQL/MySQL, SQL/SQLite, TIMER/TIMER as function class / sub class examples. A new function would be no problem, but how would it differ from those ?
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Mon Nov 20, 2006 3:51    Post subject: Reply with quote

Quote:
About the name function: We currently have SQL/MySQL, SQL/SQLite, TIMER/TIMER as function class / sub class examples. A new function would be no problem, but how would it differ from those ?


You're right - I realized that after I posted. The subclass really already provides a good human-readable name.

As far as the NPC -- sure that shouldn't a problem. Should have that and the 'create' modules available by mid-week.
Back to top
View user's profile Send private message
kungfoowiz



Joined: 12 Oct 2006
Posts: 61

PostPosted: Mon Nov 20, 2006 12:35    Post subject: Reply with quote

Heya, getting back into the swing of things Thursday, been on vacation too. =)

When I get back I'll update the tester module with Papillon's query functions.

Grinning Fool, have you hardwired those portals or are they dynamically populated?
I was thinking of using a World Map, but since you've used portals then that could be used instead. We could also exploit Obs' new programmable MessageBox function. I'll take a look at it this week and see what's the deal with it.

Cya
---
kung
Back to top
View user's profile Send private message
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Tue Nov 21, 2006 1:58    Post subject: Reply with quote

They're dynamically populated. For messagebox, I have one that displays when the user clicks on a portal, to confirm that they're sure they want to.

I considered making a module-chooser custom GUI, but I figured we wanted to keep this as simple as possible; installing custom GUI files would be an extra step that couldn't be resolved by the user just running the mod.
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Wed Nov 22, 2006 23:07    Post subject: Reply with quote

Yes, the demo module should be as simple as possible (to install).
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Tue Nov 28, 2006 20:10    Post subject: Reply with quote

I'm running behind on this, but will have something ready no later than the weekend. Haven't forgotten about it Wink
_________________
Khalidine, a NWN2 persistent world

Looking for volunteers.
Back to top
View user's profile Send private message
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Tue Dec 05, 2006 1:58    Post subject: Reply with quote

Hmm -- this poses a small difficulty. StartNewModule does not seem to be working...
_________________
Khalidine, a NWN2 persistent world

Looking for volunteers.
Back to top
View user's profile Send private message
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Tue Dec 05, 2006 2:08    Post subject: Reply with quote

Nevermind, I jumped to conclusions too quickly. It crashes the game in single player mode, but seems to be working OK in hosted mode. Since that's the one we need, should be OK.
_________________
Khalidine, a NWN2 persistent world

Looking for volunteers.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Goto page Previous  1, 2, 3, 4, 5  Next
Page 2 of 5

 
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