View previous topic :: View next topic |
Author |
Message |
pixelord
Joined: 24 Oct 2011 Posts: 15
|
Posted: Fri Jun 15, 2012 11:31 Post subject: Calling NWNScript function from NWNX plugin |
|
|
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 |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Fri Jun 15, 2012 13:51 Post subject: |
|
|
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 |
|
|
pixelord
Joined: 24 Oct 2011 Posts: 15
|
Posted: Fri Jun 15, 2012 14:26 Post subject: |
|
|
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 |
|
|
pixelord
Joined: 24 Oct 2011 Posts: 15
|
Posted: Fri Jun 15, 2012 14:33 Post subject: |
|
|
In a different topic, is there any documentation regarding NWScript VM and NeverWinter Night 1 Opcodes? _________________ Pixelord |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Fri Jun 15, 2012 14:54 Post subject: |
|
|
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 |
|
|
pixelord
Joined: 24 Oct 2011 Posts: 15
|
Posted: Fri Jun 15, 2012 14:58 Post subject: |
|
|
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 |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
|
Back to top |
|
|
pixelord
Joined: 24 Oct 2011 Posts: 15
|
Posted: Fri Jun 15, 2012 17:16 Post subject: |
|
|
Thanks!
Does it have a windows version or is it a Linux only plugin? _________________ Pixelord |
|
Back to top |
|
|
virusman
Joined: 30 Jan 2005 Posts: 1020 Location: Russia
|
Posted: Fri Jun 15, 2012 18:11 Post subject: |
|
|
Linux only. _________________ In Soviet Russia, NWN plays you! |
|
Back to top |
|
|
pixelord
Joined: 24 Oct 2011 Posts: 15
|
Posted: Sat Jun 16, 2012 3:49 Post subject: |
|
|
Sorry to bother you again, is nwnx_jvm is stable enough? Can I build my Java code around it?
Thanks! _________________ Pixelord |
|
Back to top |
|
|
|