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 
 
Calling NWNScript function from NWNX plugin

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



Joined: 24 Oct 2011
Posts: 15

PostPosted: Fri Jun 15, 2012 11:31    Post subject: Calling NWNScript function from NWNX plugin Reply with quote

Hi,
I am working on a research project and want to use NeverWinter Night as our test bed. We are planning to use NWNX to link external code base with teh game. But I am new in NWNX development.

I successfully build a simple NWNX plugin. I understand that I can write codes in the script that can call function in NWNX plugin. My question is, is it possible to (or is there any way) to call NWNScript function from NWNXPlugin?

In teh NWNXBase class, I saw only 3 virtual functions, OnCreate, OnRelease and OnRequest. Now OnRequest is the entry point of the Script functional call that decide which C++ function to call.

Now How can I call NWNScript function from NWNX Plugin? Is it possible?

Thanks.[/i]
_________________
Pixelord
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Fri Jun 15, 2012 13:51    Post subject: Reply with quote

It is possible (see NWNX Ruby sources), but in most cases you wouldn't want to do that.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
pixelord



Joined: 24 Oct 2011
Posts: 15

PostPosted: Fri Jun 15, 2012 14:26    Post subject: Reply with quote

Could you please explain what would be the problem to do so? For example, if I want to integrate some AI engine to control the NPC, what would be the best design you would suggest?

Thanks,
_________________
Pixelord
Back to top
View user's profile Send private message
pixelord



Joined: 24 Oct 2011
Posts: 15

PostPosted: Fri Jun 15, 2012 14:33    Post subject: Reply with quote

In a different topic, is there any documentation regarding NWScript VM and NeverWinter Night 1 Opcodes?
_________________
Pixelord
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Fri Jun 15, 2012 14:54    Post subject: Reply with quote

pixelord wrote:
Could you please explain what would be the problem to do so? For example, if I want to integrate some AI engine to control the NPC, what would be the best design you would suggest?

Thanks,
Not a problem, you just have to do low-level stack operations and call script VM directly.
If your AI code is in Java or Ruby, you can use the existing plugins to link it to NWN functions.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
pixelord



Joined: 24 Oct 2011
Posts: 15

PostPosted: Fri Jun 15, 2012 14:58    Post subject: Reply with quote

Yes my AI would be developed in Java.
The existing plug in means NWNX_Ruby? If yes, could you give me the latest source code link? thanks.
_________________
Pixelord
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Fri Jun 15, 2012 15:20    Post subject: Reply with quote

nwnx_jvm:
http://www.nwnx.org/phpBB2/viewtopic.php?t=1478
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
pixelord



Joined: 24 Oct 2011
Posts: 15

PostPosted: Fri Jun 15, 2012 17:16    Post subject: Reply with quote

Thanks!
Does it have a windows version or is it a Linux only plugin?
_________________
Pixelord
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Fri Jun 15, 2012 18:11    Post subject: Reply with quote

Linux only.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
pixelord



Joined: 24 Oct 2011
Posts: 15

PostPosted: Sat Jun 16, 2012 3:49    Post subject: Reply with quote

Sorry to bother you again, is nwnx_jvm is stable enough? Can I build my Java code around it?

Thanks!
_________________
Pixelord
Back to top
View user's profile Send private message
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