View previous topic :: View next topic |
Author |
Message |
HongKongCV
Joined: 05 Oct 2005 Posts: 1
|
Posted: Wed Oct 05, 2005 19:42 Post subject: Plug-in Development Questions |
|
|
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 |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sun Oct 09, 2005 22:35 Post subject: |
|
|
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 |
|
|
Youx
Joined: 08 Jan 2006 Posts: 9
|
Posted: Sun Jan 08, 2006 22:27 Post subject: |
|
|
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? )
If anyone could tell me the secret about all of this ... i'd gladly learn it ^^ Thank you |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Fri Jan 13, 2006 19:23 Post subject: |
|
|
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 |
|
|
|