View previous topic :: View next topic |
Author |
Message |
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sat Nov 18, 2006 2:01 Post subject: |
|
|
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 |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sat Nov 18, 2006 2:03 Post subject: |
|
|
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 |
|
|
Grinning Fool
Joined: 12 Feb 2005 Posts: 264
|
Posted: Sat Nov 18, 2006 5:23 Post subject: |
|
|
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 |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sat Nov 18, 2006 11:28 Post subject: |
|
|
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 |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sun Nov 19, 2006 0:15 Post subject: |
|
|
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 |
|
|
Grinning Fool
Joined: 12 Feb 2005 Posts: 264
|
Posted: Sun Nov 19, 2006 8:52 Post subject: |
|
|
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 |
|
|
Grinning Fool
Joined: 12 Feb 2005 Posts: 264
|
Posted: Sun Nov 19, 2006 9:43 Post subject: |
|
|
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 |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sun Nov 19, 2006 11:46 Post subject: |
|
|
Hey, nice ! This already looks very good. 36 plugins should be enough
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 |
|
|
Grinning Fool
Joined: 12 Feb 2005 Posts: 264
|
Posted: Mon Nov 20, 2006 3:51 Post subject: |
|
|
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 |
|
|
kungfoowiz
Joined: 12 Oct 2006 Posts: 61
|
Posted: Mon Nov 20, 2006 12:35 Post subject: |
|
|
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 |
|
|
Grinning Fool
Joined: 12 Feb 2005 Posts: 264
|
Posted: Tue Nov 21, 2006 1:58 Post subject: |
|
|
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 |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Wed Nov 22, 2006 23:07 Post subject: |
|
|
Yes, the demo module should be as simple as possible (to install). _________________ Papillon |
|
Back to top |
|
|
Grinning Fool
Joined: 12 Feb 2005 Posts: 264
|
Posted: Tue Nov 28, 2006 20:10 Post subject: |
|
|
I'm running behind on this, but will have something ready no later than the weekend. Haven't forgotten about it _________________ Khalidine, a NWN2 persistent world
Looking for volunteers. |
|
Back to top |
|
|
Grinning Fool
Joined: 12 Feb 2005 Posts: 264
|
Posted: Tue Dec 05, 2006 1:58 Post subject: |
|
|
Hmm -- this poses a small difficulty. StartNewModule does not seem to be working... _________________ Khalidine, a NWN2 persistent world
Looking for volunteers. |
|
Back to top |
|
|
Grinning Fool
Joined: 12 Feb 2005 Posts: 264
|
Posted: Tue Dec 05, 2006 2:08 Post subject: |
|
|
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 |
|
|
|