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 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: Sun Oct 29, 2006 10:19    Post subject: Demo module Reply with quote

aps_demo has proven to be immensely helpful to test new installations of NWNX and to understand how the system works.

For NWNX4, I'd like to have a more elaborate version, that demoes multiple plugins and explains what each plugin does.

The task is to create a NWN2 module that shows the "player" around the NWNX world, employing NPCs or signs to take him around and show what can be done. Technically, it should not matter whether all or no plugin is installed (e.g. the module should always behave nicely), since the module can check for the existence (and version) of a certain plugin with some new NWNX commands.

Bonus points for setting up a system that contains a central demo module, queries the installed plugins, and then enables portals to various modules according to the installed plugins and a certain naming scheme. I.e.: If a SQL plugin was found, a portal should send the player to a module called nwnxdemo_sql.mod. New commands for retrieving a plugin description might be helpful for that. The idea is to have new plugins include a demo that plugs itself into the main demo module.

As the demo module is the first experience with NWNX for many builders, it is important to do this right. So I am asking for serious developers only to sign up for this task. I think one or two people should be enough.
_________________
Papillon


Last edited by Papillon on Sun Dec 10, 2006 12:02; edited 1 time in total
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 Oct 30, 2006 9:09    Post subject: Reply with quote

Quote:
Bonus points for setting up a system that contains a central demo module, queries the installed plugins, and then enables portals to various modules according to the installed plugins and a certain naming scheme


I'll volunteer for the "central" module that does this querying and provides passage to the individual modules.

Until I know how extensive the list of initially available plugins will be, I can't commit to doing those as well (time is in limited supply).
Back to top
View user's profile Send private message
mostal



Joined: 29 Apr 2005
Posts: 60

PostPosted: Tue Oct 31, 2006 19:46    Post subject: Reply with quote

if i could help you, i'm volunteer too
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Wed Nov 01, 2006 16:37    Post subject: Reply with quote

Great!

In the meantime, kungfoowiz even sent me a first version of a demo plugin! Whew, that was fast.

I'll have a look at it now and then post what I found out.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
MagnumMan



Joined: 01 Apr 2005
Posts: 8
Location: MA

PostPosted: Wed Nov 01, 2006 19:50    Post subject: Reply with quote

That's why we pay kung the big bucks over at Amia.
Well, we'd LIKE to pay kung the big bucks anyway...

Don't forget to update to the latest code hooks to be 64-bit compatible... we're running NWN1 on Win64 now.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Mon Nov 06, 2006 5:05    Post subject: Reply with quote

*gentle bump* Is the prototype provided in final form, interface-wise? If so, I can get starteD on this this week.
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Mon Nov 06, 2006 16:44    Post subject: Reply with quote

No, not yet. Functions for querying the installed plugins, descriptions, and their version are still missing. That is the next point on my list. I'll keep you informed.
_________________
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 06, 2006 23:04    Post subject: Reply with quote

Sounds good, thanks.
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sun Nov 12, 2006 20:51    Post subject: Reply with quote

kungfoowiz, would you like to share the (central) module you sent me ? It is already looking good. I'd like to avoid duplicated work, so if you are willing to post it here please do.

I've done some work on the query functions, below is an example of what works in Prototype 1.03.

nwnx_include:
Code:

// Name     : NWNX include
// Purpose  : Functions for querying NWNX status and installed plugins
// Author   : Ingmar Stieger
// Modified : 12/11/2006
// Copyright: This file is licensed under the terms of the
//            GNU GENERAL PUBLIC LICENSE (GPL) Version 2
/**/

const string sSpacer = ".....................................................................................................";

// return TRUE if NWNX is installed
int NWNXInstalled()
{
   SetLocalString(GetModule(), "NWNX!INSTALLED", sSpacer);
   if (GetLocalString(GetModule(), "NWNX!INSTALLED") == "TRUE")
      return TRUE;
   else
      return FALSE;
}

// return number of registered plugins / function classes
int NWNXGetPluginCount()
{
   SetLocalString(GetModule(), "NWNX!GET_PLUGIN_COUNT", sSpacer);
   return(StringToInt(GetLocalString(GetModule(), "NWNX!GET_PLUGIN_COUNT")));
}

// return function class specified by parameter nPlugin
string NWNXGetPluginClass(int nPlugin)
{
   SetLocalString(GetModule(), "NWNX!GET_PLUGIN_CLASS!" + IntToString(nPlugin), sSpacer);
   return(GetLocalString(GetModule(), "NWNX!GET_PLUGIN_CLASS!" + IntToString(nPlugin)));
}


test function:

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 fClass;
      for (i=1; i<=iPluginCount; i++)
      {   
         fClass = NWNXGetPluginClass(i);
         WriteTimestampedLogEntry("Plugin " + IntToString(i) + ": " + fClass);
      }
   }      
   else         
      WriteTimestampedLogEntry("There are no plugins installed.");

}

_________________
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: Thu Nov 16, 2006 7:11    Post subject: Reply with quote

Excellent, looks like there's enough to get started with?
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Thu Nov 16, 2006 11:03    Post subject: Reply with quote

I discussed this with kungfuwiz, and he agreed to post his module here:

Download NWNX4 Demo Plugin Module (NWN2)

Note: This is the first draft, and the plugin query interface has changed a bit (see above). Also, more functions for querying version and description are needed.

Anyway, I guess you could start with this already.
_________________
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: Thu Nov 16, 2006 20:42    Post subject: Reply with quote

Cool, will be doing so this evening.
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Thu Nov 16, 2006 21:29    Post subject: Reply with quote

If you need something, please tell me so. As the weekend is nearing, I am feeling my super powers are returning Laughing

Oh, btw: Extra extra points for a database module, that supports the various (slightly different) pwdata table creation statements. Ideally, the SQL demo module should support them all. Hmm, let's see: SQLite, MySQL, PostgreSQL, SQL2005, ...

Maybe a function for querying the "sub function class" would be helpful.
_________________
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: Thu Nov 16, 2006 23:23    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Grinning Fool



Joined: 12 Feb 2005
Posts: 264

PostPosted: Fri Nov 17, 2006 7:37    Post subject: Reply with quote

I am running into a problem getting this going. The new interface you provided for class and count worked correctly.

However, it looks like the interface has changed to get name, description, version, demo mod?

I've tried these keys without luck:

NWNX!GET_PLUGIN_NAME!#
NWNX!GET_PLUGIN_NAME_#
NWNX!GET_NAME_#
NWNX!GET_NAME|#

And a bunch of other combinations...

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.
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 1, 2, 3, 4, 5  Next
Page 1 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