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 
 
Call a script from a NWNX4 plugin

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
fb_ba



Joined: 24 Jun 2013
Posts: 11

PostPosted: Mon Jun 24, 2013 18:41    Post subject: Call a script from a NWNX4 plugin Reply with quote

Hi people, can anyone help me ???

I'm using NWNX4 to take some info from a simple script which runs in my Neverwinter Nights 2 level.
More exactly, from a script attached to an event of the game (for example "On Heartbeat") i send a string to my
NWNX4 dll plugin.


My question is:

since i'd like to do the opposite from what i do actually, is there a trick to call my script directly from the C++ code
of the NWNX4 plugin ??

Thanks for the help !!!
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Mon Jun 24, 2013 19:13    Post subject: Reply with quote

Yes. See xp_chat sources, it calls RunScript to handle the chat event:
http://nwn.virusman.ru/svn/nwnx4/trunk/src/plugins/chat/hook.cpp
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
fb_ba



Joined: 24 Jun 2013
Posts: 11

PostPosted: Mon Jun 24, 2013 19:19    Post subject: Reply with quote

Ah wonderful !!!

And works it in the windows version of the source code ?
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Mon Jun 24, 2013 20:03    Post subject: Reply with quote

Yes. NWNX4 is Windows-only.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
fb_ba



Joined: 24 Jun 2013
Posts: 11

PostPosted: Tue Jun 25, 2013 10:24    Post subject: Reply with quote

mmmm ... when i try to buold the solution i receive this:

1>LINK : fatal error LNK1181: cannot open input file 'detours.lib'

where is this file ??
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Tue Jun 25, 2013 11:55    Post subject: Reply with quote

Build Detours project first.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
fb_ba



Joined: 24 Jun 2013
Posts: 11

PostPosted: Tue Jun 25, 2013 14:15    Post subject: Reply with quote

Sorry but it doesn't compile Sad

From the "Properties" of the project "chat" i choose "Project Build order";
by the tab "Dependencies" i set that "Project: chat depends on: Detours"

Is this the correct way?

It is possible to put directly the file "detours.lib" in the right directory (maybe \..\lib\detours) ????
Back to top
View user's profile Send private message
fb_ba



Joined: 24 Jun 2013
Posts: 11

PostPosted: Tue Jun 25, 2013 15:17    Post subject: Reply with quote

Ok it was my fault !!

I used to do "Rebuilt" instead of "Built" command
Back to top
View user's profile Send private message
fb_ba



Joined: 24 Jun 2013
Posts: 11

PostPosted: Tue Jun 25, 2013 23:25    Post subject: Reply with quote

Virusman i'm not very skilled in C++ ... could you explain a little how the chat plugin works and how the "runScript" is used ??

Is there a .mod which uses this module ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> 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