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 
 
Plug-in Development Questions

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development
View previous topic :: View next topic  
Author Message
HongKongCV



Joined: 05 Oct 2005
Posts: 1

PostPosted: Wed Oct 05, 2005 19:42    Post subject: Plug-in Development Questions Reply with quote

Okay, I'm developing my first NWNX plugin, and have a few basic questions before I begin.

1) Do I need a special libray or anything to develop a plug-in DLL, or do the naming conventions take care of everything? For example, the tutorial mentions a Log function being used to write to a logfile, but doesn't define the function anywhere. Do we just declare that as an external forward declaration, or what?

2) The example shows a single paramter being passed into the OnRequest function. I assume that if multiple parameters are required, they are all passed as a formatted string in the parameters variable. Is there a standard format the string should be in to separate the parameters, or does every plug-in set their own?

Thanks in advance for the help.
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Sun Oct 09, 2005 22:35    Post subject: Reply with quote

1) Nothing special is needed if you adhere to the framework. Get the demonstration plugin from the download section - it does everything a plugin should do (including the log functionality).

2) You are right, multiple parameters are usually encoded in one string. How that is done is up to the plugin and the corresponding NWScript include file on the NWN side.
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Youx



Joined: 08 Jan 2006
Posts: 9

PostPosted: Sun Jan 08, 2006 22:27    Post subject: Reply with quote

Got a question about how plugins work ...
Could someone please tell me the relationship (if there's one) between
- the class name (CNWNXSomething)
- the dll filename (nwnx_something.dll)
- the "!NWNX!SOMETHING!ARG!" string used in scripts.
- ??something else ??


Here's the problem and its investigation :
what i did :
- Copy the DemoPlugin directory and rename it to something else
- compile
- run a module which has
SetLocalString (oModule, "NWNX!DEMOPLUGIN!TEST", pos);
GetLocalString (oModule, "NWNX!DEMOPLUGIN!TEST");
-> OK (logged)

Now :
- change log output name ... still works
- change both .cpp and .h filenames ... still ok
- change class name (and functions) to something else ... still works same.
- change filename from nwnx_demoplugin.dll to nwnx_something.dll ... doesn't work with neither "...!SOMETHING!..." nor "...!DEMOPLUGIN!..."
- tried to change a few remaining "demoplugin" things in the code (#defines and the such), it still only works as "nwnx_demoplugin.dll", for "!DEMOPLUGIN!"

it can detect !DEMOPLUGIN! things when named nwnx_demoplugin.dll
it can't when called nwnx_something.dll ("Library doesn't exist" message)
it can detect !SOMETHING! when named either nwnx_something.dll or nwnx_demoplugin.dll

From which i can say :
- Class name has no effect
- dll name has an effect on a check for library existence
- something else deals with the string it can recognize ... and i don't know what =_= (original output name? project name? some dark compilation option? ) Confused

If anyone could tell me the secret about all of this ... i'd gladly learn it ^^ Thank you Crying or Very sad
Back to top
View user's profile Send private message
Papillon
x-man


Joined: 28 Dec 2004
Posts: 1060
Location: Germany

PostPosted: Fri Jan 13, 2006 19:23    Post subject: Reply with quote

The main library does an exact name match between the function name (NWNX!Demoplugin) and the plugin file name (nwnx_demoplugin). That is all one needs to know... not sure why you found that it reacts under two different names ? Maybe you had some leftover nwnx_* plugin from your former test ?
_________________
Papillon
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Windows development All times are GMT + 2 Hours
Page 1 of 1

 
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