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 
 
Getting started

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



Joined: 19 Jun 2008
Posts: 8

PostPosted: Fri Jun 20, 2008 20:59    Post subject: Getting started Reply with quote

I want try create my own NWNX plugin. What tools I need?

I will develop on Windows platform now, because wide support on internet forums, MSDN and Microsoft customer services.

My experiece with C/C++ is zero so I would appreciate some user-friendly dev environment.

I tried open-source solution Dev-C++ but failed compile NWNX sources.

I heard some plugins are made in Visual Studio 2005 but also read about need of Visual Studio 2006+ to compile NWNX source. I'm confused now.

I downloading MS Visual Studio 2008 now. I try out trial program and eventually buy it.

Some questions:

Can VS 2008 compile NWNX sources?

Do I still need download SDK mentioned somewhere on these forums? I guess not.
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Fri Jun 20, 2008 21:09    Post subject: Reply with quote

I use VS 6 for NWNX2, VS2005 for NWNX4. I haven't tried to compile NWNX2 with VS2005/2008, but I think there may be some incompatibility issues.
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Sun Jun 22, 2008 2:30    Post subject: Reply with quote

You won't be able to compile NWNX in Dev-C++ because it will be missing the MFC libraries. To my knowledge, only MSVC++ provides them. I also recommend Visual Studio 6 for NWNX2.
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
A



Joined: 19 Jun 2008
Posts: 8

PostPosted: Sun Jun 22, 2008 10:10    Post subject: Reply with quote

Thank you for help Smile

I got Visual Studio now and wow.. Lot of things to learn. I made some "Hello worlds" and simple math programs hehe.

Finally I compiled my first NWNX plugin. For now, it only put message to log file when called Very Happy

Well, now I gotta find out how shut down NWServer, wish me luck.

A
Back to top
View user's profile Send private message
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Fri Jan 23, 2009 2:45    Post subject: Reply with quote

So I started my first plugin an I encountered to few problems:

How to rename my plugin from "demoplugin" to "files" ? I was able to rename output dll but then it didn't worked Sad

How do I pass more then one parameters into one call? Do I have to do such a string list or there is another way?

Is there way to extend Parameters length when I input "readme.txt" and I expect that output will be longer?

And finally, when I catch that variable "READFILE" is set, can I somehow change value of another variable?
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Fri Jan 23, 2009 15:49    Post subject: Reply with quote

ShaDoOoW wrote:
How to rename my plugin from "demoplugin" to "files" ? I was able to rename output dll but then it didn't worked Sad

Check the options under Project -> Settings. Not sure exactly what you're running into, but odds are it's something in there. If you still have trouble, I'll take a look at your project file if you want.

ShaDoOoW wrote:
How do I pass more then one parameters into one call? Do I have to do such a string list or there is another way?

If you mean in the NWNX!PLUGINNAME!PARAMS call from NWScript, there is only one parameters string. You have to put your own delimiter in that string and parse it (using strtok() or similar).

ShaDoOoW wrote:
Is there way to extend Parameters length when I input "readme.txt" and I expect that output will be longer?

I believe the NWNX core reserves space for a certain length of return data. I'm not sure of the length offhand, but my personal approach would be "try it and see if it works; if it doesn't, fix it".

ShaDoOoW wrote:
And finally, when I catch that variable "READFILE" is set, can I somehow change value of another variable?

It is theoretically possible, but not easy. You're much better off just overwriting the data that was sent to NWNX.
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
ShaDoOoW



Joined: 20 Aug 2005
Posts: 584

PostPosted: Tue Jan 27, 2009 3:11    Post subject: Reply with quote

Thx for your answers.
Zebranky wrote:
Check the options under Project -> Settings. Not sure exactly what you're running into, but odds are it's something in there. If you still have trouble, I'll take a look at your project file if you want.
LOL, problem was, that when I renamed it to nwnx_files, I forgot to remade nwn script to call NWNX!FILES Smile.

Zebranky wrote:
ShaDoOoW wrote:
And finally, when I catch that variable "READFILE" is set, can I somehow change value of another variable?

It is theoretically possible, but not easy. You're much better off just overwriting the data that was sent to NWNX.
I think this would be very easy if you use global variable and two setlocalstring calls into plugin.
_________________
Community Patch / NWNX Patch / NWNX Files / NWNX Connect
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Tue Jan 27, 2009 11:50    Post subject: Reply with quote

ShaDoOoW wrote:
I think this would be very easy if you use global variable and two setlocalstring calls into plugin.

Hmm, that's a good point, though having to make a second call to get the output isn't as elegant as I'd like. I'd try to do it in one call first.
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
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